mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-12 02:37:45 +08:00
fix: Unify execution IDs between broadcast events and session storage
- Pass generated executionId to cliExecutorTool.execute as id parameter - Ensures CLI_EXECUTION_STARTED broadcast uses same ID as saved session - Fixes "Conversation not found" errors when querying by broadcast ID - Add DEBUG logging for executionId tracking This resolves the mismatch where: - Broadcast event used ID from Date.now() at broadcast time - Session saved used different ID from Date.now() at completion time - Now all use the same ID generated at cli.ts:868 Changes: - cli.ts:868 - executionId generated once - cli.ts:1001 - pass executionId to execute() as id parameter - cli-executor-core.ts automatically uses passed id as conversationId
This commit is contained in:
@@ -929,6 +929,10 @@ async function execAction(positionalPrompt: string | undefined, options: CliExec
|
|||||||
mode
|
mode
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (process.env.DEBUG) {
|
||||||
|
console.error(`[CLI] Generated executionId: ${executionId}`);
|
||||||
|
}
|
||||||
|
|
||||||
// Buffer to accumulate output when both --stream and --to-file are specified
|
// Buffer to accumulate output when both --stream and --to-file are specified
|
||||||
let streamBuffer = '';
|
let streamBuffer = '';
|
||||||
|
|
||||||
@@ -994,7 +998,7 @@ async function execAction(positionalPrompt: string | undefined, options: CliExec
|
|||||||
includeDirs,
|
includeDirs,
|
||||||
// timeout removed - controlled by external caller (bash timeout)
|
// timeout removed - controlled by external caller (bash timeout)
|
||||||
resume,
|
resume,
|
||||||
id, // custom execution ID
|
id: executionId, // unified execution ID (matches broadcast events)
|
||||||
noNative,
|
noNative,
|
||||||
stream: !!stream, // stream=true → streaming enabled (no cache), stream=false → cache output (default)
|
stream: !!stream, // stream=true → streaming enabled (no cache), stream=false → cache output (default)
|
||||||
outputFormat, // Enable JSONL parsing for tools that support it
|
outputFormat, // Enable JSONL parsing for tools that support it
|
||||||
|
|||||||
Reference in New Issue
Block a user