episoda 0.2.112 → 0.2.113

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.
@@ -2815,7 +2815,7 @@ var require_package = __commonJS({
2815
2815
  "package.json"(exports2, module2) {
2816
2816
  module2.exports = {
2817
2817
  name: "episoda",
2818
- version: "0.2.111",
2818
+ version: "0.2.112",
2819
2819
  description: "CLI tool for Episoda local development workflow orchestration",
2820
2820
  main: "dist/index.js",
2821
2821
  types: "dist/index.d.ts",
@@ -8639,8 +8639,24 @@ var AgentManager = class {
8639
8639
  */
8640
8640
  async startSession(options) {
8641
8641
  const { sessionId, moduleId, moduleUid, projectPath, provider = "claude", autonomousMode = true, canWrite = true, readOnlyReason, message, credentials, systemPrompt, onChunk, onComplete, onError } = options;
8642
- if (this.sessions.has(sessionId)) {
8643
- return { success: false, error: "Session already exists" };
8642
+ const existingSession = this.sessions.get(sessionId);
8643
+ if (existingSession) {
8644
+ if (existingSession.provider === provider && existingSession.moduleId === moduleId) {
8645
+ console.log(`[AgentManager] EP1232: Session ${sessionId} already exists, treating start as message (idempotent)`);
8646
+ return this.sendMessage({
8647
+ sessionId,
8648
+ message,
8649
+ isFirstMessage: false,
8650
+ // Not first since session exists
8651
+ canWrite,
8652
+ readOnlyReason,
8653
+ onChunk,
8654
+ onComplete,
8655
+ onError
8656
+ });
8657
+ }
8658
+ console.log(`[AgentManager] EP1232: Session ${sessionId} exists with incompatible config - provider: ${existingSession.provider} vs ${provider}, module: ${existingSession.moduleId} vs ${moduleId}`);
8659
+ return { success: false, error: "Session already exists with incompatible configuration" };
8644
8660
  }
8645
8661
  const oauthToken = credentials?.oauthToken;
8646
8662
  const apiKey = credentials?.apiKey;