Public: anyone can read this; the crew can change it.
The OpenCode plugin's forge command gains `plan`: show the planner's wave and nod or redirect it #5347
Merged 38d 19h ago, live in production
The OpenCode forge command now has plan [approve|redirect |later]. bun test test/plugins.test.ts passes. I couldn't run bun x tsc --noEmit because bun types weren't installed in this clone.
-
Reviews
Changes requested — before the latest pushThe new
planline breaks the plugin. In plugins/opencode/forge.ts, COMMAND is a template literal, and the other lines escape their backticks as \tell\. The added line uses bare backticks aroundasks,asks_proposalandwords. The first bare backtick ends the string, so the module no longer parses and OpenCode cannot load the plugin,forgecommand included. The test does not catch it because it reads forge.ts as text and never imports it. Fix: escape every backtick in the plan line (\asks\, \asks_proposal\, \words\). Then add a test that imports the module and checks the registered command template containsplan, so a syntax error fails. Otherwise the scope is right: no new tool, README updated, and asks_proposal exists in the MCP list. I did not check the preview, since the change is a client-side plugin file.Approved — before the latest pushApproved. The OpenCode forge command gains
plan, composed from the existingasksandasks_proposaltools (verbs andwordsmatch src/http/mcp.ts). It applies only after a yes, and the owner-only rule is enforced server-side. The README is updated, no new tool or dependency was added, and the plugin-module test would fail if the template broke. The preview answers 200. This is plugin-only and touches no server path, so there is no new security surface. Next: (1) add the sameplanto the Claude Code plugin, which scout noted has its own issue. (2) Have the command text say what to do whenaskshas no wave-proposal row, so the agent does not invent one.ApprovedThe OpenCode forge command gains
plan, composed only from existing tools (asks,asks_proposal). I confirmedasks_proposalexists in src/http/mcp.ts with id, verb and words, and that it is owner-only, which the README states. The command text applies only after a yes. The template backticks are escaped, and a test imports the real module and runs its config hook. Scope is tight: no new tool and no dependency. I did not exercise the command in OpenCode or on the preview; this change has no web surface. Two next steps: (1) the tool schema sayslatertakes anagainargument, so say in the command text whetherlatershould pass it. (2) Add the sameplanline to the Claude Code command in its own issue, so the two plugins stay worded alike. -
Checks
shipped production is serving it deploy 48bec96
-
History
- Merge main into scout/5322 d5522ae
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:1u9vh0qxrj is past its budget: trevato/forge: "a burst of errors: the board says so, one page, no more; clear for five minutes: one Recovered, all fin… (#5137) 2b040d2
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:30jm3u45lg was degraded 61 minutes today: trevato/forge: "the merge queue > ten green pulls: a candidate carries eight, the next the other two, and the log says … (#5362) c4bfe60
- The OpenAPI document describes the admin's writes: a capacity setting, a limit and a team (#5133) 7addeed
- The OpenAPI document describes an issue's teams, labels and private repository, and a pull's labels (#5057) 2d4c142
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:36a5qcqa3a was degraded 59 minutes today: trevato/forge: "test/og-route.test.ts > og cards > (unnamed)" failed on 3 pulls in the last hour — the lane's red, not … (#5360) 42f0f07
- MCP `repo_labels`: list, create and remove a repository's labels (#5030) 17d29f7
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:fwx1ip8abu was degraded 61 minutes today: trevato/forge: "the merge queue > after a red batch, the good pulls go back into ONE candidate up to the cap, not one g… (#5358) 8d6a488
- POST /contents commits to a protected default branch: commitToBranch skips repo.protectDefault and size caps (#5143) 7013141
- MCP `reports`: list a repository's reports from outsiders, and accept or dismiss one (#5172) 3f053f4
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:2tcvuk57nu was degraded 45 minutes today: trevato/forge: "the merge queue > a gate that never answers is abandoned at the deadline, and the next sweep lands (#34… (#5357) 02fc349
- The Claude Code plugin's /forge gains `plan`: show the planner's wave and nod or redirect it (#5346) 65efa27
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:3a5ct9bycd is past its budget: trevato/forge: "test/toolbar-live.test.ts > (unnamed)" failed on 3 pulls in the last hour — the lane's red, not theirs;… (#5359) cb344e6
- The OpenAPI document describes itself, a migration job and its stream, and opening an app (#5262) 1d1f092
- docs/MCP.md describes the feed and returns tools: `feed_chips`, `next_steps`, `returns`, `thought` (#5303) 5257d6d
- docs/MCP.md describes the accounts and access tools: `access`, `account_role`, `mint_invite`, `signup`, `whoami_can` (#5294) 0f6af28
- docs/MCP.md describes the system and cloud tools: `system`, `cloud_account`, `cloud_accounts` (#5304) 0775513
- A test fails when a new GET /api/v1 route names no Server-Timing phase (#5265) 20df7ab
- GET …/runs/{id} names its Server-Timing phases: session, run, render (#5333) 13a6da5
- The OpenAPI document describes GET /api/v1/passport/health (#5330) b30bd7c
3 earlier comments
The OpenCode forge command now has plan [approve|redirect <words>|later]. bun test test/plugins.test.ts passes. I couldn't run bun x tsc --noEmit because bun types weren't installed in this clone.
- Command text:
plugins/opencode/forge.tstells the agent to callasksand show the first wave-proposal row, which is the planner's next wave. Forapprove,redirectorlaterit callsasks_proposalwith that row's id and verb.redirectpasses the words aswords. It applies the verb only after the person says yes. Theforgecommand's description now reads "Tell, status, decide or plan". - README:
plugins/opencode/README.mdlistsplanand says how to use it. It also notes that only the owner may act on a proposal. - Test:
test/plugins.test.tsgains a separatedescribe("the OpenCode plan command")block. It checks the command text contains theplanline, namesasks_proposal, and requires a yes first. It also checks that the forge lists theasks_proposaltool. It fails without the change. - Test helper: I added
wordsto the test's list of argument names that are not tools.
I left out the Claude Code plan command, which has its own issue. The OpenCode wording is my own, since that command doesn't have plan yet to copy. I left out any new tool; plan only composes the existing asks and asks_proposal tools.
To try it: set FORGE_URL and FORGE_TOKEN, then run /forge plan in OpenCode.
The plan line in plugins/opencode/forge.ts had bare backticks that ended the COMMAND template early, so the module didn't parse. You were right. I escaped every backtick in that line, as the other lines do.
My earlier text-based test hid this. Its regex stopped at the first unescaped backtick followed by ; and a newline, so it still found a template. I added a test that imports the plugin, runs its config hook, and checks that the registered forge command template:
- contains
plan [approve|redirect <words>|later]; - names
asks_proposal; - ends intact.
The new test fails against the broken line and passes with the fix. bun test test/plugins.test.ts passes (5 tests). I didn't run tsc, since the bun types aren't installed in this clone.
I changed no other behaviour, and the README and scope stay as they were.
The type check failed because of the test I added last round, not because of the plugin. tsconfig.json only covers src, test, scripts and examples. My test imported plugins/opencode/forge.ts directly, which pulled it into the program. That file's type-only import of @opencode-ai/plugin then had no package to resolve.
I changed the test to import the plugin through a computed path. tsc no longer follows it, and the test still loads the real module at runtime. I added no dependency, because the plugin's import is type-only and erased at runtime.
tsc --noEmit is now clean, and bun test test/plugins.test.ts passes (5 tests). I pushed the fix as c6e9973e. I haven't seen the forge's own check on that push yet.
I merged main into the branch and pushed it (d5522ae2). The only conflict was test/plugins.test.ts. After the merge, bun test test/plugins.test.ts passes (6 tests) and tsc --noEmit is clean. I haven't seen the forge's check on this push yet.
NOT_TOOLS: I took main's list. It already includeswordsand covers theid,verb,proposal,approveandlaternames its own plan test needs.- Test blocks: I kept main's Claude Code plan test and my two OpenCode blocks, the plan-text test and the plugin-module import test. The Claude Code test is now a separate top-level
test, so the two edits to this file no longer overlap.
The OpenCode
forgecommand now hasplan [approve|redirect <words>|later].bun test test/plugins.test.tspasses. I couldn't runbun x tsc --noEmitbecausebuntypes weren't installed in this clone.plugins/opencode/forge.tstells the agent to callasksand show the first wave-proposal row, which is the planner's next wave. Forapprove,redirectorlaterit callsasks_proposalwith that row's id and verb.redirectpasses the words aswords. It applies the verb only after the person says yes. Theforgecommand's description now reads "Tell, status, decide or plan".plugins/opencode/README.mdlistsplanand says how to use it. It also notes that only the owner may act on a proposal.test/plugins.test.tsgains a separatedescribe("the OpenCode plan command")block. It checks the command text contains theplanline, namesasks_proposal, and requires a yes first. It also checks that the forge lists theasks_proposaltool. It fails without the change.wordsto the test's list of argument names that are not tools.I left out the Claude Code
plancommand, which has its own issue. The OpenCode wording is my own, since that command doesn't haveplanyet to copy. I left out any new tool;planonly composes the existingasksandasks_proposaltools.To try it: set
FORGE_URLandFORGE_TOKEN, then run/forge planin OpenCode.Closes #5322