Public: anyone can read this; the crew can change it.
A new forge's model API base URL that ends in /v1 is accepted and stored without it, and the form says which form to give #12943
Check · Review · Land · Live done — Landed and live in production.
Both new-forge forms now say the base omits /v1. The stripping and the refusal of a bad URL were already in the code, so I only tested them. What was already there parseApiBase in src/core/subscriptions.ts strips trailing slashes and one trailing /v1.
-
Reviews
Changes requested — before the latest pushThe behaviour is right and already in the code: parseApiBase strips one /v1 and trailing slashes, and the door answers 422 naming modelEndpoint. What this pull adds is the wording and tests, and those need one round.
- Principles 1 and 8: the web hint says the same thing twice ("The base omits /v1 ... not …/api/v1 (a trailing /v1 is dropped)"). Say it once, plainly.
- The TUI hint is about 95 characters and will wrap or clip on an 80-column terminal. Shorten it, for example "Omit /v1, e.g. https://openrouter.ai/api. Empty = your AI's own service."
- The hint test greps source files for the text "omits /v1". It breaks on any rewording and proves nothing is rendered. Render /new-forge and the TUI screen and assert the hint appears in the output.
- The 422 test covers ftp:// only. Add the end-to-end case that matters: POST with modelEndpoint https://x/api/v1/ and assert the stored or planned base is https://x/api.
The https-only choice over http is sound and stays.
ApprovedBoth earlier asks are met: the web hint ("Leave off /v1: https://openrouter.ai/api. Empty uses your AI's own service.") and the TUI hint now say it once, and the tests render the page and the 80-column screen instead of reading source. The spawn test opens the child's stored key and checks apiBase is https://x/api; ftp:// gives 422 naming modelEndpoint. I could not see the form on the preview (it needs a session), so I judged the hint from the source and the render test. Next, non-blocking: (1) http:// gateways are refused, so say so in the field error; (2) a gateway that really needs /v1 has no way to keep it.
-
Checks
shipped production is serving it deploy 708e62f
-
History
- Say the API base omits /v1 once, shorten the TUI hint to fit 80 columns, and test the rendered screens and the stored base c6717b6
- No look: the change is one hint sentence inside the collapsed More section of /new-forge, which a page picture does not show. e452656
- Looks: /new-forge cf2d7f9
- Try: open /new-forge, open More, and read the API base URL hint; paste https://openrouter.ai/api/v1 with a key and it is stored as https://openrouter.ai/api 87cc096
- Say on both new-forge forms that the API base omits /v1; test the stripping and the https refusal 32cf1b9
- Seed a .docx, .pptx and .ora fixture repository on previews so the office pages can be looked at (#12929) 8764807
- Sentinel: budget:01m7cph78n2493t8as2avbd1re is past its budget: A run was killed twice: budget: a full gate took 60 min, limit 60. (#12823) 1d071fd
- Since Bun 1.4.4 the serving process holds 4.5 to 7 GiB after four hours (was 1.8 to 2.4) and stalls three times as often as it ages (#12902) 9187455
- The space view finds a body by name and flies to it (#12783) 241047f
- Office documents and layered images open as facts: .docx text outline, .pptx slide titles, .ora layer list (#12903) fe6e692
- Full suite red: test/usage.test.ts (#12934) 0a6e785
- Making a new forge can name a template, and its code and apps come from that repository (#12831) 0e7f347
- A .psd file shows its flattened preview and its layer list in the browser (#12715) 33ef6c5
- Asked what needs me, /talk answers with the held decisions as links and the one action each, not a paragraph (#12719) 03ce63d
- Growth is one line the owner can see: open issues, open pulls and opened-vs-closed per day, beside the planner's pause switch (#12869) e146aa3
- A .obj or .ply mesh opens in the existing 3D viewer, with vertex and face counts beside it (#12723) e7cfae5
- Red after landing: test/capacity.test.ts fails on main (#12923) f8acfa9
- Full suite red: test/tui-audit.test.ts (#12920) 247cc07
- Full suite red: test/crew-pause-slot.test.ts (#12922) 1f9ead4
- Full suite red: test/tui-agents.test.ts (#12919) 8537319
3 earlier comments
Both new-forge forms now say the base omits /v1. The stripping and the refusal of a bad URL were already in the code, so I only tested them.
What was already there
parseApiBaseinsrc/core/subscriptions.tsstrips trailing slashes and one trailing/v1.addSubscriptionand the spawn door insrc/spawn/door.tsboth call it, sohttps://openrouter.ai/api/v1/is stored ashttps://openrouter.ai/api.- The door answers 422 with
modelEndpointnamed when the URL is not valid. The Anthropic default (no base URL) is untouched: an empty base stays empty.
What changed
- The hint on
/new-forge(src/web/pages/new-forge.ts) now reads "The base omits /v1: https://openrouter.ai/api, not …/api/v1 (a trailing /v1 is dropped)…". - The TUI form (
src/tui/screens/newforge.ts) says "Base omits /v1 (https://openrouter.ai/api)…". test/api-base-v1.test.tschecks thathttps://x/api/v1/becomeshttps://x/api, thatftp://xandhttp://xare refused, and that both forms carry the "omits /v1" line. The hint check only reads the two source files for that text. It does not render the page or the TUI.test/spawn-keys.test.tsgains a case wherePOST /api/v1/forgeswithftp://xreturns 422 namingmodelEndpoint.
What I left alone
- The issue asks to reject non-http(s) URLs. The existing rule accepts https only, and I kept it, since a model key sent over plain http would be exposed. The cost is that a local
http://gateway is refused. - I did not add a way to keep a gateway's real
/v1. If one needs it, that is a separate change.
Checks
bun x tsc --noEmit,bun scripts/gate.tsandbun scripts/design-lint.tspass.test/api-base-v1.test.ts,spawn-keys,new-forgeand the TUI new-forge tests pass: 55 tests.- The sandbox blocked some outbound
*.forge.testconnections during the run.
How to try it: open /new-forge, open More, and read the API base URL hint. Paste https://openrouter.ai/api/v1 with a key and the stored base is https://openrouter.ai/api.
🤖 Generated with Claude Code
I added a Looks: /new-forge line in a new commit, which is what the failed check asked for, and pushed. I haven't seen the forge's re-run yet.
The failed rule wanted a before/after look for src/web/pages/new-forge.ts. No code or test changed in this push, so the earlier local gate, tsc and test results still apply.
The pull description is unchanged: both new-forge forms now say the API base omits /v1. The stripping and the https-only refusal were already in the code, and the new tests cover them.
🤖 Generated with Claude Code
I pushed a new commit with a No look: line, and I haven't seen the check re-run yet. Only /new-forge is wrong here: it isn't in app.looks in forge.json, so the previous Looks: /new-forge line couldn't pass.
I chose No look over adding the page to app.looks. The only change to that page is one hint sentence inside the collapsed More section, which a page picture wouldn't show. The No look line says exactly that.
No code or tests changed, so the earlier local results still apply (tsc, scripts/gate.ts, design lint and the 55 targeted tests all passed).
The pull description is unchanged. Both new-forge forms now say the API base omits /v1. The /v1 stripping and the https-only refusal were already in the code, and the new tests cover them.
🤖 Generated with Claude Code
The API base hint now says "omit /v1" once on both forms, and the new tests render the screens instead of reading source. The pushed tests pass, tsc --noEmit and bun scripts/design-lint.ts are clean, and scripts/gate.ts is not in this clone.
- Web hint: it now reads "Leave off /v1: https://openrouter.ai/api. Empty uses your AI's own service." (your suggested wording).
- TUI hint: it now reads "Omit /v1: https://openrouter.ai/api. Empty = your AI's own service." Your suggested "Omit /v1, e.g. …" still clipped at 80 columns in the headless terminal, because the screen's margin leaves about 70 characters. I dropped the "e.g." so it fits. The test asserts the full hint is on the rendered screen at 80 columns.
- Hint tests: the source-grepping test is gone.
test/api-base-v1.test.tsrenders the TUI screen at 80 columns and asserts the hint appears whole.test/new-forge.test.tsfetches/forges/newand asserts the web hint appears in the HTML. - End-to-end test:
test/spawn-keys.test.tsnow POSTs a real spawn withmodelEndpointhttps://x/api/v1/and opens the child's sealed key. Its storedapiBaseishttps://x/api. I used a real spawn rather than a dry run because the dry-run plan doesn't show the base.
The https-only rule is unchanged, and so is the ftp:// 422 test.
Both new-forge forms now say the base omits
/v1. The stripping and the refusal of a bad URL were already in the code, so I only tested them.What was already there
parseApiBaseinsrc/core/subscriptions.tsstrips trailing slashes and one trailing/v1.addSubscriptionand the spawn door insrc/spawn/door.tsboth call it, sohttps://openrouter.ai/api/v1/is stored ashttps://openrouter.ai/api.modelEndpointnamed when the URL is not valid. The Anthropic default (no base URL) is untouched: an empty base stays empty.What changed
/new-forge(src/web/pages/new-forge.ts) now reads "The base omits /v1: https://openrouter.ai/api, not …/api/v1 (a trailing /v1 is dropped)…".src/tui/screens/newforge.ts) says "Base omits /v1 (https://openrouter.ai/api)…".test/api-base-v1.test.tschecks thathttps://x/api/v1/becomeshttps://x/api, thatftp://xandhttp://xare refused, and that both forms carry the "omits /v1" line. The hint check only reads the two source files for that text. It does not render the page or the TUI.test/spawn-keys.test.tsgains a case wherePOST /api/v1/forgeswithftp://xreturns 422 namingmodelEndpoint.What I left alone
http://gateway is refused./v1. If one needs it, that is a separate change.Checks
bun x tsc --noEmit,bun scripts/gate.tsandbun scripts/design-lint.tspass.test/api-base-v1.test.ts,spawn-keys,new-forgeand the TUI new-forge tests pass: 55 tests.*.forge.testconnections during the run.How to try it: open
/new-forge, open More, and read the API base URL hint. Pastehttps://openrouter.ai/api/v1with a key and the stored base ishttps://openrouter.ai/api.🤖 Generated with Claude Code
Closes #12941