Skip to content

Cursor flat-mode model picker: 'Default' row not highlighted when session is on ACP default[] #46

Description

@heavygee

Bug

In a Cursor ACP session where no model has been explicitly chosen, the model picker dropdown shows no radio selected - even though the session is actively pinned to default[] (Cursor's server-chosen Auto router pick).

Repro

  1. Open a Cursor session in HAPI web.
  2. Open the model picker.
  3. Observe: every row (Default, composer-2.5 · fast=true, claude-fable-5 · ..., etc.) has an empty radio.

Expected: Default is highlighted, because the launcher pins default[] via setConfigOption on spawn (cli/src/cursor/cursorAcpRemoteLauncher.ts:321-342).

Root cause

The picker is in flat mode because HAPI's ACP client doesn't declare the proprietary parameterizedModelPicker capability (the Cursor-side workaround flag discussed in the forum thread). With no parameterizedModelPicker, Cursor returns one wire id per base, so HAPI builds a flat catalog.

SessionChat.tsx only forwards `selectedModelBase` to `HappyComposer` when `cursorPicker.mode === 'dual'`:

```
selectedModelBase={
agentFlavor === 'cursor' && cursorPicker?.mode === 'dual'
? cursorSelectedBaseValue
: undefined
}
```

In flat mode the prop is `undefined`, so `HappyComposer` falls back to `model === option.value`. The session's `model` is `null` (the launcher calls `previousSetModel(undefined)` after applying `default[]`), and the Default row's value is `'auto'`, so `null === 'auto'` fails for every row.

Fix

Drop the `mode === 'dual'` gate. `resolveSessionCursorBaseSelectValue` already handles flat mode correctly via its early return (`return picker.wireId ?? 'auto'`), which yields `'auto'` when the session is on default and matches the Default row's value.

Out of scope (separate upstream conversation)

The deeper fix is for Cursor to migrate to the standard ACP `configOptions` / `thought_level` mechanism so HAPI gets the full multi-variant catalog without proprietary capability flags. Cursor has agreed to do this but no ETA. Once it lands, HAPI moves to dual mode automatically and this bug becomes invisible - but the patched flat-mode highlight remains correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions