fix(background-agent): suppress redundant parent wakes during gate hold#4325
Merged
code-yeongyu merged 2 commits intoMay 23, 2026
Merged
Conversation
added 2 commits
May 23, 2026 18:45
Owner
Author
|
@cubic-dev-ai review this PR |
@code-yeongyu I have started the AI code review. It will take a few minutes to complete. |
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
Root Cause
The parent wake notifier tracked the last dispatched wake, but the same-source reserved-path check only suppressed byte-for-byte identical pending wake arrays. Duplicate background completion edges could collect repeated copies of the already-dispatched notification during the post-dispatch hold, turning
["wake A"]into["wake A", "wake A"]. Strict equality treated that as new work, requeued it, and launched a second internal parent prompt after the hold released.Changes
Testing
bun test src/features/background-agent/parent-wake-same-source-requeue.test.ts- 6 pass, 0 fail, 41 expectations.bun test src/features/background-agent/parent-wake-same-source-requeue.test.ts src/features/background-agent/parent-wake-active-turn-event.test.ts src/features/background-agent/parent-wake-user-message-race.test.ts src/features/background-agent/task-completion-cleanup.test.ts src/shared/prompt-async-route-audit.test.ts- 52 pass, 0 fail, 176 expectations.bun run typecheck- pass.bun run build- pass.bun test > /tmp/omo-bugfix-bun-test-after-merge.log 2>&1- exit 0, 3,401 pass lines, no fail/error lines.Evidence
ses_1ace82b4dffeDeez3U2yA4eONrand child sessions from the transcript/logs.git fetch --all --prune && git pull --ff-only; current OpenCodepromptAsyncstill returns before the prompt run durably settles.11d2cfb8aand strict duplicate suppression in560569e36.Summary by cubic
Prevents duplicate parent prompts by suppressing redundant background-agent wakes while
promptAsyncholds a reservation. Keeps meaningful follow-ups (new notifications, reply upgrades, and prompt-context changes) so they dispatch after the hold.Written for commit 1023841. Summary will update on new commits. Review in cubic