From f0f840e6e02f65a4b56b12a2b590e8bf642a13be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=A9=98?= Date: Fri, 22 May 2026 09:16:13 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20StepOutput.sessionId=20=E2=86=92=20strin?= =?UTF-8?q?g=20|=20null,=20legacy=20fallback=20=E2=86=92=20null?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/cli-workflow/src/commands/thread.ts | 7 +++++-- packages/workflow-protocol/src/types.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/cli-workflow/src/commands/thread.ts b/packages/cli-workflow/src/commands/thread.ts index b1a6c51..f695e30 100644 --- a/packages/cli-workflow/src/commands/thread.ts +++ b/packages/cli-workflow/src/commands/thread.ts @@ -200,6 +200,7 @@ export async function cmdThreadShow(storageRoot: string, threadId: ThreadId): Pr thread: threadId, head: activeHead, done: false, + sessionId: null, }; } @@ -210,6 +211,7 @@ export async function cmdThreadShow(storageRoot: string, threadId: ThreadId): Pr thread: threadId, head: hist.head, done: true, + sessionId: null, }; } @@ -626,7 +628,7 @@ function resolveAgentConfig( type SpawnAgentResult = { stepHash: CasRef; - sessionId: string; + sessionId: string | null; }; function spawnAgent(agent: AgentConfig, threadId: ThreadId, role: string): SpawnAgentResult { @@ -668,7 +670,7 @@ function spawnAgent(agent: AgentConfig, threadId: ThreadId, role: string): Spawn if (!isCasRef(line)) { fail(`agent stdout is not a valid CAS hash or JSON: ${line || "(empty)"}`); } - return { stepHash: line, sessionId: "" }; + return { stepHash: line, sessionId: null }; } async function archiveThread( @@ -717,6 +719,7 @@ export async function cmdThreadStep( thread: threadId, head: headHash, done: true, + sessionId: null, }; } diff --git a/packages/workflow-protocol/src/types.ts b/packages/workflow-protocol/src/types.ts index 01e3ec8..ec43431 100644 --- a/packages/workflow-protocol/src/types.ts +++ b/packages/workflow-protocol/src/types.ts @@ -81,7 +81,7 @@ export type StepOutput = { thread: ThreadId; head: CasRef; done: boolean; - sessionId?: string; + sessionId: string | null; }; /** uwf thread steps — single step entry */