fix(opencode-handler): port to the opencode 2.x CLI - #119
Conversation
opencode 2.0 removed `run --attach` and `--dir`. The handler kept exiting 0 and forwarded the CLI help text as the chat reply. Use `--server` (default http://127.0.0.1:4096, OPENCODE_SERVER overrides, OPENCODE_ATTACH still honoured) and cd into OPENCODE_DIR, since 2.x takes the working dir from the client cwd. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe handler now targets OpenCode 2.x. It selects the server URL from updated environment variables, uses ChangesOpenCode handler compatibility
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The handler updates OpenCode 2.x server and working-directory handling while preserving retries; no actionable merge-blocking risk is identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Summary
opencode 2.0 removed
opencode run --attach/--dir. With the old flags the handler exited 0 and forwarded the CLI help text as the agent's chat reply.--attach→--server(defaulthttp://127.0.0.1:4096;OPENCODE_SERVERoverrides,OPENCODE_ATTACHstill honoured)--dir→cd "$OPENCODE_DIR"(2.x uses the client cwd as the session working dir)Test plan
shellcheck scripts/opencode-handler.shecho "Ciao, come va il test?" | scripts/opencode-handler.shagainst opencode 2.0.8 → one-line Italian reply, exit 0🤖 Generated with Claude Code
Summary by CodeRabbit