feat(agentic): persist subagent sessions and stabilize flow chat session handling#812
Merged
Conversation
…und subagent state - persist internal subagent sessions with relationship metadata instead of treating them as non-persisted hidden sessions - add include_internal restore flows and dedicated subagent-session-linked events across desktop, transport, and service APIs - simplify agent stream and event handling by removing per-event subagent parent payloads and linking child sessions through session metadata - add flow chat background subagent projection UI, session metadata support, and localized labels for subagent status - update store, websocket handling, and tests to cover internal session restore paths and subagent projection behavior
…tionship - add structured session relationship contract across core, desktop API, and web UI - stop persisting /btw child sessions by introducing EphemeralChild session kind - persist review, deep review, and subagent lineage via relationship and deep review manifest payloads - remove frontend legacy relationship writes from session metadata persistence - clear legacy child lineage when branching sessions and keep fallback reads for old data - add regression tests for child session restore, lineage persistence, and metadata compatibility
- reuse existing text and thinking items for late chunks on closed rounds - add round_id to tool events across core, transport, and frontend handling - attach late tool Started/EarlyDetected events to their original round - reject tool events missing round context instead of falling back to the latest round - add regression coverage for late text, thinking, and tool event scenarios
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
This PR improves subagent session persistence and lineage tracking across core, desktop APIs, transport, and the shared web UI. It also fixes several flow chat consistency issues, especially around late stream/tool events, rollback cleanup, and a couple of UX edge cases in BTW and terminal interactions.
What Changed
Details
Subagent session persistence and visibility
Child session lineage refactor
/btwchild sessions as normal session data by using an ephemeral child session kind where appropriateLate event / round consistency
round_idto tool events across core, transport, and frontend handlingRollback cleanup
UX fixes
Impact
This PR mainly improves:
Testing
Notes
This PR includes both backend and frontend changes, with the main theme being session relationship normalization and more reliable subagent/round behavior across the stack.