Repository navigation
Install repository OpenCode dependencies up front and accept mentions after opening punctuation - #231
Conversation
OpenCode installs the dependencies of each config directory with a package.json in the background at startup. A repository whose .opencode/ tools import @opencode-ai/plugin could have a tool load before that install finished, failing the run with "Cannot find module '@opencode-ai/plugin'"; a retry on the same build then succeeded. Before the main run, and before specialists start in their worktree at the pull request head, run bun install in every OpenCode config directory (the checkout's .opencode/, the global config directory and OPENCODE_CONFIG_DIR) that has a package.json but no node_modules. It uses --frozen-lockfile when a bun lockfile exists and --no-save otherwise, so no lockfile is left in the checkout. It is bounded by a timeout, and a failure is only a warning since OpenCode still tries its own install.
The whole-word mention check required the start of the comment or whitespace before a mention, so "Please review (@ask-bonk)" started the workflow but the action then skipped it. A mention may now also follow ( [ { " ' <. Path and word characters and backticks before it still disqualify it, so .github/workflows/bonk.yml, a/bonk and `/bonk` do not match.
|
Review: 1 finding (1 warning; 1 note). I checked all seven specialist findings against the code and kept two, both in
I dropped the other five findings and recorded a reason for each in the review file. Other findings
Specialist findings not posted (5)
Reviewed commit: 83f35bd3 · github run |
| }); | ||
| const timer = setTimeout(() => proc.kill("SIGKILL"), INSTALL_TIMEOUT_MS); | ||
| try { | ||
| const [exitCode, stderr] = await Promise.all([ |
There was a problem hiding this comment.
[WARNING] The 2-minute timeout doesn't actually cap this call. proc.kill("SIGKILL") kills only the bun process, but Promise.all also waits for new Response(proc.stderr).text(). That promise resolves only after every process holding the stderr pipe closes it. Lifecycle scripts that bun started (the .opencode/package.json root postinstall, or dependency scripts) inherit the pipe and keep running after bun is killed. If one of them runs long or stays in the background, installOpenCodeDependencies never returns, and the run hangs until the job timeout without logging anything. Await proc.exited first. Then read stderr with a short bound, for example by racing it against a timer or cancelling the reader after exit.
🚀 Deploying Preview to Cloudflare 🚀Preview Deployments by commit
|
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
ask-bonk | 83f35bd | Sep 28 2026, 04:54 PM |
Two fixes found after v0.5.1. Two independent commits.
1. Install repository OpenCode dependencies before starting OpenCode
OpenCode installs each config directory's
package.jsondependencies in the background at startup, so a repository tool under.opencode/that imports@opencode-ai/plugincould load first and fail the run withCannot find module '@opencode-ai/plugin'; a retry on the same build succeeded. Before the main run, and before specialists start in their worktree at the PR head, Bonk now runsbun installin every OpenCode config directory (the checkout's.opencode/, the global config directory,OPENCODE_CONFIG_DIR) that has apackage.jsonbut nonode_modules. It uses--frozen-lockfilewhen a bun lockfile exists and--no-saveotherwise, so no lockfile is left in the checkout. It is bounded by a timeout, and a failure is only a warning.2. Accept mentions after opening punctuation
The whole-word check required the start of the comment or whitespace before a mention, so
Please review (@ask-bonk)started the workflow but the action skipped it. A mention may now also follow(,[,{,",'or<. Path and word characters and backticks before it still disqualify it, so.github/workflows/bonk.yml,a/bonkand`/bonk`do not match. The action's check and the prompt extraction change together.278 tests pass; typecheck, lint and build are clean after each commit.
🤖 Generated with Claude Code