Skip to content

fix(desktop): make model and thinking-level changes instant without success toasts - #4272

Closed
amaldevcm wants to merge 1 commit into
apache:mainfrom
amaldevcm:fix/3745-instant-model-thinking-changes
Closed

fix(desktop): make model and thinking-level changes instant without success toasts#4272
amaldevcm wants to merge 1 commit into
apache:mainfrom
amaldevcm:fix/3745-instant-model-thinking-changes

Conversation

@amaldevcm

Copy link
Copy Markdown

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 --noEmit clean on every changed file (apps/desktop/tsconfig.main.json
    and tsconfig.renderer.json)
  • Rewrote app-shell-session-settings-actions.test.ts (12 tests: latest-wins
    coalescing, rollback-on-failure, a superseded failure not rolling back a
    newer selection, model/thinking independence, explicit-undefined
    thinking-level override) and fixed app-shell-session-ui-state.test.ts's
    fixtures for the renamed state fields — 27/27 pass
  • npm run lint (biome) clean on all changed files
  • Full apps/desktop main test suite: 1289/1315 pass; the 10 pre-existing
    failures (OAuth deadline timing, Windows symlink privileges, Computer Use
    health, RiveWorkflow) are unrelated — confirmed identical with these changes
    stashed out
  • format:check and the root build/typecheck scripts were not run
    end-to-end: packages/ui's build currently fails on pre-existing, unrelated
    TypeScript errors (missing lucide-react/simple-icons type declarations,
    a settledText API drift) — verified this predates this change by
    reproducing it with the diff stashed out
  • Not done: manual click-through in the running desktop app (rapid
    thinking-level changes, forced-failure rollback, bypass-confirm gating)

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

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: Claude trailer is on the commit.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally (format
    and the full-workspace typecheck/build were not run — see Verification)

Does this PR entail a change in behavior?

  • Yes — described under Summary above

…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
@github-actions github-actions Bot added the effort/L Under 1000 readable lines label Aug 30, 2026
@amaldevcm

Copy link
Copy Markdown
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.

@amaldevcm amaldevcm closed this Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/L Under 1000 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(desktop): make model and thinking-level changes instant without success toasts

1 participant