Repository navigation
fix(chat): report the sender's refusal when OpenCode skill typing is stopped before anything is typed - #1799
Conversation
…stopped before anything is typed
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Preserve refusals before typing server/core/composer.ts, changelog.d/opencode-skill-refusal.md |
The wrapped text and key writers mark typing only after a permitted write. If no write succeeds, the composer throws the preserved refusal instead of the typing error. The changelog records the reported behavior. |
Verify refusal before typing server/opencode-first-message.contract.test.ts |
The test setup supports explicit pane states and WebSocket connections. A new test checks that a switch to observe mode before an @effect write returns read_only and writes or types no text. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Possibly related PRs
- devswha/ovis#1792: Both changes address sender authorization during immediate chat delivery in
server/core/composer.ts. - devswha/ovis#1796: Both changes preserve authorization refusals in
createSubmitTexttyping paths. - devswha/ovis#1798: Both changes preserve the sender's refusal instead of returning a typing cancellation error.
Merge Risk: 
Minimal · up to 169b8
-
The change appears ready to merge after normal checks: an OpenCode skill message refused before typing is reported as unsent rather than partially typed.
Pre-merge checks: 
5
-
Full details: Description check
-
Explanation
The description explains the problem, resulting behavior, implementation scope, regression test, contract-test coverage, verification results, and explicitly notes the queued-delivery limitation. It uses Summary and Verification headings instead of the template's Change and Validation headings, but it provides the required information.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. (1 skipped: 1 unsupported.)
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
Merge pass: this touches observe permissions, so this comment records the review. A gate reviewer on a different model than the author's found no blocking issues. Behaviour checked:
Tests:
Test refactor: moving the setup into All required checks are green and no review thread is open. |
Summary
server/core/composer.ts, the OpenCode@skilltyping insubmitText: every write already passed the sender's check as herdr's write guard. Two problems remained.typedwas set as soon as the check before a write passed, before herdr was reached.submit_partial, "Part of the message was typed into OpenCode's input, but sending was not confirmed... Check the terminal", even though nothing was typed.typedis set only once herdr's guard lets a write through: the skill writes go through aSkillAttachIothat marks it.read_only,device_revoked, orsubmit_timeout).submit_partialstays as before.server/opencode-first-message.contract.test.ts:answers a sender that switched to observe while its @skill was on its way with its own refusal, typing nothing.@effectreaches the isolated test herdr, and the real RPC then asks the guard.read_only, and that no write went through and the stand-in received nothing.openCodePaneandconnect, shared with the first-message cases.changelog.d/opencode-skill-refusal.md.Verification
submit_partial. It passes with this change.server/opencode-first-message.contract.test.ts5/5,server/submit.contract.test.ts88/88.server/core,server/opencode-skill-attach.test.ts,server/opencode-native.test.tsandserver/conventions.test.ts: 145/145.bun run check fast.Not changed here: queued delivery types skills through its own guard in
server/core/pending.ts(open PR #1795 touches that file).