Skip to content

Instantly share code, notes, and snippets.

@rm-rf-etc
Created April 23, 2026 20:35
Show Gist options
  • Select an option

  • Save rm-rf-etc/3c8a0fc3d33294e7e522bb21b33a222a to your computer and use it in GitHub Desktop.

Select an option

Save rm-rf-etc/3c8a0fc3d33294e7e522bb21b33a222a to your computer and use it in GitHub Desktop.
Comment template for PR coleam00/Archon#1372

Hi @choufeng! Great PR β€” exactly what we need. We tested it in our environment and applied fixes for all the CodeRabbit review items. Here's a patch you can apply directly:

Apply

curl -L https://gist.github.com/rm-rf-etc/fcdb35b3d0fba3a2e126d75b30c07c4c/raw/opencode-fixes.patch | git apply

Or if you prefer, add our branch as a remote and merge:

git remote add fixes https://github.com/obra/Archon fix/opencode-provider-review-fixes
git fetch fixes
git merge fixes/fix/opencode-provider-review-fixes

Summary of fixes

File Fix Source
provider.ts Pass server password via HTTP Basic Auth in createOpencodeClient β€” prevents 401s CodeRabbit 🟠 Major
server-manager.ts Use crypto.randomBytes instead of Math.random for password generation CodeRabbit 🟠 Major
server-manager.ts Add proc.stdout?.resume() to prevent pipe buffer deadlock CodeRabbit 🟑 Minor
server-manager.ts Add proc.on('exit', ...) handler to clear stale managedServer reference CodeRabbit 🟑 Minor
server-manager.ts Support OPENCODE_BIN_PATH env var for compiled binary spawn resolution Our testing
event-bridge.ts Guard tokens.total with ?? 0 to prevent NaN when fields are missing CodeRabbit 🟑 Minor
event-bridge.ts Remove dead token/cost accumulator (unreachable after early return) CodeRabbit Nitpick
config.ts Validate port range (1–65535, integer) in parseOpencodeConfig CodeRabbit Nitpick
provider.test.ts Fix mock: session.status β†’ session.get to match provider code CodeRabbit πŸ”΄ Critical

Testing

All fixes pass bun run type-check with zero errors. Provider successfully connects to an existing OpenCode server (autoStartServer: false) and creates sessions with model refs like zai/glm-5.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment