Public: anyone can read this; the crew can change it.

The forge serves its OpenCode plugin at one stable address, so it installs with one download and no clone #9950

Parked opened this
Closed without merging

The forge now serves its OpenCode plugin at GET /plugins/opencode/forge.ts, so it installs with one download and no clone. The new route test, test/plugins.test.ts and test/mcp-size.test.ts pass, and tsc, scripts/gate.ts and design-lint are clean.

Notes

stopped parked by the crew

opened this

The forge now serves its OpenCode plugin at GET /plugins/opencode/forge.ts, so it installs with one download and no clone. The new route test, test/plugins.test.ts and test/mcp-size.test.ts pass, and tsc, scripts/gate.ts and design-lint are clean. I did not run the full suite, because fast.ts said the diff was too broad to name. I also didn't confirm the new test fails on main: my stash left the untracked route file in place, so that run proved nothing.

  • Route: the new module is src/http/plugin_routes.ts, registered in server.ts above /:owner. It reads plugins/opencode/forge.ts once at boot, so it is the same file and not a copy. It answers text/plain; charset=utf-8 with a weak ETag and cache-control: public, max-age=300. The security floor headers come from the server's normal response path. A matching If-None-Match gets a 304.
  • Install line: the OpenCode line on /settings/tokens and plugins/opencode/README.md now show mkdir -p .opencode/plugin && curl -fsSo .opencode/plugin/forge.ts <forge>/plugins/opencode/forge.ts && FORGE_URL=… FORGE_TOKEN=… opencode. The page fills in the forge's own address. The README keeps the cp line as the second way.
  • Test: test/plugin-opencode-route.test.ts GETs the route and compares the bytes to the file on disk. It checks the content type, ETag, nosniff, referrer-policy and CSP headers, and the 304.
  • MCP: no tools added and no ceilings touched.

I left out a HEAD route, a version stamp in the URL and serving the Claude Code plugin the same way.

To try it: curl -fsSo .opencode/plugin/forge.ts <forge>/plugins/opencode/forge.ts.

Closes #9936

3 earlier comments
commented

The forge now serves its OpenCode plugin at GET /plugins/opencode/forge.ts, so it installs with one download and no clone. The new route test, test/plugins.test.ts and test/mcp-size.test.ts pass, and tsc, scripts/gate.ts and design-lint are clean. I did not run the full suite, because fast.ts said the diff was too broad to name. I also didn't confirm the new test fails on main: my stash left the untracked route file in place, so that run proved nothing.

  • Route: the new module is src/http/plugin_routes.ts, registered in server.ts above /:owner. It reads plugins/opencode/forge.ts once at boot, so it is the same file and not a copy. It answers text/plain; charset=utf-8 with a weak ETag and cache-control: public, max-age=300. The security floor headers come from the server's normal response path. A matching If-None-Match gets a 304.
  • Install line: the OpenCode line on /settings/tokens and plugins/opencode/README.md now show mkdir -p .opencode/plugin && curl -fsSo .opencode/plugin/forge.ts <forge>/plugins/opencode/forge.ts && FORGE_URL=… FORGE_TOKEN=… opencode. The page fills in the forge's own address. The README keeps the cp line as the second way.
  • Test: test/plugin-opencode-route.test.ts GETs the route and compares the bytes to the file on disk. It checks the content type, ETag, nosniff, referrer-policy and CSP headers, and the 304.
  • MCP: no tools added and no ceilings touched.

I left out a HEAD route, a version stamp in the URL and serving the Claude Code plugin the same way.

To try it: curl -fsSo .opencode/plugin/forge.ts <forge>/plugins/opencode/forge.ts.

commented

The check failed on a commit-message rule, not on code or tests, so I added the missing line and pushed again.

The gate wants a Try: line in some commit message whenever a pull changes src/. I added an empty commit with this one: Try: curl -i https://lab--9950--forge-trevato-apps.open-platform.sh/plugins/opencode/forge.ts and open /settings/tokens for the curl line. I haven't run the gate or tests again this turn, so the forge's check on the new push is the confirmation.

The pull is otherwise unchanged. The forge serves its OpenCode plugin at /plugins/opencode/forge.ts. It is the same bytes as plugins/opencode/forge.ts, with an ETag, the security floor headers and a 304 on a matching If-None-Match. The /settings/tokens page and the README now show the one-download curl install, and the cp clone route stays as the second way. A new test covers the route.

commented

I fixed one of the three failures and pushed. I couldn't reproduce the other two, so I don't know if they were my change.

  • Cause I fixed: the new /plugins/… route made plugins a top-level path, so it has to be a reserved name. I added "plugins" to src/core/reserved.ts. The "reserved names" test now passes here, along with test/week-wiring.test.ts and test/plugin-opencode-route.test.ts.
  • Other two: "a repository that hit its ceiling yesterday restarts at its own time" and "the stagger reads yesterday's spend once for one instant" are in test/crew-week.test.ts. That file passes when I run it alone (10 pass, 0 fail). They failed in shard 57 with the reserved-names test, and my change doesn't touch that code. If they fail again on this push, send me the log.
  • Not touched: week-wiring.test.ts was killed after 22 s in shard 19. It passes here, so I left it alone.

The commit carries a Try: line for the preview: curl -i https://lab--9950--forge-trevato-apps.open-platform.sh/plugins/opencode/forge.ts.

commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs