set-key takes the ref it was given, and a key inline
`claude-mode set-key openrouter sk-or-...` did the wrong thing on the POSIX port: the dispatcher loop kept the *last* positional, so the key became the ref name and the prompt asked for "the key for ref 'sk-or-...'". Storing to that ref succeeds, so nothing looks wrong until the switch later reports no key for 'openrouter' - which is exactly what happened on macOS. Both ports now take `set-key [ref] [key]`: the first positional is the ref unless it is key-shaped (sk-* or longer than a ref name would plausibly be), in which case it is the key for the default ref, and a second positional is always the key. An inline key warns that it is now in the shell history, since the hidden prompt leaves no trace. Extra arguments are refused instead of ignored. The Windows dispatch already read the first positional correctly, so it only gains the inline form. The shipped default preset moves to the models asked for: DeepSeek 4.1 Flash on opus, GLM Flash on sonnet. Existing installs keep their own presets - the installer never overwrites one without --force - so an upgrade needs `claude-mode preset set default opus ...` and the same for sonnet, or a --force install. Verified in the bash 3.2 container: ref+key stores under the ref, a bare key stores under openrouter, an empty prompt aborts, a custom ref still works, the stored value is byte-identical, and four positionals are refused. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
{
|
||||
"provider": "openrouter",
|
||||
"description": "Daily driver. Flash-class models on the hot tiers, GLM on fable.",
|
||||
"description": "Daily driver. DeepSeek 4.1 Flash on opus, GLM Flash on sonnet, GLM on fable.",
|
||||
"baseUrl": "https://openrouter.ai/api",
|
||||
"auth": {
|
||||
"mode": "vault",
|
||||
"keyRef": "openrouter"
|
||||
},
|
||||
"models": {
|
||||
"opus": "z-ai/glm-5.3-flash",
|
||||
"sonnet": "deepseek/deepseek-v4-flash-0731",
|
||||
"opus": "deepseek/deepseek-v4.1-flash",
|
||||
"sonnet": "z-ai/glm-5.3-flash",
|
||||
"haiku": "openrouter/free",
|
||||
"fable": "z-ai/glm-5.3"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user