fix(desktop): make model and thinking-level changes instant without success toasts - #4272
Closed
amaldevcm wants to merge 1 commit into
Closed
fix(desktop): make model and thinking-level changes instant without success toasts#4272amaldevcm wants to merge 1 commit into
amaldevcm wants to merge 1 commit into
Conversation
…uccess toasts Replaces the shared boolean pending-Set gate with independent optimistic-value overlays per session for model, thinking-level, and permission-mode, so a change applies instantly, model and thinking writes never block each other, rapid changes coalesce to the latest one, and success is silent (only a terminal failure rolls back and shows a toast). Fixes apache#3745 Generated-by: Claude
Author
|
Closing — #3749 already exists for this issue, opened by the person who claimed it first (Sun-GLiang), and has gone through several rounds of review that surfaced races and edge cases (Stop cancellation, cross-client staleness, follow-up settlement) this implementation didn't handle. Deferring to that PR instead of duplicating the effort. |
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.
Summary
Maka Desktop persists active-task model, thinking-level, and permission-mode
changes through Runtime Host asynchronously. Model and thinking-level writes
shared a single boolean pending gate, so a thinking-level change could be
blocked by an in-flight model change (and vice versa); every completed change
also fired a success toast regardless of whether it was still the latest
intent.
This replaces the shared gate with an independent optimistic-value overlay per
session for each of model, thinking-level, and permission-mode. A change
applies to the UI immediately; the overlay value itself is the coalescing
token, so a stale completion (superseded by a newer change to the same field)
is silently dropped instead of toasting or rolling back over a newer
selection. Success is now silent; only a terminal failure (the latest
request failing) rolls the control back to the last committed value and shows
the existing localized error toast.
Fixes #3745
Verification
tsc --noEmitclean on every changed file (apps/desktop/tsconfig.main.jsonand
tsconfig.renderer.json)app-shell-session-settings-actions.test.ts(12 tests: latest-winscoalescing, rollback-on-failure, a superseded failure not rolling back a
newer selection, model/thinking independence, explicit-
undefinedthinking-level override) and fixed
app-shell-session-ui-state.test.ts'sfixtures for the renamed state fields — 27/27 pass
npm run lint(biome) clean on all changed filesapps/desktopmain test suite: 1289/1315 pass; the 10 pre-existingfailures (OAuth deadline timing, Windows symlink privileges, Computer Use
health, RiveWorkflow) are unrelated — confirmed identical with these changes
stashed out
format:checkand the rootbuild/typecheckscripts were not runend-to-end:
packages/ui's build currently fails on pre-existing, unrelatedTypeScript errors (missing
lucide-react/simple-iconstype declarations,a
settledTextAPI drift) — verified this predates this change byreproducing it with the diff stashed out
thinking-level changes, forced-failure rollback, bypass-confirm gating)
AI use
Select exactly one:
Tool(s) and scope: Claude (Sonnet 5) — investigated the issue, designed and
implemented the full fix across all files listed below, and wrote/updated the
tests.
Generated-by: Claudetrailer is on the commit.Checklist
and the full-workspace typecheck/build were not run — see Verification)
Does this PR entail a change in behavior?