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 #9963

Parked opened this
Closed without merging

The forge now serves its OpenCode plugin at GET /plugins/opencode/forge.ts, and I fixed the cause of the earlier red check: the Docker image didn't contain the plugin file. It's pushed, but the forge's full check hasn't run on it yet.

Notes

stopped parked by the crew deploy fe53573

opened this

The forge now serves its OpenCode plugin at GET /plugins/opencode/forge.ts, and I fixed the cause of the earlier red check: the Docker image didn't contain the plugin file. It's pushed, but the forge's full check hasn't run on it yet. Locally the gate, tsc, the new route test, the release-boot and Dockerfile-pin tests, and a wider batch of related tests (262) pass.

  • Route: src/http/plugin_routes.ts reads plugins/opencode/forge.ts once at boot and answers it as text/plain; charset=utf-8 with an ETag and the security headers. A matching If-None-Match gets a 304. The route is wired in src/http/server.ts.
  • Reserved name: plugins is added to the reserved names in src/core/reserved.ts, so no user or app can take it as a top-level path.
  • Install line: the OpenCode line on /settings/tokens (src/web/pages/account.ts) now fills in the forge's own address: mkdir -p .opencode/plugin && curl -fsSo .opencode/plugin/forge.ts <forge>/plugins/opencode/forge.ts && … opencode. plugins/opencode/README.md leads with the same download and keeps the clone route as the second way.
  • Test: test/plugin-opencode-route.test.ts checks that the bytes equal the file and the headers are present. It also checks that a 304 answers a matching If-None-Match.

Why the check was red: the image copies only src/ and two docs files, so the boot-time read of the plugin file failed and the forge crashed on start. The release-boot test, which boots the tree the way the image ships it, caught it. I added COPY plugins/opencode/forge.ts to the Dockerfile, and the release-boot test copies that file in as well. That is the one test I changed, because the test has to mirror the image.

The branch had also fallen behind main, so I merged origin/main into it.

Left out: the top-level README.md doesn't show the curl line. I only updated plugins/opencode/README.md and the tokens page.

To try it: curl -i <preview>/plugins/opencode/forge.ts. Then repeat the request with the returned ETag as If-None-Match, which should give a 304.

🤖 Generated with Claude Code

Closes #9936

3 earlier comments
commented

The forge now serves its OpenCode plugin at GET /plugins/opencode/forge.ts, and I fixed the cause of the earlier red check: the Docker image didn't contain the plugin file. It's pushed, but the forge's full check hasn't run on it yet. Locally the gate, tsc, the new route test, the release-boot and Dockerfile-pin tests, and a wider batch of related tests (262) pass.

  • Route: src/http/plugin_routes.ts reads plugins/opencode/forge.ts once at boot and answers it as text/plain; charset=utf-8 with an ETag and the security headers. A matching If-None-Match gets a 304. The route is wired in src/http/server.ts.
  • Reserved name: plugins is added to the reserved names in src/core/reserved.ts, so no user or app can take it as a top-level path.
  • Install line: the OpenCode line on /settings/tokens (src/web/pages/account.ts) now fills in the forge's own address: mkdir -p .opencode/plugin && curl -fsSo .opencode/plugin/forge.ts <forge>/plugins/opencode/forge.ts && … opencode. plugins/opencode/README.md leads with the same download and keeps the clone route as the second way.
  • Test: test/plugin-opencode-route.test.ts checks that the bytes equal the file and the headers are present. It also checks that a 304 answers a matching If-None-Match.

Why the check was red: the image copies only src/ and two docs files, so the boot-time read of the plugin file failed and the forge crashed on start. The release-boot test, which boots the tree the way the image ships it, caught it. I added COPY plugins/opencode/forge.ts to the Dockerfile, and the release-boot test copies that file in as well. That is the one test I changed, because the test has to mirror the image.

The branch had also fallen behind main, so I merged origin/main into it.

Left out: the top-level README.md doesn't show the curl line. I only updated plugins/opencode/README.md and the tokens page.

To try it: curl -i <preview>/plugins/opencode/forge.ts. Then repeat the request with the returned ETag as If-None-Match, which should give a 304.

🤖 Generated with Claude Code

commented

I didn't fix anything for this failure; I pushed an empty commit to get the check re-run. The one failing test, "a fresh account's second preview is refused…" in test/quotas-running.test.ts, passed in all three local runs (7 of 7 each time). I think it's a timing flake, not something this pull broke.

The test starts real app processes and waits for them to come up. In the forge's run it timed out at about 120 s, and the pull got the failure only because it changed server.ts, which that test imports. Nothing on this branch touches previews or quotas. The plugin route is a single GET handler, and the other 14,827 tests passed.

The branch still has the real fix from before: the Dockerfile copies the plugin file into the image, and the release-boot test now copies it in too. If the same test fails again on the new run, the cause is the load on the shard, not this branch. A person would need to look at that test's wait budget.

🤖 Generated with Claude Code

commented

The failing test looks like a load flake. I did not change its code, and I could not reproduce the failure.

  • Failure: a linked sub signs in and is not throttled… in test/forge-signin-signup.test.ts failed once in shard 22 (39 ms) during the full check. Run alone, it passed 4 times. Three were after the merge below and one was before it.
  • Cause: I did not find one. The pull touches nothing the test imports, so I made no code change for it.
  • What I did: I merged origin/main into the branch and pushed (fe53573f). That brings in main's newer tests and may clear the failure, but that is a guess. If the check fails on this test again, the cause is in the sign-up throttle or window timing.
  • Checks: tsc --noEmit is clean. The OpenCode plugin route test and release-boot test pass (12 tests). I did not run scripts/gate.ts this turn.

Pull description: The forge serves its OpenCode plugin at /plugins/opencode/forge.ts.

  • Route: the route is in src/http/plugin_routes.ts and is wired in src/http/server.ts.
  • Reserved name: plugins is a reserved top-level name in src/core/reserved.ts.
  • Image: the Dockerfile ships the plugin file, so the route's boot read finds it.
  • Docs: plugins/opencode/README.md says how to use it.
  • Tests: test/plugin-opencode-route.test.ts and test/release-boot.test.ts cover the route and the boot read.
  • Not done: no auth or versioning on the route, and no plugin changes beyond serving the file.
  • Try it: curl $FORGE_URL/plugins/opencode/forge.ts.

🤖 Generated with Claude Code

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