Repository navigation
fix(desktop): restore omitted release behaviors - #5247
Conversation
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d8531177ee
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…5274) #5093 drops the leading slash from / menu names and turns the empty composer placeholder into @ and / hints. #5247 stages quick model menu choices until an outside click or Cmd/Ctrl+Enter, and Escape discards them. Three journeys still expected the old names, the old placeholder and a menu that applies on click, so they failed on main. Locate / menu options by their visible names, expect the new default placeholder, and commit each quick model menu choice before checking the model pill: once with an outside click and otherwise with Cmd/Ctrl+Enter.
Record MoonshotAI#5247 ported and MoonshotAI#5258, MoonshotAI#5259 and MoonshotAI#5266 equivalent to the fork's own sidebar, composer and tool-duration implementations, each with an executable probe.
Requirement or Bug
Desktop 1.1.4 shipped four product changes that never reached the old repository's
mainbranch and were therefore absent from the monorepo import: rejectedAgentSwarmcalls were hidden, Swarm activation showed a high-usage notice, model-switch confirmations became session-aware, and the quick model menu deferred model/effort changes until dismissal.This PR restores the behavior of the four omitted PRs in the current architecture:
Bug Reproduction Steps
AgentSwarm. Before this PR, the rejected call can remain visible as a pending or failed Swarm card even though no sub-agent started.session_typeorwarninginmodel_switch_confirm, or returneffort_switch_confirm. Before this PR, the renderer does not honor the session-aware fields or load the effort configuration.Root Cause
kimi-code-app#990 was named
chore: sync release 1.1.4 back to main, but it only changed release metadata, changelogs, the package version, the lockfile, and the core submodule pointer. It did not copy any product source from the four PRs above. Later release branches and the monorepo snapshot inheritedmain, so the missing behavior remained absent.This is a fundamental restoration rather than a workaround. The old patches were not cherry-picked verbatim because the current monorepo now uses conversation projections, active-host model catalogs, and the browser-overlay menu protocol; each behavior was reconnected to the current owner of that responsibility.
Code Changes
Core structure
flowchart TD Cloud[Cloud client configs] --> Loader[Shared client-config loader] Loader --> ModelStore[Model-switch store] Loader --> EffortStore[Effort-switch store] ModelStore --> ModelGate[Session-aware model gate] EffortStore --> EffortGate[Managed effort gate] ModelGate --> Dialog[Shared confirmation dialog] EffortGate --> Dialog Composer[Quick model menu] --> Draft[Model and effort draft] Draft -->|outside dismissal or Cmd/Ctrl+Enter| ModelGate Draft -->|after successful model switch| EffortGate Conversation[Conversation projection] --> SwarmFilter[Hide pre-start Swarm rejections] ModeStore[Mode store] --> SwarmNotice[High-usage notice]The shared loader owns concurrent config reads and stale-request protection for both cloud configurations. The production client and test workspace rig share the same hook and mode-action wiring, while the CLI and desktop contracts remain independent because they live on opposite dependency boundaries.
Restored behavior
AgentSwarmcalls from conversation projection only when they are still pending with Swarm mode off or fail before any sub-agent reference exists. Calls with started sub-agents and cancellations remain visible.session_type, wildcard model IDs, localized hints, and localized warnings. Existing sessions use compact/continue/cancel; new and draft sessions use confirm/cancel. Config loading is awaited before a selection is matched, with generation and session guards.effort_switch_confirm, display configured effort descriptions, and gate managed OAuth effort changes through the configured confirmation. Cancellation, session changes, model changes, and stale config loads leave the current effort unchanged.keepOpen; outside dismissal andCmd/Ctrl+Entercommit, while Escape and programmatic closure cancel the draft. The fallback menu handles the same keyboard contract itself.Reading guide
packages/app-core/src/client/conversationToTurns.tsshows the current pre-start Swarm rejection boundary.packages/app-core/src/lib/modelSwitchConfirm.tsandpackages/app-core/src/lib/effortSwitch.tsdefine the cloud config contracts and matching rules.packages/app-client/src/stores/clientConfigLoader.tsowns shared loading;useKimiWebClient.tsapplies model and effort gates.packages/app-components/src/composer/Composer.vueandmodelMenuDraft.tsimplement deferred quick-menu selection.apps/desktop/src/renderer/lib/browserOverlayMenu.tsandapps/desktop/src/shared/browser-overlay.tscarry native-menu dismissal and keyboard semantics.Release metadata
Changesets were intentionally omitted at the requester's explicit instruction. This differs from the default requirement in
CONTRIBUTING.md; a maintainer should resolve that release-process exception before merge if a changeset is required.Screenshots / Recordings
Not captured. Browser automation was not authorized for this task. The changed dialog states, fallback/native menu contracts, keyboard behavior, and client gates are covered by component and protocol tests instead.
Behavior Changes and Affected Users
AgentSwarmcardssession_type,warning, and wildcards are ignored by the renderer*session_type; disable the config to bypass confirmationCmd/Ctrl+Enter; Escape cancelssession_typecan be interpreted by the old renderersession_type: old,new, orallAffected modules and coverage:
AgentSwarmcalls inpackages/app-core/test/conversation.test.ts.packages/app-client/test/mode-store.test.ts.packages/app-core/test/modelSwitchConfirm.test.tsandpackages/app-client/test/modelSwitchConfirm*.test.ts.packages/app-components/test/modelSwitchConfirmDialog.test.ts.packages/app-components/test/composerModelMenuDraft.test.ts.keepOpen, note sizing, andCmd/Ctrl+Enterin the desktop main/renderer tests.No CLI, KAP, SDK, persisted-session, or provider wire contract is changed. Existing conversation data is only projected differently for the narrow pre-start Swarm rejection case.
Validation performed
pnpm exec vitest run --reporter=agent ...— 13 affected test files, 221 tests passed.pnpm --filter kimi-code-app run typecheck— desktop main-process TypeScript and renderer Vue TypeScript passed.pnpm lint— comment checks, oxlint, import boundaries, guards, ratchet, test-double, quarantine, and instruction checks passed.pnpm run check:duplication origin/main— passed with no new clones after sharing the client config loader, workspace hooks/actions, and model-row projection.Checklist
/approve).gen-changesetsskill; changesets were explicitly omitted by the requester.gen-docsskill; no documentation update is needed because the existing pages document CLI behavior rather than these restored desktop interactions.