Skip to content

Commit b1d4c50

Browse files
tonyxiaoclaude
andcommitted
feat(protocol): add top-level status field to EofPayload
Add RunStatus directly on EofPayload so clients can read the terminal run status without drilling into run_progress.derived.status. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Committed-By-Agent: claude
1 parent af38bed commit b1d4c50

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

apps/engine/src/__generated__/openapi.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/engine/src/lib/engine.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,11 +548,13 @@ export async function createEngine(resolver: ConnectorResolver): Promise<Engine>
548548
// takeLimits appends a minimal eof signal ({ type: 'eof', eof: { has_more } })
549549
if (raw.type === 'eof') {
550550
const hasMore = (raw as { eof: { has_more: boolean } }).eof.has_more
551+
const runProgress = syncState.sync_run.progress
551552
yield emit(
552553
engineMsg.eof({
554+
status: runProgress.derived.status,
553555
has_more: hasMore,
554556
ending_state: syncState,
555-
run_progress: syncState.sync_run.progress,
557+
run_progress: runProgress,
556558
request_progress: requestProgress,
557559
})
558560
)

packages/protocol/src/protocol.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@ export type SyncState = z.infer<typeof SyncState>
416416

417417
export const EofPayload = z
418418
.object({
419+
status: RunStatus.describe('Terminal run status derived from stream outcomes.'),
419420
has_more: z
420421
.boolean()
421422
.describe(

0 commit comments

Comments
 (0)