Skip to content

feat: allow overriding advisor reasoning effort#27196

Merged
ibetitsmike merged 7 commits into
mainfrom
mike/advisor-thinking-selector
Jul 14, 2026
Merged

feat: allow overriding advisor reasoning effort#27196
ibetitsmike merged 7 commits into
mainfrom
mike/advisor-thinking-selector

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Adds an optional reasoning effort override for the Advisor on the Coder Agents settings page, using the same model selector + effort slider that other agent overrides use.

Changes

  • codersdk/coderd: AdvisorConfig gains an optional reasoning_effort. It is only accepted alongside a dedicated advisor model_config_id and is validated against that model's selectable efforts (400 with the selectable values otherwise). GET ignores stray legacy values without a model config.
  • chatd: when an advisor model override resolves and an effort is configured, the advisor call uses that effort as its fixed default/max. If the advisor model is unavailable and the runtime falls back to the chat model, the override effort is not applied.
  • UI: AdvisorSettings now uses the shared ModelSelector with its Effort slider. Selecting a model initializes the effort from the model's default; an explicitly unset effort stays empty so the advisor follows the model config's default.
  • UI: ModelSelector gains an optional unsetLabel entry ("Use chat model" for the advisor) so the model can be unset without the Clear button that also resets usage limits; it stays usable when no enabled models exist.
  • UI hardening from review: the submit path sanitizes a stored effort that is no longer selectable, drops it when the saved model is proven unavailable, and preserves it while model configs are loading or errored.
  • Docs: advisor platform-controls page documents the new Reasoning effort setting.

Testing

  • Unit: TestChatAdvisorConfig_* (coderd), advisor runtime/override tests (chatd), Storybook stories for the settings page.
  • Dogfood UAT on a local instance with the chat-advisor experiment: selected a reasoning model, moved the slider to High, saved, verified API round-trip and reload persistence, cleared and verified the effort is dropped, plus API validation assertions (effort without model 400, invalid effort 400 with selectable values).

This PR was authored by Mux (an AI coding agent) working on Mike's behalf.

Adds an optional reasoning_effort to the advisor config. The effort is
only accepted alongside a dedicated advisor model and is validated
against that model's selectable efforts. The Coder Agents settings page
now uses the shared ModelSelector with its effort slider for the
advisor override.
@github-actions

Copy link
Copy Markdown

Docs preview

📖 View docs preview for docs/ai-coder/agents/platform-controls/advisor.md

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 953adada20

ℹ️ 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".

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

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread site/src/pages/AgentsPage/components/AdvisorSettings.tsx
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

1 similar comment
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 84d6a6875e

ℹ️ 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".

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

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread site/src/pages/AgentsPage/components/AdvisorSettings.tsx
… selector

The shared ModelSelector gains an optional unsetLabel entry that selects
the empty value, so admins can switch the advisor back to the chat model
without the Clear button that also resets the usage limits.
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 83bae83667

ℹ️ 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".

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

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread site/src/pages/AgentsPage/components/AdvisorSettings.tsx Outdated
…empty on save

Only sanitize a stored reasoning effort when one was explicitly set.
An empty effort now survives unrelated form edits so the advisor keeps
following the model config's default.
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 24db316621

ℹ️ 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".

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

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread site/src/pages/AgentsPage/components/AdvisorSettings.tsx
…ith no model options

A selector with an unsetLabel no longer disables itself when the options
list is empty, so an override pointing at a disabled model can still be
switched back to the chat model without Clear.
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 5ad6b1a464

ℹ️ 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".

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

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread site/src/pages/AgentsPage/components/AdvisorSettings.tsx Outdated
Comment thread site/src/pages/AgentsPage/components/ChatElements/ModelSelector.tsx
…rt and unset styling

Drop a stored reasoning effort on save when the selected model is
unavailable so unrelated edits are not rejected, and base the unset
option's selected styling on the value being empty rather than on
whether the selected model resolved.
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: fcb840ac3d

ℹ️ 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".

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

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread site/src/pages/AgentsPage/components/AdvisorSettings.tsx Outdated
…ile model configs load

Only drop a stored reasoning effort once the model config list has
loaded successfully and proven the saved model unavailable. Loading,
refetching, or errored config queries keep the stored effort intact.
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: bdc92df2c6

ℹ️ 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".

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

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike merged commit 55b06f1 into main Jul 14, 2026
36 of 37 checks passed
@ibetitsmike
ibetitsmike deleted the mike/advisor-thinking-selector branch July 14, 2026 09:01
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants