-
Notifications
You must be signed in to change notification settings - Fork 51
[Fix] The completion check skips every task delegated from a Session #3083
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c6585e2
[Fix] The completion check skips every task delegated from a Session
mrubens b201d6e
Keep the harness's own reminder prompts out of the request the check …
mrubens eb3de9b
Mark the continuations the harness queues on its own so transcript re…
mrubens 8153003
Keep a queued prompt's source across a queue restore
mrubens 293dae1
Count a hidden prompt only as the opening request, never as a follow-up
mrubens File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
15 changes: 15 additions & 0 deletions
15
apps/worker/src/sandbox-server/lib/harnesses/__tests__/opencode-server.test.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
apps/worker/src/sandbox-server/lib/harnesses/__tests__/runtime-prompt-queue.test.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
71 changes: 67 additions & 4 deletions
71
packages/cloud-agents/src/server/__tests__/task-completion-gate.test.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing this filter also admits the harness's hidden
UserPromptrecords. For example,submitPrompt()persists the completion-gate reminder withvisibleInTranscript: false; on the next gate pass it becomes a follow-up request. That can make the judgment evaluate its own remediation instructions and repeatedly flag an otherwise completed task. Keep filtering those system-injected/reminder prompts while allowing the delegated opening request, and add a regression test for a hidden completion-gate reminder.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
sourcecheck does not cover the hidden continuations sent throughdrainQueuedPrompts(). Provider-error/rate-limit retries, visual-proof recovery, and plan-exit continuations are enqueued withvisibleInTranscript: falsebut nosource; the drain persists them asUserPromptrows without a source. With the visibility SQL filter removed, these messages still enterfollowUpsand can influence a later completion judgment. Preserve an origin/source for queued harness prompts (or otherwise exclude them) and add coverage for one queued hidden continuation.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still possible after a queue restore:
RuntimePromptQueue.restore()rebuilds each message without copyingsource. A reconnect, or ashouldBlockPrompt/shouldReconnectreplay, therefore drains the hidden continuation without itsopencode-*marker and lets it enter completion-gate follow-ups. Preservesourceinrestore()and cover a restored hidden continuation.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copying
sourcethroughrestore()fixes the reconnect path, but the predicate only excludesopencode-*sources.run-task.tsalso delivers hidden environment-setup notices withsource: 'environment-setup';handleSendMessage()persists those asUserPromptrows. They now passisHarnessPrompt()and are included as completion-gate follow-ups, so the judge can still receive a platform notification as user work. Exclude known non-user hidden prompt sources (or retain a reliable request-origin marker) and cover this path.