fix(desktop): keep model picker switches session-scoped - #59493
Closed
izumi0uu wants to merge 1 commit into
Closed
Conversation
Desktop active-session picker calls already pass a session_id, but the gateway's model switch persistence is controlled by parsed model flags. Add --session so the shared parser keeps live-session selections, including MoA virtual provider presets, out of profile config.yaml. Constraint: config.set model values are parsed by hermes_cli.model_switch before persistence is decided. Rejected: backend special-case for desktop session_id | it would duplicate existing --session semantics and widen the gateway surface. Confidence: high Scope-risk: narrow Directive: Keep desktop model picker active-session switches explicit with --session; do not rely on session_id alone for persistence. Tested: npm run test:ui -- src/app/session/hooks/use-model-controls.test.tsx src/app/shell/model-menu-panel.test.tsx Tested: npm run typecheck Tested: git diff --check Not-tested: full pytest suite; change is desktop TypeScript/UI routing only.
Contributor
|
Thanks for the PR |
Contributor
|
Merged via PR #62694. Your Desktop and MoA commit was cherry-picked onto current main with authorship preserved, then widened to every TUI picker path. Thank you for the focused fix. |
13 tasks
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.
What does this PR do?
Fixes the desktop model picker path for live sessions so selecting a model, including a MoA preset, stays session-scoped instead of falling through to the global
config.yamlpersist path.The desktop hook was already sending
session_idtoconfig.set, but the gateway decides global persistence from the parsed model flags. Without--session,resolve_persist_behavior(False, False)can still persist the switch globally whenmodel.persist_switch_by_defaultis enabled. This PR appends--sessionfor active desktop sessions and adds coverage for both normal provider selections and MoA presets.This intentionally does not change Telegram sticky-session migration or MoA fallback behavior; it closes the desktop-to-global bleed entry point described in the issue.
Related Issue
Fixes #59480
Type of Change
Changes Made
apps/desktop/src/app/session/hooks/use-model-controls.ts--sessionwhen the desktop picker applies a model switch to an active session.apps/desktop/src/app/session/hooks/use-model-controls.test.tsx--session.BeastMode --provider moa --sessionis sent.apps/desktop/src/app/shell/model-menu-panel.tsxapps/desktop/src/app/shell/model-menu-panel.test.tsxHow to Test
cd apps/desktop && npm run test:ui -- src/app/session/hooks/use-model-controls.test.tsx src/app/shell/model-menu-panel.test.tsxcd apps/desktop && npm run typecheckgit diff --checkAdditional source-level probe used during development:
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/A