Skip to content

fix(session): preserve failed subtask metadata#1268

Open
onlyfeng wants to merge 1 commit into
XiaomiMiMo:mainfrom
onlyfeng:codex/upstream-failed-subtask-metadata
Open

fix(session): preserve failed subtask metadata#1268
onlyfeng wants to merge 1 commit into
XiaomiMiMo:mainfrom
onlyfeng:codex/upstream-failed-subtask-metadata

Conversation

@onlyfeng

@onlyfeng onlyfeng commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Preserve tool metadata when subtask execution fails so the TUI can keep navigation context for failed subtasks.

Root Cause

Subtask tool parts already carry metadata such as sessionId and model, but pending-state error handling dropped metadata before writing the final error state. Running tool-call error handling also overwrote metadata when adding the recoverable marker.

Changes

  • Preserve existing metadata when a running tool call transitions to error.
  • Merge recoverable: true into existing metadata instead of replacing it.
  • Preserve subtask metadata even when the tool part fails from pending state.
  • Update the regression test to run with an Actor layer so the actor tool path is exercised.

Validation

  • bun typecheck
  • bun test --timeout 60000 test/session/prompt-effect.test.ts -t "failed subtask preserves metadata"

CI Status Note

  • lint and typecheck pass on this PR.
  • Full unit currently fails, but upstream/main@ee4ddd2 already has a failing test workflow (run 28071223407).
  • This PR fixes its target failure: failed subtask preserves metadata on error tool state is absent from this PR unit failure list.
  • The remaining Claude Code local MCP server is pending until explicitly connected failure is covered by companion PR fix(mcp): keep Claude imports pending until connect #1269, not this metadata change.
  • The CheckpointContext producer, parentSessionID end-to-end, and session.llm.stream failures are also present on current upstream/main and are outside this diff.
  • One additional WorkflowRuntime cancel cascade timeout appeared in this PR run; this diff does not touch workflow runtime cancellation, so it should be tracked separately if it reproduces.

Preserve failed subtask tool metadata through error transitions so the TUI can navigate into failed subtasks.
@onlyfeng onlyfeng marked this pull request as ready for review June 24, 2026 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant