Visitar URL original
feat(cli): change thinking effort mid-session with /model --effort by gaurav0107 · Pull Request #13248 · aaif-goose/goose · GitHub
Skip to content

feat(cli): change thinking effort mid-session with /model --effort - #13248

Open
gaurav0107 wants to merge 9 commits into
aaif-goose:mainfrom
gaurav0107:fix/13145-cli-change-thinking-effort-mid-session-v
Open

gaurav0107 wants to merge 9 commits into
aaif-goose:mainfrom
gaurav0107:fix/13145-cli-change-thinking-effort-mid-session-v

Conversation

@gaurav0107

@gaurav0107 gaurav0107 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Fixes: #13145

Summary

The interactive CLI could switch model and provider mid-session but not thinking effort; that needed GOOSE_THINKING_EFFORT plus a restart. This adds --effort <level> to /model:

  • /model --effort low keeps the current model and calls the existing StateMachineServices::update_thinking_effort, the same path ACP's session/set_thinking_effort uses. The CLI doesn't short-circuit when the value looks unchanged, so the provider decides whether an update is redundant. The value is persisted on the session's model config, so it survives resume and takes precedence over GOOSE_THINKING_EFFORT. A later /model --effort overrides it.
  • /model --effort max claude-sonnet-4 (also with --provider) applies the effort to the switched model config before switch_provider. The existing "already using" check already compares effective efforts, so a same-model, different-effort request goes through.
  • /model arguments are now parsed as flags in any order (--provider <name>, --effort <level>), and the remaining tokens are the model. Existing --provider inputs parse as before, and a multi-word model still hits the "Unexpected arguments" error.
  • Providers that manage their own context and expose no effort option (for example claude-code, which only reads the model name) reject /model --effort with an error, so the command never reports a setting the provider ignores.
  • When the target model isn't known to be a reasoning model, /model --effort still applies the level but prints a warning that it may have no effect. Providers don't agree on whether effort depends on reasoning support, so rejecting would block models that do honor it.
  • For ACP agents that advertise their own effort values (for example minimal), the value is passed through unchanged and the harness validates it. The five built-in levels are parsed only on the legacy path.
  • A missing or unknown level renders Invalid thinking effort 'x'. Valid values: off, low, medium, high, max. and leaves the session unchanged.
  • Bare /model now also reports the thinking effort the provider will apply, for example (provider 'openai', thinking effort 'low'). For ACP agents this is the harness's current option. Nothing is shown when the agent has no effort selector or the provider manages its own context.
  • Tab completion understands flags in any order. It offers --provider/--effort after --, providers after --provider, the effort values the session provider accepts after --effort (harness options for ACP agents, otherwise the five levels), and models only until one has been typed. /help and the CLI commands guide list the flag.

Per the comment on the issue, the type-ahead queue part is left out because it isn't on main. There are no changes to the goose crate or the ACP path.

One behavior is unchanged on purpose: a plain /model <name> still rebuilds the model config from user config, so it drops an effort set earlier in the session. test_build_switched_model_config_detects_effort_suffix_change asserts this for the -high suffix case, and I didn't want to change it here. Use /model --effort <level> <name> to switch model and keep a specific effort.

Testing

  • model_effort_flag_persists_session_thinking_effort: drives handle_model with --effort low on a CliSession and asserts the persisted session model config reports ThinkingEffort::Low with the model unchanged.
  • model_effort_flag_is_rejected_for_providers_that_ignore_it: a context-managing stub provider with no effort support. The persisted config gets no thinking_effort, and the test fails without the check.
  • active_thinking_effort_follows_provider_support: legacy provider shows the session effort, a self-managed provider and an Unsupported ACP agent show none, and an Options agent shows its current.
  • model_effort_flag_forwards_harness_values_unparsed: an ACP-style provider with effort options receives minimal as-is.
  • thinking_effort_values_follow_provider_support: completion values per support variant.
  • test_parse_thinking_effort: aliases (MAX, none), empty value, and an unknown value with the valid-levels message.
  • test_handle_slash_command: --effort alone, before and after the model, combined with --provider, and with no value. The existing --provider cases are unchanged.
  • test_complete_model_names_effort: flag completion, level completion, and model completion after --effort <level>.
  • cargo test -p goose-cli: 366 passed. cargo fmt --check and cargo clippy -p goose-cli --all-targets -- -D warnings are clean.
  • goose-self-test.yaml: added a "CLI Effort Command Test" section to the thinking-effort phase. I ran its step 1 (cargo test -p goose-cli effort). Its interactive steps and a live run against a reasoning model haven't been done.

