Repository navigation
fix(opencode): recover silent and ambiguous turns - #422
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
702ccd7e-d314-4bfc-97a2-68b100a6bb0fand anomalyco/opencode#46733.messageID, and recover ambiguous admission by checking the native transcript without resubmitting the prompt.session.messagesandsession.statuswith bounded polling/backoff, hydrate missing assistant/tool lifecycle events idempotently, emit one correlated terminal event only after native idle, and preserve interrupt/busy/session-replacement authority.Root cause and design
The affected OpenCode session executed the prompt and completed at
2026-09-18 10:00:07 PDT, while T3 observed no assistant, tool, error, or idle events after the turn started at2026-09-18 09:58:34 PDT. The adapter previously treatedsession.status idleSSE as the only completion authority, so a semantically silent but connected stream left the provider session running indefinitely.This change separates prompt admission, native execution evidence, transcript hydration, native status, and T3 terminal projection. It does not retry
promptAsyncafter ambiguous admission, preventing duplicate native work; it polls the transcript/status APIs instead and deduplicates replayed text/tool evidence. Busy follow-ups are rejected rather than silently submitted into a stale native session. anomalyco/opencode#46842 remains a separate upstream scheduling concern addressed here by serialized admission and native busy checks.Testing
pnpm fmt:check— passed.pnpm lint— passed with existing repository warnings only.pnpm typecheck— passed with existing repository suggestions only.pnpm exec vp test run apps/server/src/provider/Layers/OpenCodeAdapter.test.ts --no-file-parallelism— passed, 50/50 tests; repeated three times deterministically.pnpm test— passed: 2,436 tests passed, 9 skipped across 282 files; server serial suite 102/102 passed.Evidence
67c286280c1e412b98710bbcc2f7391425fc36f7.turn.completedafter a no-semantic-event blackout and reconstructs the missing assistant text from the native transcript.Breaking changes