Repository navigation
fix(T700): OpenCode v2 places the resume note and never drops it on a receipt - #376
Merged
Merged
Conversation
… receipt OpenCode 2.x drives the plugin default `setup(ctx)` path and marks a turn at `session.execution.started` before the first tool. The busy-turn guard then treated every tool as mid-turn, so a revisit notice could only fall back; at the turn's end the plugin admitted it with `resume:false`, whose msg_ receipt can arrive without a session_message (T544), and discarded the pending copy. - Track tools-per-turn so the first tool of a turn places the note even when the v2 start event already marked the turn. - Drop a kept note only after it actually lands in a tool result. A stop no longer admits it through a receipt; `resume:true` is not used because starting a turn on an idle TUI is not the job of a resume note. - Keep a fresh conversation's start note on its existing queued admission, which the host materialises as the conversation begins. - Add v2 harness tests for both failures; update the two T187 hook tests that encoded the old receipt-retry contract. Checks: the two v2 tests fail on the pre-fix template and pass after it; opencode-resume, opencode-hooks, opencode-no-duplicate-loop, opencode-poller-wake, the full opencode-* suite, tsc --noEmit, npm run build.
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.
OpenCode 9dddcd9 (base 65f9040). Fixes the live T187 failure on 0.5.48 (OpenCode 2.0.32, v2 plugin path). Two causes:
session.execution.startedmarked the turn before the firsttool.execute.after, so the note could never ride a tool result.resume:falsequeue admission returned a receipt but wrote no session message, so the note was acknowledged and dropped.Fix (opencodePluginSource only):
New v2 harness tests in test/opencode-resume.test.ts went red→green (3 failures before, 8/8 after). Two opencode-hooks tests that encoded the superseded drop-on-receipt contract are updated. opencode-* suites 206/207 (1 pre-existing skip), tsc clean, no dist drift. CHANGELOG Unreleased only. A live re-check needs a service restart after release.
🤖 Generated with Claude Code