Related Issues

Uses the session-effort plumbing behind ACP session/set_thinking_effort.


🤖 Opened with Superhuman, an open-source contribution agent.

`/model --effort <level>` changes the thinking effort of the running
session through StateMachineServices::update_thinking_effort, so the value
is persisted on the session's model config and takes precedence over
GOOSE_THINKING_EFFORT. `/model --effort <level> <model>` (and with
`--provider`) applies the effort to the switched model config.

Flags may appear in any order. Invalid or missing values are rejected
with the list of valid levels, and tab completion offers `--effort` and
the effort levels.

Fixes aaif-goose#13145
@gaurav0107
gaurav0107 marked this pull request as ready for review October 30, 2026 18:14
@gaurav0107
gaurav0107 requested a review from a team as a code owner October 30, 2026 18:14
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T19:46:00.244343Z 87d6acc New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ef2d87a520

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

/mode <name> - Set the goose mode to use ({modes})
/model [name] - Show the current model, or switch models for this session while keeping the same provider
/model --provider <name> [model] - Switch to a different provider (optionally specifying a model)
/model --effort <level> [model] - Set the thinking effort for this session (off, low, medium, high, max)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add the new effort command to the self-test recipe

This feature adds a new interactive command but leaves goose-self-test.yaml unchanged, so the required end-to-end feature verification never exercises the new session mutation path; add a self-test case or phase for /model --effort and run the recipe before merging.

AGENTS.md reference: AGENTS.md:L102-L102

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a CLI effort section to the thinking-effort phase of goose-self-test.yaml in 076f0d0, and bare /model now shows the effective effort so the steps can be checked. I ran step 1 (cargo test -p goose-cli effort: 4 tests pass). Steps 2-4 need an interactive session on a live reasoning model, and I have not run those.

Comment thread crates/goose-cli/src/session/mod.rs Outdated
let current_effort = current_model_config
.thinking_effort()
.or(Config::global().get_goose_thinking_effort());
if current_effort == Some(effort) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Delegate no-op detection to the effort-aware provider

When an ACP-backed CLI session's agent resets its effort (for example after rebuilding its selector during an internal model change), the session's persisted ModelConfig can still equal effort while the provider's mirrored current value does not; AcpProvider::set_effort_option intentionally uses that mirrored value for this reason. This early return bypasses update_thinking_effort, falsely reports the old level as active, and makes /model --effort ... unable to reapply it, so let the service/provider decide whether the update is redundant.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. In 076f0d0 I removed the CLI-side no-op check, so every /model --effort goes through update_thinking_effort and the provider decides whether the value is redundant.

Drop the CLI-side "already using" check for `/model --effort`, so a
value is always forwarded through update_thinking_effort. An ACP agent's
mirrored effort can drift from the persisted model config, and the early
return would have hidden that.

