fix(opencode): keep concurrent task resumes foreground#38758
Open
rekram1-node wants to merge 1 commit into
Open
fix(opencode): keep concurrent task resumes foreground#38758rekram1-node wants to merge 1 commit into
rekram1-node wants to merge 1 commit into
Conversation
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
background: truewas explicitly requestedtask_idRoot cause
TaskToolattemptedBackgroundJob.extendbefore its normal foreground/background branch. Any successful extension returnedmetadata.background: true, even when background mode was disabled and absent from the tool schema. Because this path also skipped promotion andnotify(...), the implicitly background task could finish without injecting its synthetic completion result.The fix retains
BackgroundJob.extendso the second prompt is not dropped and remains serialized behind the active run. A foreground extender now waits for shared job settlement, while only an explicit background extender returns immediately.Test plan
bun test --timeout 30000 test/tool/task.test.tsbun typecheck