@ogulcancelik/pi-spar 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/core.ts +11 -0
  2. package/package.json +1 -1
package/core.ts CHANGED
@@ -585,6 +585,17 @@ export async function sendMessage(
585
585
  throw new Error(`Session "${sessionName}" doesn't exist. Provide a model to create it.`);
586
586
  }
587
587
  info = createSession(sessionName, options.model, options.thinking);
588
+ } else if (options.model) {
589
+ const requestedModel = resolveModel(options.model);
590
+ if (requestedModel.fullModel !== info.model) {
591
+ const existingLabel = getModelAlias(info.model) ?? info.model;
592
+ const requestedLabel = getModelAlias(requestedModel.fullModel) ?? options.model;
593
+ throw new Error(
594
+ `Session "${sessionName}" already exists with model "${existingLabel}". ` +
595
+ `You requested "${requestedLabel}". Session names must be unique per model. ` +
596
+ `Use a different session name or omit model to continue the existing session.`
597
+ );
598
+ }
588
599
  }
589
600
 
590
601
  const timeout = options.timeout ?? DEFAULT_TIMEOUT;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ogulcancelik/pi-spar",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Agent-to-agent sparring for pi. Back-and-forth conversations with peer AI models for debugging, design review, and challenging your thinking.",
5
5
  "type": "module",
6
6
  "keywords": [