Skip to content

fix(core): resume background completions - #35850

Closed
opencode-agent[bot] wants to merge 1 commit into
v2from
background-return
Closed

fix(core): resume background completions#35850
opencode-agent[bot] wants to merge 1 commit into
v2from
background-return

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • schedule a forced follow-up drain when synthetic context is published
  • preserve forced wake intent when it coalesces into an active Session execution
  • cover the instant background-completion race at the runner and coordinator seams

Root cause

Background shell and subagent completion notifications publish durable synthetic context through SessionV2.synthetic. That method called SessionExecution.resume, which joins an already-active execution without ringing its doorbell. If the active continuation had already loaded Session history, it could settle without ever showing the completion context to the model. Very fast work also sometimes completed before the continuation loaded history, which explains why it appeared in the current turn instead.

Tests

  • bun test test/job.test.ts test/tool-shell.test.ts test/tool-subagent.test.ts test/session-prompt.test.ts test/session-run-coordinator.test.ts test/session-runner.test.ts --timeout 10000 (180 pass)
  • bun x prettier --check packages/core/src/session.ts packages/core/src/session/execution.ts packages/core/src/session/run-coordinator.ts packages/core/test/session-run-coordinator.test.ts packages/core/test/session-runner.test.ts
  • bun typecheck
  • git diff --check

Source: https://slack.com/archives/C0BE69AHCQP/p1783480431516769

@opencode-agent

opencode-agent Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of a design issue: synthetic background completion should use the durable Session inbox with steering semantics rather than a forced coordinator wake.

@opencode-agent opencode-agent Bot closed this Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant