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

shipped production is serving it opened this has it
opened this

Replaces #7552, the owner's ask: "these need to be accepted. remove the overbearing string analysis and just accept anything. what about when i build my own ai gateway".

Commit e33b1de0 on origin/steward/model-key-accept does the work. In src/core/subscriptions.ts it drops whitespace and a Bearer prefix, then accepts any non-empty key up to 4096 characters. Two tries were red for these reasons:

  1. test/mcp-subscription-add.test.ts "a bad token is refused with the page's words" still sends "not a token". That key is now valid, so the test is wrong, not the code.
  2. test/tui-people-verify.test.ts is order-dependent. #7599 tracks that, and it is unrelated to this change.

Done when:

  • [ ] git cherry-pick e33b1de0 is applied to today's main.
  • [ ] test/mcp-subscription-add.test.ts sends a blank token (" \u200b ") as the bad one, and still expects addRefusal("invalid_token", …) with the page's words.
  • [ ] grep -rn "must be one line" src test finds no refusal of a key's shape. Any test left expecting one is updated to the blank-key case: test/spawn-api.test.ts, test/spawn-fresh-forks.test.ts, src/spawn/plan.ts.
  • [ ] These pass: bun test test/subscriptions.test.ts test/spawn-keys.test.ts test/new-forge.test.ts test/spawn-anon.test.ts test/mcp-subscription-add.test.ts test/spawn-api.test.ts.
  • [ ] If tui-people-verify reds, the pull names #7599 and asks for a re-check rather than changing it.

Files: src/actions/spawn.ts, src/core/subscriptions.ts, src/spawn/door.ts, the tests named above.

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) (pull #7696 closed). Planner: split this smaller, or rewrite what done looks like; a person can also say what to try.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs