← Back to Pull requests

refactor(ui): unify composer model selection with Astryx Selector #6158

Closed
unknown closed this pull request without merging on Oct 19, 2026 04:50 UTC
View on GitHub
unknown unknown commented on Oct 19, 2026 00:29 UTC
Author

Summary

Model selection used nested radio menus, a custom ACP Agent rail/search panel, a compact WorkHub wheel, and a separate Codex plugin selector. Context capacity and selected-model summaries also appeared repeatedly.

Use one Composer-owned Astryx Selector, with search and connection/Agent groups. Thinking effort uses the shared adjacent selector. Remove context capacity and duplicate menu summaries.

Paths unified

| Path | Result |
| --- | --- |
| Native conversations and expanded WorkHub | Searchable connection groups and the shared thinking control. |
| New tasks/home and side chat | Native models, ACP Agents and Codex models share one selector. |
| Existing ACP sessions | The same selector, scoped to the current Agent, retaining opaque model variants, modes and session recovery. |
| Codex client plugin | Supplies its remote model catalog, provider identity and loading/retry callback through the existing slot's renderPicker; Composer owns rendering, shared provider logos, native/ACP composition, mutations and pending-send admission. |
| Compact WorkHub | The same controls use Astryx's bottom sheet. |
| Model-recovery action | Opens the production selector directly. |

Settings retains its existing Astryx ModelPicker and shared native option shaping. Runtime Host, storage and dependency contracts are unchanged.

Integration and recovery

The slot delegates rendering to Composer with plugin-owned catalog data. One filtered executor catalog defines the scope: editable new tasks retain all configured Agents, while fixed sessions retain only their current Agent. Model options and recovery actions use that same catalog; selecting one Agent does not lock a new task to it.

Unavailable and authentication-required Agents expose Retry or Sign in both before selection and while a different ready Agent is selected. Recovery uses the existing callbacks without changing the current selection. Existing-session restore/history actions keep their existing callbacks. Loading uses Astryx's native loading state; new-task triggers retain Agent identity. Recovery notices wrap onto a separate row so they do not squeeze the model label on narrow screens. Fixed ACP sessions do not activate the Codex contribution or expose recovery actions for other Agents.

Removed implementations

  • Delete chat-model-switcher.tsx, composer-options-menu.tsx, executor-model-picker.tsx, model-picker-panel.tsx and model-wheel-picker.tsx, their obsolete styles and exports.

  • Remove the Codex client's native connection grouping, custom option/value rendering, separate model/reasoning Selectors, wheel branch/state and injected mark styling.

  • Replace old menu/rail/wheel tests and the Codex controls-shape mock with focused behavior tests through the real Composer, slot registry and actual Codex client bundle. Existing Electron checks retain Host-confirmed changes and native floating-window bounds; browser stories own search/focus/layout checks.
  • The cumulative diff adds 1,042 lines and removes 5,356 across 37 files (net −4,314).

    Client integration migration

    conversation.composer.model-selection now receives renderPicker, hasModels, fixedExecutorId and the current executor target. Contributions call renderPicker with their own model catalog instead of rendering replacement controls. The previous full-control owner props and ModelWheelPicker client export are removed. The repository-only Codex example is migrated in this PR; existing installations must be reinstalled from the matching Maka checkout. Its README documents this requirement. No compatibility picker or duplicate execution state is retained.

    Refs #5787, #5789, #6103.

    Verification

  • UI build and all 783 UI workspace tests passed. The focused Composer/slot/runtime set contains 25 passing tests.

  • Actual Codex client bundle + production Composer/slot integration covers failed discovery → Retry, keyboard opening, native → Codex → ACP → native, exact native connection identity, reasoning changes, pending-send admission, and fixed ACP model/mode controls.

  • ACP recovery tests cover no selection and an already-selected ready Agent; Sign in and Retry invoke the existing callbacks with zero selection writes. The fixed-session test asserts the exact Agent group and no other Agent's recovery button, retaining failed-write/confirmed-model checks. Removing the native-option guard or the catalog's fixed-session filter independently fails that isolation test. Earlier ACP-composition and pre-selection-recovery mutations also failed their regressions.

  • All 11 Codex adapter protocol tests passed. Removed tests protected the retired wheel interaction and mocked control structure; their supported selection/recovery obligations now run through the shared component.

  • Desktop typecheck, static Storybook build, 19 focused browser runs, format/lint, Desktop/UI Knip, surface inventory and renderer architecture checks passed.

  • Four additional CDP checks cover light/dark Codex composition and narrow recovery before and after selecting another ready Agent: no page overflow, search owns focus, no radio controls, shared provider logos are rendered, and recovery remains visible. The existing narrow story now selects Antigravity while retaining Claude Agent's Sign in action. Browser stories assert the Codex logo and narrow label geometry.

  • Full CI passed on the final head 68a62a530, which M4n5ter approved after rechecking the recovery and fixed-session paths. All three inline review threads are resolved. Electron E2E and packaged-app checks were not run locally.
  • Visual comparison

    Same real product-workhub--standard-composer story, fixtures, Chinese locale and 1000 × 900 viewport. Left: separately built main at 286ffa820; right: this branch at 500b83641. Each image contains the complete composer and open popup.

    !Light theme: nested menu before, unified Astryx Selector after

    !Dark theme: nested menu before, unified Astryx Selector after

    <details>
    <summary>Current Codex contribution through the shared picker</summary>

    The story loads the actual Codex client bundle. Native, Codex and ACP groups share the same searchable list; longer catalogs scroll inside Astryx's popup.

    !Codex contribution through the unified picker, light

    !Codex contribution through the unified picker, dark

    </details>

    AI use

  • No generative tool made a substantive contribution

  • Generative tooling made a substantive contribution
  • Tool(s) and scope: Codex assisted with component and plugin consolidation, legacy removal, regression tests, Storybook/CDP verification and this description.

    Checklist

  • Tests cover the change and fail without it

  • Lint, format, typecheck and the affected suites pass locally
  • Does this PR entail a change in behavior?

  • Yes — described under Summary above

  • No
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: liugddx Review duration: 260m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.52) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #6158"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 22.5% · Safe to merge
    22.5%
    Repository