fix: push updated config options to renderer after mid-task model change#2325
Open
Basit-Balogun10 wants to merge 1 commit into
Open
fix: push updated config options to renderer after mid-task model change#2325Basit-Balogun10 wants to merge 1 commit into
Basit-Balogun10 wants to merge 1 commit into
Conversation
When switching models mid-task, `rebuildEffortConfigOption` correctly rebuilds/removes the effort config, but the updated configOptions were never pushed back to the renderer via a session subscription event. The renderer's optimistic update only changed the model currentValue, leaving stale effort options visible — causing errors when selecting incompatible efforts and showing the selector for models that don't support thinking effort at all. Emit a `config_option_update` session event at the end of `setSessionConfigOption` so the renderer always receives the fully rebuilt configOptions. Closes PostHog#2323 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
Reviews (1): Last reviewed commit: "fix: push updated config options to rend..." | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When switching from one thinking effort to another that isn't supported by the currently selected Claude model, the app throws an error and falls back. Two related issues:
The new-task flow already handles this correctly — but the mid-task flow didn't.
Closes #2323
Changes
The server-side
rebuildEffortConfigOptionwas already correctly rebuilding/removing the effort config when the model changes. The problem was that the updatedconfigOptionswere never pushed to the renderer.setSessionConfigOptionnow emits aconfig_option_updatesession event after any config change, so the renderer receives the fully rebuilt config options (including removed/filtered effort entries). The renderer already handles this event — it just wasn't being sent.One-liner in
packages/agent/src/adapters/claude/claude-agent.ts.How did you test this?
Manual testing
I ran through each model tier since they have different effort support:
Models with no effort support (selector should hide):
Models with partial effort support (Low/Medium/High only):
Models with full effort support (all five levels):
Effort clamping on model downgrade:
Effort restoration on model upgrade:
New task creation (regression check):
Across all scenarios: no error toasts, no console errors, selector label always matches the selected value.
Publish to changelog?
no