cli providers take a model: provider prefix, {model}, -m occli/MODEL

A kind = cli provider now has a default model and a prefix
(provider = opencode), so -m occli/deepseek-v4.1-flash-free runs
"opencode run --model opencode/deepseek-v4.1-flash-free". {model} in cmd
marks where the model goes, otherwise --model is appended; a model that
already has a '/' is used as it is. sp_cli_command() builds the command for
-m, delegates and the cli plugin's pool fallback. Model names are limited to
letters, digits and ._:/@+- since the command goes through /bin/sh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
lotherkandClaude Opus 5.5 committed 2026-11-13 20:08:16 +00:00
1 parent 05c8d936e7
commit 2c58dcfd2a
8 files changed
+125 -12

No files matched your search

+4 -2
View File
@@ -647,8 +647,10 @@ cli_send(void *ctx, const struct sp_conv *conv, struct sp_reply *out,
"cli_fallback names no cli delegate");
continue;
}
snprintf(alt.cmd, sizeof(alt.cmd), "%s",
d->cmd[0] != '\0' ? d->cmd : "claude -p");
if (sp_cli_command(d, NULL, alt.cmd,
sizeof(alt.cmd)) != 0)
snprintf(alt.cmd, sizeof(alt.cmd), "%s",
d->cmd[0] != '\0' ? d->cmd : "claude -p");
alt.env = (const char (*)[SP_CONFIG_ENV_LEN])d->env;
alt.nenv = d->nenv;
}