fix(session): preserve failed subtask metadata#1268
Open
onlyfeng wants to merge 1 commit into
Open
Conversation
Preserve failed subtask tool metadata through error transitions so the TUI can navigate into failed subtasks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
sessionIdandmodel, 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
recoverable: trueinto existing metadata instead of replacing it.Validation
bun typecheckbun test --timeout 60000 test/session/prompt-effect.test.ts -t "failed subtask preserves metadata"CI Status Note
lintandtypecheckpass on this PR.unitcurrently fails, butupstream/main@ee4ddd2already has a failingtestworkflow (run28071223407).failed subtask preserves metadata on error tool stateis absent from this PR unit failure list.Claude Code local MCP server is pending until explicitly connectedfailure is covered by companion PR fix(mcp): keep Claude imports pending until connect #1269, not this metadata change.CheckpointContext producer,parentSessionID end-to-end, andsession.llm.streamfailures are also present on currentupstream/mainand are outside this diff.WorkflowRuntime cancel cascadetimeout appeared in this PR run; this diff does not touch workflow runtime cancellation, so it should be tracked separately if it reproduces.