feat: change the behavior of SetDefaultModel RPC so None clears the value. (#3529)

It turns out that we want slightly different behavior for the
`SetDefaultModel` RPC because some models do not work with reasoning
(like GPT-4.1), so we should be able to explicitly clear this value.

Verified in `codex-rs/mcp-server/tests/suite/set_default_model.rs`.
This commit is contained in:
Michael Bolin
2025-09-12 11:35:51 -07:00
committed by GitHub
parent 4ae6b9787a
commit abdcb40f4c
4 changed files with 240 additions and 57 deletions

View File

@@ -424,8 +424,11 @@ pub struct GetUserSavedConfigResponse {
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, TS)]
#[serde(rename_all = "camelCase")]
pub struct SetDefaultModelParams {
/// If set to None, this means `model` should be cleared in config.toml.
#[serde(skip_serializing_if = "Option::is_none")]
pub model: Option<String>,
/// If set to None, this means `model_reasoning_effort` should be cleared
/// in config.toml.
#[serde(skip_serializing_if = "Option::is_none")]
pub reasoning_effort: Option<ReasoningEffort>,
}