diff --git a/crates/forge_main/src/built_in_commands.json b/crates/forge_main/src/built_in_commands.json index ac3e697722..beead7cb9f 100644 --- a/crates/forge_main/src/built_in_commands.json +++ b/crates/forge_main/src/built_in_commands.json @@ -20,8 +20,8 @@ "description": "Switch the model for the current session only, without modifying global config [alias: m]" }, { - "command": "model-reset", - "description": "Reset session model to use global config [alias: mr]" + "command": "config-reload", + "description": "Reset all session overrides (model, provider, reasoning effort) to use global config [alias: cr]" }, { "command": "reasoning-effort", diff --git a/shell-plugin/lib/actions/config.zsh b/shell-plugin/lib/actions/config.zsh index 787d4e84b1..4cff73a498 100644 --- a/shell-plugin/lib/actions/config.zsh +++ b/shell-plugin/lib/actions/config.zsh @@ -358,21 +358,23 @@ function _forge_action_session_model() { fi } -# Action handler: Reset session model and provider to defaults. -# Clears both _FORGE_SESSION_MODEL and _FORGE_SESSION_PROVIDER, -# reverting to global config for subsequent forge invocations. -function _forge_action_model_reset() { +# Action handler: Reload config by resetting all session-scoped overrides. +# Clears _FORGE_SESSION_MODEL, _FORGE_SESSION_PROVIDER, and +# _FORGE_SESSION_REASONING_EFFORT so that every subsequent forge invocation +# falls back to the permanent global configuration. +function _forge_action_config_reload() { echo - if [[ -z "$_FORGE_SESSION_MODEL" && -z "$_FORGE_SESSION_PROVIDER" ]]; then - _forge_log info "Session model already cleared (using global config)" + if [[ -z "$_FORGE_SESSION_MODEL" && -z "$_FORGE_SESSION_PROVIDER" && -z "$_FORGE_SESSION_REASONING_EFFORT" ]]; then + _forge_log info "No session overrides active (already using global config)" return 0 fi _FORGE_SESSION_MODEL="" _FORGE_SESSION_PROVIDER="" + _FORGE_SESSION_REASONING_EFFORT="" - _forge_log success "Session model reset to global config" + _forge_log success "Session overrides cleared — using global config" } # Action handler: Select reasoning effort for the current session only. diff --git a/shell-plugin/lib/config.zsh b/shell-plugin/lib/config.zsh index 0a7510b321..bbc05371e2 100644 --- a/shell-plugin/lib/config.zsh +++ b/shell-plugin/lib/config.zsh @@ -34,3 +34,7 @@ typeset -h _FORGE_PREVIOUS_CONVERSATION_ID # invocation for the lifetime of the current shell session. typeset -h _FORGE_SESSION_MODEL typeset -h _FORGE_SESSION_PROVIDER + +# Session-scoped reasoning effort override (set via :reasoning-effort / :re). +# When non-empty, exported as FORGE_REASONING__EFFORT for every forge invocation. +typeset -h _FORGE_SESSION_REASONING_EFFORT diff --git a/shell-plugin/lib/dispatcher.zsh b/shell-plugin/lib/dispatcher.zsh index ac02fe28f3..d0ec5a6e85 100644 --- a/shell-plugin/lib/dispatcher.zsh +++ b/shell-plugin/lib/dispatcher.zsh @@ -175,8 +175,8 @@ function forge-accept-line() { model|m) _forge_action_session_model "$input_text" ;; - model-reset|mr) - _forge_action_model_reset + config-reload|cr|model-reset|mr) + _forge_action_config_reload ;; reasoning-effort|re) _forge_action_reasoning_effort "$input_text"