Skip to content

fix(desktop): a new remote conversation starts at the app's default thinking level - #1066

Merged
huichen merged 1 commit into
mainfrom
fix/remote-thinking-default
Oct 14, 2026
Merged

huichen merged 1 commit into
mainfrom
fix/remote-thinking-default

Conversation

@huichen

@huichen huichen commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

Why

On the desktop, every new remote conversation started with thinking level high, while the same model started on this machine ran at medium — the app's own default.

Cause: a remote draft seeded its level from the host's model catalogue, and the agent answers list_models with

let thinking_level = if model.reasoning { "high" } else { "off" };

(agent/src/rpc/commands/providers.rs) — a capability marker asserted by the agent's own tests, not a default anybody chose. The desktop already knows this and ignores the field for its own composer: modelThinkingLevel in integrations/agent/agentClient documents "Desktop defaults to medium rather than inheriting the agent catalog's high default". The remote draft path was the one place that did inherit it.

And it is not cosmetic: the draft's level travels with the first prompt (freshThinkingLevel → { level } on the creating prompt command → provision_agent_session(..., thinking_level)), so the host really did create the conversation at high.

What changed

defaultRemoteThinkingLevel now seeds a draft the way this app's own composer does: off for a model that accepts no thinking controls, this app's default otherwise — never the level the catalogue declares for the model. An existing conversation is untouched; it still shows whatever the host reports for it via get_state.

Both halves are asserted in RemoteConversationSettings.test.tsx:

  • a draft on a model whose catalogue entry says reasoning: true, thinkingLevel: "high" seeds medium — mutation-checked, with the old line restored it fails expected 'high' to be 'medium';
  • a conversation that exists and whose host reports high keeps showing high, so the fix cannot widen into "this machine overrides the host's sessions".

Checks

Scoped to desktop/ (TS only, no Rust touched): tsc --noEmit, eslint, and the full vitest run — 302 files / 4051 tests, all passing.

…evel

A remote draft seeded its thinking level from the host's catalogue, which the
agent answers with `high` for every reasoning model and `off` for the rest
(`agent/src/rpc/commands/providers.rs`) — a capability marker, not a default
anybody chose. So every conversation started here against a host ran at high
effort while the same model started on this machine ran at medium; and because
the level travels with the first prompt (`freshThinkingLevel`), the host really
did create it at high.

`modelThinkingLevel` in `integrations/agent/agentClient` already states this
app's rule — its own default, deliberately not the catalogue's high one — and
the remote draft now follows it: `off` for a model that takes no thinking
controls, this app's default otherwise. A conversation that already exists is
untouched: it still shows the level the host reports for it.

The draft test that asserted the catalogue's level wins is replaced by one that
asserts the app's default (mutation-checked: with the old line restored it fails
"expected 'high' to be 'medium'"), plus the other half of the rule, that an
existing conversation keeps the host's own level.
@huichen
huichen enabled auto-merge (squash) October 14, 2026 14:47
@huichen
huichen merged commit cb7a88c into main Oct 14, 2026
12 checks passed
@huichen
huichen deleted the fix/remote-thinking-default branch October 14, 2026 14:51
huichen added a commit that referenced this pull request Oct 14, 2026
…1072)

The desktop's remote draft resolved its model and level from the host alone — the
catalogue's `isDefault` model and this app's default level — where the phone
resolves both from its own memory first: the model the user last chose (if that
host still offers it), then the host's default, then the first; the level the user
last chose, then its floor (`newConversation` in
`mobile/src/remote/useConversationController.ts`). This app's own composer has the
same memory (`resolveInitialModelId`/`resolveInitialThinkingLevel`), so the remote
draft was the one place on this machine that ignored it: a reader who had just
been working at `xhigh` on `openrouter/auto` got the host's default model back at
`medium` for every new remote conversation.

Three things, all on the phone's rule now:

- the draft's model is the remembered one when that host still offers it,
  otherwise the host's `isDefault`, otherwise the first it offers;
- the draft's level is the remembered one, otherwise this app's default — and
  `off` for a model that takes no thinking controls. Deliberately not the level
  the host's catalogue declares for the model: that field is a capability marker
  the agent answers with `high` for every reasoning model, which is #1066;
