Repository navigation
fix(opencode): stop asking on the phone after terminal turns - #26
Merged
Merged
Conversation
The OpenCode rule carried the no-hook REMOTE entry preamble, which orders a hwip_ask after substantial work even in NORMAL. On OpenCode 2.1.3 that pushed an ask to the phone at the end of a turn the user had typed at the PC terminal. The preamble exists because a hook-less agent has no other way into REMOTE. OpenCode's 2.x plugin API is an event stream with no per-turn hook, so the phone-vs-terminal check cannot be added there. Drop the preamble for OpenCode instead: NORMAL owes no ask, and REMOTE starts only from an ask the agent chooses to send. A phone message to an OpenCode session now gets the completion push rather than buttons.
tak-bro
marked this pull request as ready for review
October 29, 2026 02:55
|
🎉 This PR is included in version 0.1.12 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
PC 터미널에서 OpenCode 에 지시했는데, 턴이 끝날 때 OpenCode 가 폰으로
hwip_ask를 보냈다. 원인은 OpenCode 규칙에 들어간 "Entering REMOTE without a prompt hook" 절이다. 이 절은 NORMAL 에서도 큰 작업 뒤에hwip_ask를 보내라고 시킨다. OpenCode 규칙에서 이 절을 뺐다.Changes
src/templates.ts—OPENCODE_RULE에서remoteEntry: REMOTE_ENTRY_NO_HOOK를 제거했다. full core 는 그대로 둔다(REMOTE 규칙을 넣어 줄 훅이 없어서). 사유는 문서 주석에 적었다. 헤더와 preamble 주석도 고쳤다.src/rules-sync.test.ts— "OpenCode does not order a hwip_ask after NORMAL work" 테스트를 추가하고, 훅 없는 에이전트 목록에서 OpenCode 를 뺐다.src/templates.test.ts— 규칙과 훅 레지스트리가 맞는지 보는 검사에PREAMBLE_OPT_OUT = ['opencode']를 추가했다.README.md— 훅 없는 에이전트 절에 OpenCode 예외와 그 대가를 적었다.Why not wire OpenCode to
remote-hookOpenCode 1.x 플러그인에는
chat.message·experimental.chat.system.transform훅이 있다. 2.1.3 바이너리에는 둘 다 없다. 2.x 플러그인은setup이벤트 스트림만 받는다. 턴 컨텍스트를 넣을 후보로 실험 APIsession.instructions.entry.put이 있지만, 플러그인 context 에서 접근할 수 있는지와 첫 모델 호출 전에 반영되는지를 검증하지 못했다.How to Test
Evidence
OPENCODE_RULE에after substantial work in NORMAL, end the response with가 있었다.src/http-proxy.test.ts제외).src/http-proxy.test.ts는 8건이 실패한다. 깨끗한 origin/main 에서도 같은 8건이 실패하므로 이 PR 과 무관한 기존 문제다.Risks
~/.config/opencode/AGENTS.md는 재설치(hwip setup)해야 바뀐다.Merge danger
Door: two-way · Blast radius: opencode-rules
Alternatives considered
Checklist
🤖 Generated with Claude Code