Bare `/model` now reports the effective thinking effort, and the
self-test recipe covers the CLI command.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 076f0d097e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread crates/goose-cli/src/session/mod.rs Outdated
Comment on lines +944 to +947
if let Some(effort) = effort {
return self
.set_session_thinking_effort(effort, &current_model_name)
.await;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject effort updates unsupported by managed providers

When the current provider is claude-code, /model --effort low enters this branch before the later manages_own_context rejection. ClaudeCodeProvider inherits the default set_thinking_effort (Ok(false)) and its stream only consumes model_config.model_name (crates/goose/src/providers/claude_code.rs:749-766), so update_thinking_effort merely persists a request parameter and this helper prints success while the Claude harness behavior is unchanged. Gate this branch on provider effort support (or implement forwarding) rather than claiming the setting was applied.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. In 91c5446 /model --effort is now rejected when the provider manages its own context and reports ThinkingEffortSupport::Unspecified, so claude-code no longer gets a success message for a setting it ignores. ACP providers that advertise an effort option still go through update_thinking_effort. I added model_effort_flag_is_rejected_for_providers_that_ignore_it, which fails without the check.

Providers that manage their own context without a harness effort option
(for example claude-code) only see the model name, so persisting a
thinking_effort request parameter would report success with no effect.
Reject the command for them. ACP providers that advertise effort still go
through update_thinking_effort.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 91c5446c52

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread crates/goose-cli/src/session/mod.rs Outdated
Comment on lines +958 to +961
let effort_info = current_model_config
.thinking_effort()
.or(Config::global().get_goose_thinking_effort())
.map(|effort| format!(", thinking effort '{effort}'"))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Hide effort status for providers that ignore it

When a claude-code session starts with GOOSE_THINKING_EFFORT=high, model-config materialization records high, but ClaudeCodeProvider only forwards model_name from that config when spawning the harness (crates/goose/src/providers/claude_code.rs:385-400). These lines therefore make bare /model report thinking effort 'high' as active even though the setter immediately above correctly rejects effort updates for this provider; derive or suppress the suffix based on the provider's effort support rather than treating the stored/global value as effective.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. In 425b1cc bare /model uses the same support check as --effort, so it shows no effort suffix for providers that manage their own context and have no effort option.

Bare `/model` reported the stored or GOOSE_THINKING_EFFORT value even for
providers that manage their own context without an effort option, where
that value has no effect. Use the same support check as `--effort` to
decide whether to show it.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 425b1cc030

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

&current_model_config,
)?;
if let Some(effort) = effort {
new_model_config = new_model_config.with_thinking_effort(effort);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject efforts the target model cannot apply

When [model] selects a non-reasoning model, for example /model --effort high gpt-4o, this unconditionally persists the level and the success message reports it as applied. The OpenAI request builder deliberately produces no reasoning effort when openai_reasoning_for_model is false (crates/goose-provider-types/src/formats/openai.rs:1755-1770), and the configure flow only offers effort when model metadata says reasoning is supported (crates/goose-cli/src/commands/configure.rs:984-1002), so subsequent requests ignore high while bare /model continues to report it; validate the target model's supported effort choices before switching and apply the same validation to the no-model path.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a435bbc I went with a warning rather than a rejection. Providers disagree on whether effort depends on reasoning support: openrouter, databricks_v2, ollama and the OpenAI chat format check is_reasoning_model(), while the anthropic, google and openai providers read thinking_effort() directly. Rejecting on is_reasoning_model() would therefore block models that do honor effort. /model --effort now prints a yellow warning when the target model is not known to be a reasoning model, the same way handle_model already warns about a smaller context window. If maintainers would rather reject, that is a one-line change.

Providers disagree on whether they gate effort on reasoning support, so
rejecting would block models that do honor it. Warn instead when the
target model is not known to be a reasoning model, in the same way
handle_model already warns about a smaller context window.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a435bbcea9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread crates/goose-cli/src/session/mod.rs Outdated
Comment on lines +944 to +945
let effort_supported = !(provider.manages_own_context()
&& provider.thinking_effort_support() == ThinkingEffortSupport::Unspecified);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Treat unsupported effort capabilities as unavailable

For an ACP-backed CLI session whose agent advertises no thought-level selector, AcpProvider::thinking_effort_support returns Unsupported and its setter rejects every non-off value, but this predicate only excludes Unspecified providers. With a saved or global high, bare /model therefore reports thinking effort 'high' as effective even though the harness cannot apply it, and /model --effort high is rejected; derive status from the support variant (including Options.current) and suppress or force off for Unsupported. The still-unhandled ACP support variants are fresh evidence beyond the earlier claude-code status case.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in f3f6e7b. Bare /model now derives the shown effort from thinking_effort_support(): Options shows the harness's current, Unsupported and self-managed Unspecified show nothing, and only plain Unspecified falls back to the session or global value. /model --effort for an Unsupported ACP agent still goes to the provider, which rejects non-off values with its own error. active_thinking_effort_follows_provider_support covers the four cases.

Bare `/model` now derives the shown thinking effort from the provider's
effort support: the harness's current option for ACP agents that
advertise one, nothing for agents with no effort selector or for
providers that manage their own context, and the session or global
value otherwise.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f3f6e7b940

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

model_config: &goose_providers::model::ModelConfig,
effort: ThinkingEffort,
) {
if effort != ThinkingEffort::Off && !model_config.is_reasoning_model() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Warn when the chosen level is remapped

On a reasoning model with a restricted effort set—for example OpenAI gpt-5-pro, whose catalog entry lists only high (crates/goose-provider-types/src/canonical/data/canonical_models.json:201959-201965)—/model --effort low skips this warning because is_reasoning_model() is true. openai_reasoning_effort_for_thinking then falls back to high (crates/goose-provider-types/src/formats/openai.rs:1934-1957), while the command's success text and bare /model report the persisted low, which can silently increase reasoning cost and latency. Check the model's supported levels or report the mapped value; this restricted-level reasoning-model mapping is fresh evidence beyond the earlier non-reasoning-model case.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am leaving this one out of this PR. The issue lists "no new provider-side effort mapping" as a non-goal, and the clamp to a model's supported levels happens in the provider format layer. Setting GOOSE_THINKING_EFFORT=low or using ACP session/set_thinking_effort on gpt-5-pro gets the same remap and reports the requested level the same way, so /model --effort matches the existing paths. Surfacing the mapped level would mean exposing the per-model clamp from the provider layer for all three entry points, and I think that belongs in a separate change. Happy to open an issue for it if maintainers want one.

Comment on lines +205 to +209
parts[1]
} else {
""
};
return self.models_completion_from_cache(&self.current_provider(), partial, line);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Complete flags that follow the effort value