- picking either one writes it to the same memory the composer writes
  (`rememberLastUsedModel`/`rememberLastUsedThinkingLevel`, one key per device —
  the phone's `SecureStore` is device-wide in the same way). Without the write the
  draft could only ever replay this machine's *local* choices, and the phone
  writes on every change, including on an existing conversation.

Switching model on a draft now keeps the level the user is on (the phone's rule)
and only drops it to `off` when the new model takes no thinking controls. The old
`DEFAULT_REMOTE_THINKING_LEVEL` constant is gone: the floor is the shared
`defaultThinkingLevel` the composer uses, so there is one value to change.

The phone's floor stays `off` — a separate decision, and this PR does not touch
mobile code.

New assertions, each mutation-checked against the old behaviour (the three fail
with the resolution and the writes reverted): the draft starts from the
remembered model and level; a remembered model that host no longer offers falls
back to its default; a draft's choice and a choice made on an existing
conversation are both remembered, and are read back from the shared storage.
huichen added a commit that referenced this pull request Oct 14, 2026
…#1076)

Nine desktop fixes landed between 10-14 08:38 and 10-15 00:39 (#1047, #1050,
#1065, #1066, #1067, #1068, #1070, #1072, #1074). Each was re-checked two ways:
its own unit test, and the rendered app in the screenshot harness with an
assertion about what the fix is supposed to look like. Every browser assertion was
then re-run against the fix *reverted* — a check that cannot fail on the old code
proves nothing, and two of them could not, which is what this PR fixes.

Eight of the nine hold everywhere they were asked to. The ninth is #1074 and is
reported below rather than changed: it is a layout decision, not a slip.

## The eight that hold, and what fails on the old code

| fix | asserted in the rendered app | fails on the old code with |
|---|---|---|
| #1047 `rail-heading-hover` | pointer on a conversation row → all ten heading controls at opacity 0; pointer on one heading → its two visible, the other eight not | `10 of 10 heading controls are revealed while the pointer is only over a conversation row` |
| #1050 `review-file-hover` | pointer on the second file's row → exactly that row's chevron at opacity 1 | `2 chevrons are visible while the pointer is on one row` |
| #1065 `remote-draft-caret` | after "new conversation" the caret is in the composer and typed text lands in it | `the caret is on <body>, not in the composer` |
| #1065 `remote-caret-settle` | while the host answers, focusing elsewhere is not stolen; the caret returns when the run settles | (the focus effect removed: the caret never arrives) |
| #1066 `remote-draft-defaults` | a new draft opens at 中 — this app's default — not at the 高 the host's catalogue declares | `the draft started at the level the host catalogue declares` |
| #1067 `remote-model-loading` | while the host's read is in flight the control says 读取中…, never its own label; then the host's value | `while the host is answering, the control shows its own label` |
| #1068 `remote-host-settings` | the icon row's label is wider than 120px and its grid sits inside the card, aligned and below it | `the icon row leaves its label 0px wide` (also re-measured at 1024x720: label 670px, grid 17px inside the card) |
| #1070 `remote-live-event-order` | a live event for a row in the chat section leaves the order alone | `the host row overtook this machine's rows on the strength of a live event` |
| #1072 `remote-draft-remembers-pick` | a pick made on an existing conversation is where the next draft starts | `the new draft did not start from the last pick: model="DeepSeek V4 Pro"` |
| #1074 `remote-hub` | with the pairing form folded the page does not scroll at its window | `the Remote page wants 37px more than the window has` |

## Two harness gaps that made #1066 and #1067 unfalsifiable

- **The host declared the wrong level.** `list_models` answered with the fixture's
  own `thinkingLevel`, which is `medium` for every model — where the agent answers
  a *capability marker* (`high` for every reasoning model, `off` for the rest;
  `agent/src/rpc/commands/providers.rs`). A draft seeded from that field was
  therefore indistinguishable from a correct one here, and `?remoteSlowRead` did
  not matter either. The host's answer is now mapped to what the agent declares,
  which is the only reason the #1066 assertion can fail on the old code.
- **A host answered in three milliseconds.** The state a reader is in *while* a
  read is in flight never reached a capture, and that state is the whole of #1067:
  a control that filled its own label into the value slot looked identical to one
  saying it was loading. `?remoteSlowRead=1` holds `get_state` and `list_models`
  back by 1.5s; nothing else about the host changes.

`window.__shot.remoteSessionEvent(sessionId)` is the third addition: `?remoteStream=1`
only pushes into the conversation a scenario opens, whose row is already the newest
of its group — so #1070's jumping row needs an event pushed at a row *further down*
the list, which is now expressible from a scenario step.

## #1074 at the smallest window the app allows

The scenario's own window (1280x860) fits, and `remote-hub` proves it. At the
window minimum (`minWidth: 1024`, `minHeight: 720`) the page still wants 85px of
scrolling, and the second paired machine's row is clipped by the window bottom
(captured at that size). The PR's own table recorded "37px over" there; the two
cards come to 641px of content either way (host 249px, client 392px), so closing
the last 85px means putting them side by side — a layout decision this PR does not
make on its own.

## Checks

- `desktop`: `vitest run` 303 files / 4105 tests pass; `eslint` + `tsc --noEmit`
  clean.
- Harness: the eight new scenarios pass; all 27 remote scenarios and 4 unrelated
  ones (`rail-tree`, `settings-general`, `terminal`, `rail-pin-menu`) re-run
  against the changed fixture, all green.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant