Repository navigation
Conversation
The astro:build:done hook in astro.config.mjs generates dist/config.json and copies dist/tui.json from packages/console/app/public. The same hook also needs to copy packages/web/public/theme.json so that https://opencode.ai/theme.json serves the JSON Schema referenced by themes.mdx and the theme examples. Without this line the URL referenced by every theme example as "$schema": "https://opencode.ai/theme.json" returns 404.
|
The following comment was made by an LLM, it may be inaccurate: |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
There was a problem hiding this comment.
I couldn't verify this fixes the reported URL, and from the infra it looks like it can't. opencode.ai is served by the console app (infra/console.ts, packages/console/app). This hook is in the docs build (packages/web), which is deployed to docs.opencode.ai (infra/app.ts). On the live site the copied schemas are already served from both hosts: opencode.ai/tui.json, opencode.ai/config.json, docs.opencode.ai/tui.json and docs.opencode.ai/config.json all return 200. With this change, docs.opencode.ai/theme.json should start returning 200, but opencode.ai/theme.json probably won't.
The console app already ships its own packages/console/app/public/theme.json, and other console-only public files are served on opencode.ai, so the 404 there probably comes from routing or deployment, not from this hook. Also, opencode.ai/theme.json returns a plain-text Not found, unlike the HTML 404 for other missing paths. That points to something specific handling that path. The two theme.json copies have also drifted apart: the web one has selectedListItemText and the console one doesn't. Whatever ends up serving opencode.ai/theme.json should use one source.
Could you confirm (or ask a maintainer) which worker serves opencode.ai/theme.json, and either fix it there or explain how this line reaches it?
No public API change: no SDK, server, plugin, config-key or CLI change; it only affects which static files the docs build outputs.
| execFileSync("bun", ["../schema/script/config-schema.ts", "./dist/config.json"], { stdio: "inherit" }) | ||
| // The V1 TUI schema is frozen in the console app since packages/opencode lives on the v1 branch. | ||
| copyFileSync("../console/app/public/tui.json", "./dist/tui.json") | ||
| copyFileSync("./public/theme.json", "./dist/theme.json") |
There was a problem hiding this comment.
This output goes to the docs worker (docs.opencode.ai, per infra/app.ts). The URL in #56050, opencode.ai/theme.json, is served by the console app (infra/console.ts), which already has packages/console/app/public/theme.json and still returns 404 there. This line may make docs.opencode.ai/theme.json work, but I don't see how it fixes opencode.ai/theme.json. Also, this copy and the console copy have drifted apart (only this one has selectedListItemText).
|
Closing this — the @opencode-agent review is right. I had narrowed the problem to "missing copy step in docs build", but the actual deployment of Verifying against live URLs before and after this fix (note: I cannot test "after" until merge + deploy): So both The one-line fix in this PR is still correct for the docs side, but the reported bug is broader. I'll move the work into issue #56050 — diagnosing the console-side 404 and consolidating the two Thanks to the bot for catching what I missed. |
Issue for this PR
Closes #56050
Type of change
What does this PR do?
The
astro:build:donehook inpackages/web/astro.config.mjscopiesdist/config.json(generated) anddist/tui.json(from packages/console/app/public). It does not copydist/theme.jsonfrom packages/web/public, sohttps://opencode.ai/theme.jsonreturns 404 even though the file exists.This PR adds one line to the hook that copies
packages/web/public/theme.jsontodist/theme.json, the same pattern already used for tui.json. After the next deploy, the URL will serve a valid JSON Schema and any user-written theme that references$schema: "https://opencode.ai/theme.json"will get IDE auto-completion and validation as intended.How did you verify your code works?
curl -sI https://opencode.ai/theme.jsonbefore:HTTP/2 404. Same for/config.jsonand/tui.jsonare 200.packages/web/astro.config.mjsand confirmed the hook matches the existing pattern.bun run checkfrom repo root: 35 tasks pass, 0 fail.node --check packages/web/astro.config.mjs: valid JS syntax.curl -I https://opencode.ai/theme.json.Screenshots / recordings
Not applicable — no UI change.
Checklist