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

A model key is accepted as pasted: land steward/model-key-accept (e33b1de0), and MCP subscription_add refuses only a blank key #7696

Parked opened this
Closed without merging

A pasted model key is now accepted as it is, which was the owner's ask in #7552. This lands commit e33b1de0 from steward/model-key-accept on today's main. In src/core/subscriptions.ts, the new normalizeToken removes all whitespace, zero-width characters and a leading Bearer .

Notes

stopped parked by the crew

opened this

A pasted model key is now accepted as it is, which was the owner's ask in #7552. This lands commit e33b1de0 from steward/model-key-accept on today's main. In src/core/subscriptions.ts, the new normalizeToken removes all whitespace, zero-width characters and a leading Bearer . After that, any non-empty key up to 4096 characters is taken, so a home-built gateway's key format works too. The cleaned key is the one stored, and src/actions/spawn.ts cleans the spawn path's key the same way.

The one test change: test/mcp-subscription-add.test.ts "a bad token is refused with the page's words" used to send "not a token", which is now a valid key. The test was wrong, not the code. It now sends a blank key (" \u200b ") and still expects addRefusal("invalid_token", …) and the claude setup-token hint.

I left the "must be one line" refusals in src/spawn/plan.ts, test/spawn-api.test.ts and test/spawn-fresh-forks.test.ts as they are. They refuse a multi-line description for a fresh app, not a key, so no refusal of a key's shape is left.

The type check passes, and so do 75 tests across subscriptions, spawn-keys, new-forge, spawn-anon, mcp-subscription-add, spawn-api, spawn-fresh-forks and mcp-size. tui-people-verify was not run here. If it goes red on the full check, that is the order-dependence tracked in #7599, which this change doesn't touch; please re-run the check rather than change that test.

To try it: as an admin, add a subscription through MCP subscription_add or the subscriptions page with a key in any format, for example Bearer my-gateway-key with a trailing newline. It should be saved as my-gateway-key. A blank key is refused.

🤖 Generated with Claude Code

Closes #7628

commented

A pasted model key is now accepted as it is, which was the owner's ask in #7552. This lands commit e33b1de0 from steward/model-key-accept on today's main. In src/core/subscriptions.ts, the new normalizeToken removes all whitespace, zero-width characters and a leading Bearer . After that, any non-empty key up to 4096 characters is taken, so a home-built gateway's key format works too. The cleaned key is the one stored, and src/actions/spawn.ts cleans the spawn path's key the same way.

The one test change: test/mcp-subscription-add.test.ts "a bad token is refused with the page's words" used to send "not a token", which is now a valid key. The test was wrong, not the code. It now sends a blank key (" \u200b ") and still expects addRefusal("invalid_token", …) and the claude setup-token hint.

I left the "must be one line" refusals in src/spawn/plan.ts, test/spawn-api.test.ts and test/spawn-fresh-forks.test.ts as they are. They refuse a multi-line description for a fresh app, not a key, so no refusal of a key's shape is left.

The type check passes, and so do 75 tests across subscriptions, spawn-keys, new-forge, spawn-anon, mcp-subscription-add, spawn-api, spawn-fresh-forks and mcp-size. tui-people-verify was not run here. If it goes red on the full check, that is the order-dependence tracked in #7599, which this change doesn't touch; please re-run the check rather than change that test.

To try it: as an admin, add a subscription through MCP subscription_add or the subscriptions page with a key in any format, for example Bearer my-gateway-key with a trailing newline. It should be saved as my-gateway-key. A blank key is refused.

🤖 Generated with Claude Code

commented

Parked by the crew: the check failed ("reviews, threads and the merge gate > require-review refuses the merge until the head is approved") and the decider saw no point in another try try 1: src/actions/spawn.ts, src/core/subscriptions.ts, src/spawn/door.ts, test/mcp-subscription-add.test.ts (+3 more)

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs