fix(runtime): preserve Agent Graph results across session revisions - #5512
Open
chinawch007 wants to merge 1 commit into
Open
chinawch007 wants to merge 1 commit into
chinawch007 wants to merge 1 commit into
Conversation
Recognize child references in persisted JSON agent_output responses, including diagnostic views and archived results, so editing a follow-up after Graph completion can create a revision without losing child results. Validate retained child ownership, Graph and terminal Run identities, and allow historical polls only alongside a terminal result for the same Run. Preserve validated references within the revision family. Copy independent Side Conversations as static snapshots with rewritten Artifact links and reconstructible ledger archives, including subsequent copies. Cover the complete Graph completion, follow-up, edit-and-resend workflow through the production Host, along with reference and archive regressions. Fixes apache#5331 Generated-by: OpenAI Codex
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
Fixes #5331
Editing and resending a follow-up after Agent Graph completion could fail with
operation_unavailable: revision preflight recognizedsubagentandagent_swarmresults, but missed the child references in persisted JSONagent_outputresponses. The revision now retains those references so the edited question can run in a new version while the original version remains available.agent_outputenvelope across result and diagnostic views, including historical JSON in messages, RuntimeEvents, and legacy archive bodies. Validate child ownership, retained parent turns, Graph identity, terminal Run/event identity, lineage, and Artifact ownership. An earlier running poll is accepted only when retained history also contains a terminal result for the same child, Run, and Turn.Verification
Passed
npm run lint,npm run format:check,npm run build, andnpm run typecheck.Passed
npx --no-install knip --workspace apps/desktopandnpx --no-install knip --workspace packages/ui.Passed 72 tests across
conversation-copy-agent-output,conversation-copy,session-revision-graph-references,session-revision-diagnostics, andsession-revision-protocolafter rebuilding.Passed the targeted production Host integration test:
A baseline comparison using the same historical JSON fixture collected 0 child references at
4dc6a47f9and 1 with this fix.Not run: full repository
npm testand manual Desktop UI reproduction. The integration test uses a local provider fixture, not a live external model.AI use
Select exactly one:
Tool(s) and scope: OpenAI Codex — code review, regression verification, commit preparation, and this PR description. The commit includes
Generated-by: OpenAI Codex.Checklist
Does this PR entail a change in behavior?