Add opencode model variant customization - #739
Conversation
|
Thanks for the PR! I'm wondering if you'd be keen to steer the PR towards a more generic mechanism? Instead of adding (defcustom agent-shell-opencode-default-config-options
'(("model" . "anthropic/claude-opus-4-5")
("thought_level" . "high")
("mode" . "plan"))
"Default OpenCode config options, applied at session start.
Keys are config-option categories advertised by the agent; see
the \"Available config options\" section in your shell."
:type '(alist :key-type string :value-type string))I know we haven't done this before in project, but it would enable us to set precedence for moving towards a more scalable mechanism for users to set whatever option is supported by their agent without requiring additional agent-shell changes. To support this path, I've just submitted 95c700a which enables users to know exactly what is and isn't supported by their agents.
|
cab379d to
e2c31cf
Compare
Sounds good to me. I will also mark the old |
c40dcff to
101bbe6
Compare
101bbe6 to
7e4f912
Compare
…pencode-default-config-options
agent-shell--config-option-set-model-id and its mode twin fall back to session/set_model and session/set_mode for agents advertising no config options, so default-config-options routes through them rather than always sending session/set_config_option. Dispatch is on the entry's key, not the resolved option's category: Cline tags both its provider and model options with category "model", so routing on category would hand a provider entry to the model setter, which resolves category "model" back to the model option. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Done. Apologies for the delay. You can now set opencode options like this: Note: I did not remove |

Opencode does not currently support setting a persistent model variant via the opencode config json - or at least it does not work when running via acp. So this PR adds:
default-thought-level-idviaagent-shell-make-agent-configagent-shell-opencode-default-model-variantdefcustomNote: if the variant is not supported by the current model, then the user will see an error when loading the session
Checklist
M-x checkdocandM-x byte-compile-file.