Fix Codex subagent relinking after session resume - #2539
Open
peterfotinis wants to merge 3 commits into
Open
Conversation
3 tasks
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.
Human comments
What was wrong
A recreated Codex translator loses its in-memory parent mapping for durable historical subagents. When the root later calls
followup_task, Codex emits aninteractedactivity for the child, but current app-server does not forward the raw collaboration call. BB therefore discarded the only surviving activity because the fresh translator did not know the child. The following child turn had noparentToolCallIdand was projected as foreground/root work, violating the runtime invariant that delegated child work must remain attached to its parent tool call. A later user prompt to the root could then be rejected as a competing turn.Issue #2538 documents this restart/resume gap left after the in-session correlation added in #1361; the earlier investigation in #807 describes the same failure class.
What changed
followup_taskversussend_messageintent when Codex supplies it, but do not require that notification.interactedactivity until a non-user-initiated childturn/startedproves it was turn-producing, then reconstruct the delegation and attach that child turn.send_messagecannot steal a later human or subagent turn.HOST_DAEMON_PROTOCOL_VERSIONfrom 171 to 172 because daemon-visible turn-parent semantics changed.How you verified
parentToolCallId, its delegation row had no self-parent, and a root prompt submitted while the child was running was accepted instead of rejected.git diff --check.Fixes #2538