When the user enters a valid second flag such as /model --effort low --p<Tab>, this branch takes --p as the model partial and searches the current provider's model cache, so it never offers --provider (and after a full provider flag it cannot complete that provider's models). parse_model_command now accepts flags in any order and the CLI guide says slash commands support completion, so tokenize the already-consumed flags before choosing flag, provider, or model candidates.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 58ec541. Completion now walks the tokens already typed, so /model --effort low --p offers --provider, a provider given after --effort scopes model completion, and --effort after --provider completes levels. I added cases for each to test_complete_model_names_effort.

`/model` parsing accepts `--provider` and `--effort` in any order, so
completion now walks the consumed tokens too. It completes a provider
or effort value after its flag, flags after `--`, and otherwise models
for the chosen or current provider.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 58ec541d98

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread crates/goose-cli/src/session/mod.rs Outdated
let effort = match options
.effort
.as_deref()
.map(parse_thinking_effort)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Accept provider-advertised ACP effort values

In an ACP-backed interactive session whose thought selector advertises minimal (the bootstrap fixture does exactly this in crates/goose/tests/acp_bootstrap_effort_test.rs:76-128), this eagerly converts the argument to the five-value enum and rejects it before StateMachineServices::update_thinking_effort can forward it. ACP ThinkingEffortSupport::Options deliberately carries arbitrary raw values and AcpProvider::set_thinking_effort accepts exact offered values, so bare /model can report minimal as current while /model --effort minimal cannot select it; retain and validate the raw value for provider-managed options, and parse the enum only on the legacy path.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in f607bc9. When the provider reports ThinkingEffortSupport::Options, /model --effort forwards the raw value to update_thinking_effort and lets the harness validate it. The five built-in levels are parsed only on the legacy path. model_effort_flag_forwards_harness_values_unparsed checks that minimal reaches the session.

