mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
fix(coding-agent): require --model when --provider is given
--provider without --model was ignored and the default model from another provider ran instead. It now fails with an error. Also fixes the outdated "(default: google)" in the --help text. closes #10236
This commit is contained in:
parent
70c036211d
commit
0c453048bd
4 changed files with 9 additions and 2 deletions
|
|
@ -11,6 +11,7 @@
|
|||
- Fixed MCP OAuth sign-in accepting an authorization response whose `iss` parameter names another authorization server; the code is now rejected before it is exchanged (RFC 9207).
|
||||
- Fixed MCP OAuth sign-in failing with `Invalid scope` when the token response contains `"scope": ""`, and similar failures for other empty or `null` optional OAuth fields ([#10266](https://github.com/earendil-works/pi/issues/10266)).
|
||||
- Fixed the sign-in URL printed by `/mcp login` not being clickable when it wraps ([#10186](https://github.com/earendil-works/pi/issues/10186)).
|
||||
- Fixed `--provider` without `--model` being silently ignored and running the default model from another provider; it now fails with an error ([#10236](https://github.com/earendil-works/pi/issues/10236)).
|
||||
|
||||
## [0.99.2] - 2026-09-30
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ pi --model sonnet:high
|
|||
See [Choose a Model](models.md) for model selection and [Provider Authentication](providers.md) for credentials.
|
||||
|
||||
- `--provider <name>`<br>
|
||||
Restricts `--model` lookup to one provider.
|
||||
Restricts `--model` lookup to one provider. It requires `--model`.
|
||||
- `--model <pattern>`<br>
|
||||
Selects by exact ID or fuzzy ID/name match. It accepts `provider/id` and an optional `:<thinking>` suffix.
|
||||
- `--api-key <key>`<br>
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ ${chalk.bold("Commands:")}
|
|||
${APP_NAME} <command> --help Show help for install/remove/uninstall/update/list/config/auth/mcp
|
||||
|
||||
${chalk.bold("Options:")}
|
||||
--provider <name> Provider name (default: google)
|
||||
--provider <name> Provider to search for --model (requires --model)
|
||||
--model <pattern> Model pattern or ID (supports "provider/id" and optional ":<thinking>")
|
||||
--api-key <key> API key (defaults to env vars)
|
||||
--system-prompt <text> System prompt (default: coding assistant prompt)
|
||||
|
|
|
|||
|
|
@ -466,6 +466,12 @@ function buildSessionOptions(
|
|||
// Model from CLI
|
||||
// - supports --provider <name> --model <pattern>
|
||||
// - supports --model <provider>/<pattern>
|
||||
if (parsed.provider && !parsed.model) {
|
||||
diagnostics.push({
|
||||
type: "error",
|
||||
message: `--provider requires --model (for example: --provider ${parsed.provider} --model <pattern>)`,
|
||||
});
|
||||
}
|
||||
if (parsed.model) {
|
||||
const resolved = resolveCliModel({
|
||||
cliProvider: parsed.provider,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue