Commit Graph
5 Commits
Author SHA1 Message Date
Brennan Benson 1f9ba76726 Keep slow model discovery alive beyond picker waits 2026-11-13 13:16:13 -08:00
Kelvin Amoaba 345c326a91 feat(cli): rename a chat with orca chat rename (#38719)
Fixes #38556
2026-11-06 03:44:40 +00:00
Brennan Benson 1b696e4b90 Fix OpenCode effort selection for the selected model (#37950)
* Fix OpenCode model-specific effort discovery

* Consolidate effort discovery imports

* Complete phone model selection test response

* Preserve OpenCode discovery through slow startup and cancellation

* Align catalog tests with observed OpenCode menus

* Share OpenCode startups across waiting model menus
2026-11-03 15:59:49 -08:00
Brennan Benson 21857c7424 Continue in Chat UI refuses before closing the terminal when another terminal runs the conversation (#37397)
* fix(native-chat): let createSupport ask whether another terminal runs a resumed conversation

A resume's createSupport can now carry resumeFrom (behind
agent-session.structured.resume-writer-admission.v1, since older hosts'
strict params reject it). The host runs the same writer check create runs,
leaving out the panes the client will close first (matched by key or by
the PTY they resolve to; a shared tmux/OpenCode server is never left out),
and probes the candidates together so a bounded client wait is not spent
on one probe after another. The host's English refusal says "another chat"
only when it names one. The resume params move to their own module to keep
the params file under its line limit.

Tracked in STA-13440.

* fix(native-chat): refuse a resume before anything closes or opens when another terminal runs it

Continue in Chat UI asks the host before closing the terminal, naming the
panes the close takes; when another terminal runs the conversation it says
so in one toast and leaves the terminal open with no chat. Session History's
Resume in New Chat (and any other resume launch) asks through the launch
admission and, on that refusal, opens no placeholder tab: its caller's one
toast is the only notice. A local admission that times out still never
leads to a close. Older hosts without the capability keep today's flow.
The launch admission's toasts move to their own module to keep that file
under its line limit.

Tracked in STA-13440.

* fix(native-chat): say why a resumed chat failed when a terminal holds it or its history is missing

A failed start refused because a terminal's agent still runs the
conversation (no chat named as holder) now reads the existing "already
running this conversation in another terminal" words instead of a bare
"Chat could not be started.". A transcript the host could not find yet gets
the same history words an unreadable one already had. This covers the
create-time backstop: a terminal started between the pre-check and create,
or an older host without the pre-check.

Tracked in STA-13440.

* fix(native-chat): keep exporting ResumeSource from the session params module

* fix(native-chat): keep a terminal open when its host's resume check could not be confirmed

A failed capability read was taken as an older host, so the resume question
was left out, the host admitted, and the terminal closed before create refused
the conversation another terminal runs. An unread capability now leaves the
resume unanswered; a host that reports an older capability list keeps its path.

* fix(native-chat): say "another terminal" only where the refusal's owner is still known

The write failure drops the refusal's owner, so a chat-owned conflict on a
send, mutation or phone notice read as a terminal. Only the failed start,
which keeps the raw refusal, now records that no chat was named; everywhere
else keeps the generic wording.

* perf(native-chat): resolve panes in the writer check only when some are left out

Every create, resume and acquire check resolved each matching row's pane to
its PTY, even with no panes to leave out, and each unresolved key scanned
every terminal. With nothing to leave out no pane is resolved now; with some,
one identity read context serves every key.

* test(native-chat): pin createSupport's resume refusal to create's, and History's one notice

Runs the real createSupport handler on a runtime whose status store proves
another terminal live: leaving out the source pane admits, otherwise it refuses
with create's code and details. The Session History replacement keeps its chat
and toasts once when the host refuses before anything opens.

* fix(native-chat): translate the "another terminal runs this conversation" toast

It is now the only notice when Continue in Chat is refused before the terminal
closes, and only English carried it, so every other language showed English.

* fix(native-chat): withhold an unread resume capability only where a terminal closes next

Reading an unknown capability as unreachable refused Session History and
/resume launches on a paired host that main admits and create completes. The
host question now asks the plain question on an unread capability and says so
on its answer; only Continue in Chat, which closes the terminal next, treats
that answer as not admitted, from the same read that chose the request.

* test(native-chat): count the writer check's terminal reads with a typed map

The perf contract counted iteration through a proxy, which the type-aware lint
rejects. It now counts record reads on a Map subclass; a scan of every
terminal per row still shows up as rows times terminals.

* test(native-chat): read the writer-check fixtures without type assertions

The changed-code gate rejects casts. The perf contract builds real terminal
records through the identity fixture, and the createSupport parity test reads
create's refusal through the shared refusal parser.

* fix(native-chat): declare the refusal holder that failed-start cause words read

The failed chat's notice passes its launch failure, with the holder its
refusal named, through the cause parts to the words that tell a chat from a
terminal. Those functions now declare that field instead of carrying it
undeclared, which the typecheck rejected for a literal in the test.

* perf(native-chat): probe a conversation's writers a few at a time and stop at a holder

The writer check started a process probe for every matching row at once and
kept them all running after the first live holder refused. It now picks the
rows in one synchronous pass, probes at most eight at a time through the
shared bounded pool, and starts no probe once a holder refused.

* test(native-chat): pin the writer check's single terminal look on the real runtime

The scale contract built its own resolver, so a host that made an identity
read per pane, or passed none, still passed. It now runs the runtime's own
writer check over recorded terminals and counts read contexts and per-key
terminal scans: one context and no scans with panes to leave out, none
without.
2026-11-02 10:18:36 -08:00
Neil 89f9ce08de refactor(shared): organize session contracts and projections (#36979)
* refactor(shared): organize session contracts and projections

* chore: tighten dropped-path flaky pattern allowance

* docs: preserve current agent instructions with valid formatting
2026-11-01 03:14:46 -08:00