Some("--provider") => provider = Some(token.to_string()),
Some(_) => {}
None if token == "--provider" || token == "--effort" => pending_flag = Some(token),
None => {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Stop suggesting a second model argument

In interactive completion, once a model token is followed by a space (for example /model claude-sonnet-4 ), this arm discards the already-consumed model; with an empty partial and no pending flag, the function then offers every model again. Selecting one makes parse_model_command produce a two-word model and handle_model rejects the command as Unexpected arguments after model name, so track whether a model was already consumed and stop returning model candidates in that state while still allowing later flag completion.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in f607bc9. Completion now tracks whether a model token was already typed and stops offering models after it, so /model claude-sonnet-4 --e still completes --effort. Both cases are in test_complete_model_names_effort.

ACP agents advertise their own effort values (for example `minimal`), so
`/model --effort` now passes the raw value through when the provider
exposes effort options, and parses the five built-in levels only on the
legacy path. Completion no longer offers a second model once one has
been typed. Flags can still be completed after it.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f607bc9f1a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

let cache = self.completion_cache.read().unwrap();
let options: Vec<String> = match pending_flag {
Some("--provider") => cache.provider_names.clone(),
Some(_) => THINKING_EFFORTS.iter().map(ToString::to_string).collect(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Complete provider-advertised effort values

When an ACP-backed CLI session's harness advertises its own values (for example minimal in crates/goose/tests/acp_bootstrap_effort_test.rs:76-128), this arm still completes only the five legacy enum values. handle_model now deliberately accepts raw ThinkingEffortSupport::Options values, so tab completion never exposes minimal and suggests levels that the harness rejects; populate these candidates from the current provider capability (and avoid legacy candidates for unsupported providers) instead of always using THINKING_EFFORTS.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 87d6acc. CompletionCache now holds the session provider's effort values, filled from thinking_effort_support() on refresh: harness options for Options, nothing for Unsupported or self-managed Unspecified, and the five built-in levels otherwise. /model --effort <Tab> completes from that list. thinking_effort_values_follow_provider_support covers the mapping, and the completion test covers harness values.

The completion cache now records effort values from the provider's
effort support when it refreshes: the harness's advertised options for
ACP agents, none for agents with no selector or providers that manage
their own context, and the five built-in levels otherwise.
`/model --effort <Tab>` completes from that list.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 87d6accd3a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".


cache.provider_names = all_providers.iter().map(|(m, _)| m.name.clone()).collect();
cache.current_session_provider = session_provider;
cache.thinking_effort_values = thinking_effort_values;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Refresh effort completions after capability updates

When an ACP-backed CLI session's agent emits a ConfigOptionUpdate that rebuilds its thought-level selector, AcpProvider immediately publishes the new support (crates/goose/src/acp/provider.rs:1260-1262), but this value is copied only during the general completion refresh and the CLI never subscribes to subscribe_thinking_effort_support. Consequently, /model --effort <Tab> continues offering removed choices or omitting newly valid ones until an unrelated provider/model/new-session refresh, even though command execution validates against the live capability; update this cache from the provider's support subscription.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have left this out on purpose. Completion is only a hint: /model --effort sends the value to update_thinking_effort, which checks it against the live capability, so a stale list can cost a rejected Tab suggestion but never applies a wrong value. The cache already refreshes on the existing triggers (model or provider switch, new session). Keeping it current between those would mean running a background task in the CLI session on subscribe_thinking_effort_support. That is new lifecycle code, and I would rather not add it to this PR unless maintainers want it. It is straightforward to follow up with if they do.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI: change thinking effort mid-session via /model --effort

2 participants