Repository navigation
Preserve Session completion replies after background notifications - #1416
Merged
Merged
Conversation
A child result that ends on a completion line was kept when the root session's later reply had none, so that delegated text could replace the root security review. Root results still supply the handoff.
Merged
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
Keep a Session's completion-bearing reply when a later background-task notification produces a reply without a completion line. Claude and Grok share this selection, so every existing completion-line reader receives the same preserved reply. Later completion lines still win.
Closes #1405.
Evidence
main(06f08b4c),cargo test --bin thirdshift harness::interpretation_tests::completion_line_survives_background_notification -- --exactfailed with exit 101: both Grok and Claude returned the background-notification reply instead ofPR ready.\nBug reproduced: fixed.After: The same command passed (1 test). The retained test also passes in the final interpretation suite.
cargo test --bin thirdshift harness::interpretation_tests::assistant_completion_line_survives_a_late_result, failed with exit 101 on the initial fix: the earlier completion line appeared only in an assistant message, while the late reply supplied the single result.After: The same command passed (1 test), and its regression test remains in the change.
final_message; earlier assistant text was available to trace recording but was ignored by reply selection. The shared interpreter now remembers completion-bearing root assistant and result replies. Payload validation, terminal outcomes, and child-message filtering remain with their existing owners.cargo test --bin thirdshift harness::interpretation: 89 passed, 1 ignored.cargo test --test bug_run: 14 passed, 1 ignored. Both Claude and Grok replay the single-result notification pattern for reproduced/not-reproduced endings; missing completion lines retain the exact existing error.cargo fmt --checkandgit diff --check: passed.scripts/affected-tests main: passed, including all 50 site tests and the full Rust suite. Nextest was unavailable, so the selector usedcargo test;/usr/bin/time -pmeasured the Rust run at 1,373.54 seconds wall time, including compilation.Test seams
condense/decodeandfinishtoEnded.final_messageandrequire_final_message.Review coverage
Standards: 0 findings. Spec: 1 finding, reproduced and fixed; its regression test was kept. Both reviewers inspected every changed file, including the follow-up fix. Unread changed files: none. Generated-output exclusions: none.
Unaddressed findings
Standards
None.
Spec
None.
Security
None.
Security review outcome
No unaddressed introduced findings.
Merge Danger
Door: two-way
Revert the code change to restore prior reply selection.
Blast Radius: Sessions
Changes which reply completion-line readers receive from Claude and Grok when background notifications cause extra replies.
Built with codex codex-cli 0.164.0 · gpt-6.1-sol · xhigh