Commit Graph
149 Commits
Author SHA1 Message Date
Brennan Benson ea564628a5 Read Stop and cancel decisions through the named turn read
The turn work read also answers whether the chat is working, so Stop's
live-turn, scope and working checks come from one SQL snapshot instead of
the in-memory chat. Handover, goal and command-open turn scopes, the
usage-limit cut and the stopped-command check read the chat's database.
The adapters' live-turn recheck before interrupt is now awaited.
2026-11-07 17:01:13 -08:00
Brennan Benson f4e49275f1 Derive chat status from named indexed populations 2026-11-07 14:41:49 -08:00
Brennan Benson 4e2b12990c Read input evidence and stopped cuts from indexed items 2026-11-07 14:25:28 -08:00
OrcaWinandOrcaWin 5c487a8be4 test: remove 328 low-value tests (#39525)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-07 07:44:08 -08:00
OrcaWinandOrcaWin 9b98b38506 test: remove 137 low-value tests (#39522)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-07 07:20:11 -08:00
OrcaWinandOrcaWin 95fadd01ba test: remove 321 low-value main and shared tests (#39429)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-07 01:37:39 -08:00
OrcaWinandOrcaWin 1e3eb5701c test: remove 186 low-value main, scripts and shared tests (#39404)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-07 00:54:22 -08:00
OrcaWinandOrcaWin 4468deb34e test: remove 76 low-value fork and UI tests (#39321)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-06 22:49:58 -08:00
Kelvin Amoaba 2980a713c8 perf(mobile): use mobile-only chat coalesce and reveal timings (#39183) 2026-11-07 04:55:44 +00:00
Brennan Benson c6f07596ad Phone chat: empty Cmd/Ctrl+Enter steers the first queued message, and holding Cmd/Ctrl shows what it will do (#39215)
* fix(mobile): Cmd/Ctrl+Enter on an empty chat composer steers the first queued message

Matches desktop (#38732) in the paired web page: with nothing typed, the
chord steers the head waiting card through that card's own Steer, only
where its other way is steer.

* fix(mobile): empty Cmd/Ctrl+Enter sends the first queued card after a Stop, as desktop does

Desktop's rule (#38877) also sends the head card when no turn runs, and
goal mode keeps the empty chord inert. The queue list's handle now runs the
head card's own Send when idle, and steers mid-turn only where the chord's
other way is steer.

* test(mobile): type the queued-card handle refusal cases

* feat(mobile): holding Cmd/Ctrl in the phone chat composer shows what Cmd/Ctrl+Enter will do, as desktop does

Desktop's held-modifier preview moves into src/shared so the phone web
composer runs the same rule: Send becomes Queue, Steer or Steer queued
and the head queued card lights while the chord's modifier is held
alone on a hardware keyboard. The queue's empty-chord rule is one
function the preview and the press both read.

* fix(mobile): build the held-chord preview with the phone's own React, and offer only presses that act

The shared hook now takes its React hooks from the caller, as the shared
attachment preview does: the phone bundle resolves a different React copy
than the repo root, so importing react from src/shared broke every phone
web composer (Invalid hook call).

The preview also matches what a press does: one pill press per hold (a
double-click can't send a card after the draft went), a picked /plan-style
skill counts as a message, a head card whose own action is on its way shows
no Steer queued, and the lit state lives in the tray so a chat switch keeps it.

* fix(mobile): held-chord pill takes one click like desktop, keeps busy state per chat, lights only the head row

- The pill ignores a click whose detail is above 1, as desktop does, so a
  deliberate later click in the same hold still acts.
- In-flight card ids are kept per chat with functional updates, so a chat
  settling after a switch can't clear the current chat's record.
- The lit state is a small store only the head row subscribes to, so a hold
  re-renders one row, not the whole queue.
- The desktop preview test moves back beside the desktop wrapper it drives.

* refactor(mobile): one owner for queued-card actions, read by both the list and the held-chord cue

The queue list owned its in-flight guard per mount and the tray mirrored it
for the composer's Steer queued cue; each mirror leaked (cross-chat and
same-chat remount overwrites, an all-chats copy per change). As desktop's
queued-messages controller does, the tray now owns one action store: pending
keys per chat, admitted synchronously, released per action, published by
copying only the changed chat. The list takes those actions as a prop (it
keeps its own only when mounted alone), and the empty chord presses the head
through the same run, so the cue and the press can't disagree. The list's
imperative handle goes away.

Also replaces a type assertion on the pill's click detail with an in guard.

* test(native-chat): desktop chord-preview wrapper re-exports the hold delay its test reads
2026-11-06 18:17:24 -08:00
Brennan Benson 969c5ddd3a Support native Plan mode in chat (#38286)
* Add session Build and Plan choices to native chat

* Refresh planning choices across connected composers

* Give composer catalog tests a complete transport fixture

* Preserve planning choices through fresh turns and older hosts

* Type planning delivery fixture choices explicitly

* Honor mode capability for retained queued command picks

* Update existing native mode contract expectations

* Keep proposed plans visible in completed chat turns

* Group chat mode with permissions and goal controls

* Keep chat composer controls accessible in narrow panes

* Preserve composer overflow ownership and editor focus

* Complete composer localization catalog and subscription checks

* Keep chat composer controls contained in narrow panes

* Use the button spacing for compact Save

* Place chat mode immediately before Goal

* Restore Plan status test dependencies after main sync

* Show an exit pill only while chat Plan mode is active

* Remove obsolete composer tooltip translations

* Remove unused Build toggle catalog entries

* Apply Plan commands immediately from composer picks

* Preserve picked skill origin in composer admission

* Supply phone platform to composer regression fixture

* Preserve mode picks until their writer admits them

* Narrow the phone mode command before its draft transform

* Document the option fixture mutation shape

* Match phone Plan controls to the composer mode pills

* Assert optimistic mode feedback in the phone fixture

* Retain the phone mode pick recovery regression proof

* Use the relocated observation imports after the main merge

* Restore the composer IME module import after merging

* Read the queue assertion helper from its relocated owner

* Point the mode fixture at the relocated selection controller

* Register the phone Plan pill localization keys
2026-11-06 12:42:48 -08:00
Brennan Benson 7033f778e8 Keep native chat responsive after reading older messages (#38920)
* Bound native chat history after returning to latest

* Keep reader return evidence aligned with measured content

* Correct transcript regression fixtures and type annotations

* Preserve reader gestures through smaller row measurements

* Keep transcript regression tests focused on behavior

* Pin transcript passthrough and send admission expectations

* Preserve source correspondence in transcript projection reuse

* Keep reader intent separate from observed scroll geometry

* Preserve pending reader movement through no-op pins
2026-11-06 10:20:16 -08:00
Brennan Benson 4cccf7b04a perf(native-chat): reuse unchanged phone transcript rows (#38956)
* perf(native-chat): reuse unchanged phone transcript rows

* fix(native-chat): narrow retained projection output reuse

* refactor(native-chat): isolate phone session status type

* Document source comparison key safety

* Use last-member array accessor

* test(native-chat): check phone captures across source boundaries

* ci(mobile): route recorded transcript decoder inputs
2026-11-06 10:14:07 -08:00
Brennan Benson ea05861c91 Show a card in chat for pull requests the agent opens (#38750)
* feat(native-chat): show a card for pull requests a chat turn opened

When a turn's own command runs gh pr create and prints the new URL, the chat
shows an "Opened orca#3" card under that turn with the PR's state, title and
changed lines, read live from GitHub. The eye-slash control hides the card kind
and a toast links to the new Settings switch.

* fix(native-chat): satisfy lint in the opened pull request card

* fix(native-chat): keep opened pull request cards through tool runs and failed rereads

The card now rides a turn's work run, a clipped create output is always read
whole (retried when the chat is shown, never while hidden), older Codex JSON
output is decoded, rereads keep the last answer and restart past an in-flight
read, failing lookups back off, and a failed hide save says so.

* fix(native-chat): detect pull requests Codex opens through PowerShell, and wait for clipped output

Codex on Windows runs commands as pwsh -Command '...', which detection now
unwraps (and cmd /c), with tests on Claude's and Codex's recorded calls. A
clipped create output is decided from its whole text, each message is scanned
once, rereads keep their bytes counted, a merged card rereads after an edit,
and the header names another repo's pull request in full.

* fix(native-chat): retry each clipped pull request output until its host answers

Each create output cut short on the wire keeps its own backoff while the chat is
visible; a host whose support is unknown stays pending, and only one that says
it can't give outputs whole is decided from the head. PowerShell options and
backtick escapes are read as PowerShell does.

* fix(native-chat): read PowerShell create commands in PowerShell's own quoting

Decoding a tool call's script moves to its own module. PowerShell launches are
lexed with its quoting (single quotes keep backticks literal, double quotes and
bare text escape with them, here-strings and comments are text) and launch
options follow the common pattern's tables; what can't be read whole opens
nothing. A cancelled retry no longer records a failure.

* fix(native-chat): decode a launch wrapper inside a PowerShell tool call

* fix(native-chat): read Codex's escaped quotes in a Windows PowerShell command

Codex on Windows writes a double quote inside a double-quoted -Command as \",
so a create with an apostrophe in its title was skipped. Tests use the three
calls recorded from Codex on Windows.

* fix(native-chat): read a PowerShell launch line in the quoting of what ran it

Codex joins argv in POSIX quoting even on Windows, splitting one word into
differently quoted pieces, so a script ending in a backslash or holding both
$ and an apostrophe showed no card. The launch line now goes through the same
POSIX word decoder as the login-shell preview, and a PowerShell tool's own
line through PowerShell's quoting.

* fix(native-chat): find a PowerShell or cmd launch anywhere in a command list

A Bash call such as `pwsh -Command 'gh pr create --fill' && echo done` lost its
card once launch lines were read as POSIX words, and Codex's joined
`cmd.exe /c 'script'` never had one. Each command in a POSIX list is now read on
its own, through one launch reader shared with argv, while Node's Windows
`cmd.exe /d /s /c "script"` form keeps cmd's own quoting. PowerShell lexing
moves to its own module.

* fix(native-chat): unwrap a PowerShell or cmd launch only when it is the whole line

Rebuilding a command list around a nested launch could pull one out of a comment
or heredoc into a false card, and an unreadable launch hid a real create beside
it. As the common pattern does, only a line that is one launch is unwrapped;
any other line is analyzed as written. A PowerShell tool's line and Node's cmd
form must likewise be a single launch.

* fix(native-chat): unwrap cmd and PowerShell-tool lines only when they are one launch

Node's cmd form now unwraps only a /c script that is one quoted string with no
quote inside, since cmd escapes none, and a PowerShell tool's line ends at a
bare line break. Text after either launch can no longer pass for its script.

* fix(native-chat): read a PowerShell line continuation as a word break

A backtick before a line break in a PowerShell tool's line joined the next line
into the current word, so an argument on the next line could pass for a
command after the launch.

* fix(native-chat): unwrap only the launch shapes agents are recorded writing

Hand-written readers for cmd launches and for a launch nested in a PowerShell
tool's script kept letting printed text pass for a create. Only argv, a shell's
whole -c line and Codex's Windows pwsh -Command line are unwrapped now; argv is
never space-joined, and detection reads a shell line as whole POSIX words rather
than through the preview's lenient prefix. cmd launches and nested launches are
intended misses until an agent is recorded using them.

* fix(native-chat): read an escaped separator as text when finding a create

An escaped \; stayed in the analyzed commands and passed for a separator, so
printf '%s\n' \; gh pr create showed a card though only printf ran. Escaped
characters are now text, like quoted strings and comments.

* fix(native-chat): remove a line continuation when finding a create

Blanking escapes also turned a backslash-newline into a word, so a create on
the line after a continuation no longer started a command and lost its card.
A continuation is now removed, as the shell removes it.

* fix(native-chat): treat only backslash-LF as a line continuation

Bash removes a backslash before LF but not before CRLF, where the backslash
escapes CR and LF still ends the command. Removing both lost the card for a
create on the line after a CRLF continuation.
2026-11-06 02:26:37 -08:00
Brennan BensonandClaude Opus 5.5 2648941358 Fork a Chat UI chat from any finished response (#38326)
* feat(chat): shared contract for forking a chat from a response

Adds the create-time fork source, the host fork capability, the agent fork
level, the forked-from record relationship and the forked-from divider row.

* feat(chat): advertise each agent's fork level and a chat's fork support

* feat(chat): carry a fork source through chat launch, reload and retry

A launch with forkFrom {sessionId, throughItemId} keeps it on the create call,
the saved launch record, reload, retry and its holders, sends no new-chat
options, and is refused before create on a host that does not advertise forks.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat(chat): fork a native chat from a finished response on desktop

Finished root responses offer "Fork from this response" where the host and
agent can fork: disabled while support is unknown or a fork is opening, opened
in a new tab right after the source, with one toast naming the agent on
failure. The forked-from row draws as a divider linking to its source.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat(mobile): fork a chat from a response in the message actions sheet

The sheet offers "Fork from this response" with the desktop's eligibility and
host capability, creates the fork through the phone's chat create, and draws
the forked-from divider with a link to the source chat.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat(chat): a fork create replays only as the same fork

* Add native conversation copy adapters

* Create native chat forks with derived source markers

* fix(chat): offer a fork only on rows that show the agent's own message

A displayed row can be a tool call or a status projected as a plan while
reading as a response; both clients now check the journal row's own kind.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(chat): open phone and paired-desktop forks right after their source

The phone names its source tab as the create's placement and the host takes
that tab's group; a paired desktop sends the address captured at the click
when the fork has no tab of its own yet.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(chat): float a mid-turn response's fork action instead of adding a line

The action on a response the turn continues past hangs from a line of no
height, as the reply controls hang into the gap, so tool-heavy turns keep
their spacing.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(chat): follow the chat's own fork verdict on both clients

The options read already says whether the installed agent forks; an observed
no hides the action, an unanswered read keeps it disabled, and yes enables it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Preserve native copy boundaries and rewind behavior

* Preserve imported fork tips and serialize create replays

* fix(mobile): open a fork's source through the session's own chat opener

The forked-from link now asks the controller's existing opener for the source
by history id, so it follows that opener's host, selection and reveal rules
instead of navigating on its own.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Project fork markers from touched journal groups

* Retain fork group restoration for delayed readers

* fix(chat): keep a mid-turn response's fork in its own right gutter

The floated action covered the start of the next row. It now sits beside the
response's last line, in a gutter as tall as the prose, so it adds no line and
never reaches the following row.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Preserve native fork chain boundaries and durable streamed copies

* Place phone forks beside their source in window publications

* fix(tabs): adopt a host's new tab where the host placed it

First adoption put every unseen tab at the end of its group, so a fork the host
published after its source landed last. A new tab now follows its nearest host
predecessor when that tab is here; tabs already adopted keep the user's order.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(chat): reserve the fork gutter on every root response from the first frame

The gutter came and went with the fork offer, so prose reflowed when a turn
finished or support resolved. A pane that draws forks now keeps it on all root
responses, and the fork sits only there, not also beside Copy.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Return Codex copies without automatic provider renaming

* Resolve chat placement once at the current layout owner

* Preserve chat publication when saved opens are skipped

* Retry chat opens when queued placement changes

* Bound stale chat placement retries

* test: expect the OpenCode reader's imported fork tip

* perf(chat): keep the fork offer stable while a chat streams

Every stream commit made a new forkable-id set, so the fork context changed and
every offered response re-rendered. The set is reused while its members hold,
and rows get an action object that changes only with support or pending.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: keep the fork params and Claude fork worker inside main's new lint limits

* Test fork copy and source refresh scaling

* fix: merge duplicate imports and stringify the OpenCode fork tip id for main's lint rules

* Keep fork placement behind session tab projection boundaries

* test: annotate the Claude copy test's hoisted account homes instead of asserting

* fix: add the fork action and forked-from strings to the English catalogs

* test: give fixtures the fork copy their agents declare; add the forked-from string to the boot catalog

* test: keep registry fixtures consistent with the fork copy their agents declare

* fix(orcad): ship the Claude fork worker with the server; update tests for fork fields

* Test saved fork selections through import and first send

* Preserve ordinary chat publication while saving placement

* Show fork beside the copy button on phone chat responses

Long-press opens text selection on every current phone, so the actions sheet that held fork never opened. The fork button now sits next to each response's copy button.

* Keep the phone fork slot fixed and offer it on every forkable response

The fork slot is now held by the row's own kind, as desktop's gutter is, so finishing a turn or learning the host's support never moves the timestamp. Responses with no copyable text (a visual only) still get fork, and each button re-renders only when its own offer changes.

* Follow main's moved runtime modules in fork code and tests

* test: build the phone response-actions fixture without type casts

* Let the phone read the host's agents so its fork action can turn on

Phone QA found the fork button always disabled: the phone asks the host which agents can fork, and the host refused that read from paired phones.

* Retry the phone's agent-list read, and read again after a reconnect

A read lost to a dropped connection or a timeout left Fork disabled until the chat was reopened.

* Own the phone's agent-list retry timer in its own effect

CI's effect-cleanup check could not see a timer set inside the read's callback; each retry is now a state change with an effect that sets and clears one timer.

* Give each phone connection its own agent-list retries

A count left over from an earlier connection could leave a new one with no retries, so one failed read kept Fork disabled after the transport moved.

* Scope the phone's agent-list retries to each spell of discovery

When the host's fork support dropped and came back on the same connection, the earlier failures carried over, so one more failure got no retry. Each stretch of discovery now owns its reads, failures and retry timer.

* Keep the forked-from source link reachable by screen readers

The divider's separator role and row label hid the source chat button inside it; the rules are now decorative and the text and button read normally.

* Keep fork names owned by adopted chat records

* Use the fork icon for Fork from this response

* Show the phone meta actions only when a row has one

An empty actions group still shifted the time by the icons' edge margin on rows with no copy, fork or rewind.

* fix(chat): put Fork beside Copy in the response's hover row

The fork button sat alone in a right gutter far from the other row actions.
It now joins the response's existing hover controls next to Copy, where those
controls show, and the gutter is gone.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(chat): keep a finished turn's actions on its last words and hold the Fork slot

A turn whose last prose was followed by tool or thought rows showed no Copy
and no Fork anywhere until it was collapsed. The actions now belong to the
turn's last prose row, decided when the transcript's rows are built, and keep
the gap below it whole so they never cover the next row. Root responses also
keep an empty Fork slot when not offered, so resolving support never moves
the row's other actions.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(chat): give a turn's actions only to a reply with words

An image-only reply after the turn's text took the response actions but could
not draw them, so the text lost Copy and Fork. Slot construction now picks the
turn's last reply by the same words the row draws and copies.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(chat): let an image-only response hold a turn's actions when its text is folded

A collapsed turn that ends in an image hides its earlier text, so no drawn row
could show the response actions and Fork vanished. Each turn's actions now go
to its last drawn response with words, else its last with images. Copy and its
context-menu target appear only where there are words to copy.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Fix Claude fork cuts after local commands

* Extract the conversation copy input contract

* Preserve caller results at Claude fork boundaries

* test: check the copied fork for the wake answer without a type assertion

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-06 02:08:24 -08:00
Brennan Benson c5f1c59009 Let users hide the changed files card in chat (#38756)
* feat(native-chat): let users hide the per-turn changed files card

Adds a Changed files summary setting under Settings > Chat > Behavior (on by
default) and a Hide button on the card that turns it off everywhere, with a
toast linking back to the setting.

* fix(native-chat): confirm Hide only after the setting saves

Show Hidden only once the setting is saved and report a failed save instead;
keep the card header one line tall; cover saved settings without the key.

* test(native-chat): import getDefaultSettings from shared constants

* feat(native-chat): reveal Hide on card hover and move the setting to Appearance

The card's Hide control is now an icon with a Hide tooltip that appears on
hover or keyboard focus, and the Changed files summary switch lives in
Settings > Chat UI > Appearance, where Reset restores it.

* fix(native-chat): put the Hide reveal classes on a wrapper, not the Button

Button owns its effects; the hover and keyboard-focus reveal now lives on a
wrapper span, as other row actions do.
2026-11-06 00:05:16 -08:00
Kelvin Amoaba a4e24a9e5a feat(mobile): show automatic continue and Switch Account on chat usage-limit notices (#38298)
* feat(mobile): usage-limit card with the host's automatic continue, Continue and Switch Account

* refactor(mobile): give the notice disclosure its own file to fit the usage-limit status

* fix(mobile): drop the cancel failure once the host shows the cut cancelled

* fix(mobile): keep the usage-limit status up while a later re-ask is pending

A re-ask at a new journal cursor no longer blanks the reset line and pills;
the cut keeps its last answer. Don't continue reports its disabled state.
2026-11-06 05:12:00 +00:00
Kelvin Amoaba 69892601e2 feat(mobile): rewind a chat to an earlier message (#38344)
* feat(mobile): rewind a chat to an earlier message

Bring desktop's "Rewind to here" to phone chats. The rewind flow moves
into a shared React-injected hook so desktop and mobile share one set of
rules; desktop behaviour is unchanged. The host now lets phones call
agentSession.rewind behind agent-session.rewind.phone.v1, so a phone on
an older host offers nothing it would be refused.

* feat(mobile): put the message time first, then copy and rewind together
2026-11-05 23:06:47 +00:00
Kelvin Amoaba ce3fe75891 feat(mobile): set, pause, resume and clear a chat's goal from the phone (#38447)
* feat(mobile): set, pause, resume and clear a chat's goal from the phone

The phone sent /goal to the agent as plain text and showed no goal. It now
has desktop's goal mode (Goal chip, goal placeholder) and a goal strip on the
composer's top edge that expands to Pause/Resume and Clear goal.

The goal logic desktop and mobile share moves to src/shared: the goal report
(journal rows over the options answer), status labels, elapsed format, the
goal-mode pick rule and the goal row filter. agentSession.threadGoal joins the
phone allowlist behind agent-session.thread-goal.phone.v1, so older hosts keep
showing the goal without offering changes.

* fix(mobile): open each new goal's strip collapsed

* fix(mobile): keep goal sends' delivery choice and scope goal locks per chat

* fix(mobile): offer goal changes only when the paired desktop relays them

* test(mobile): pin which goal changes the phone offers per host

* refactor(mobile): reuse the queued box style and keep the goal strip stable per chunk

* fix(mobile): set phone goals through the composer's changeThreadGoal
2026-11-05 22:42:44 +00:00
Brennan Benson dbb9a270d4 Keep long chats responsive: stop rescanning whole history on each status update and subagent name (#38627)
* perf(native-chat): stop rescanning whole chat history on every status update and subagent label

Status re-derived after every journal write built a map of every item body in the
chat to find conversation-command turns; index only command entries instead.
Same-named sibling subagents restarted their ordinal search at 2 for each sibling
(quadratic); resume each label's search where it stopped. Output is unchanged.

* perf(native-chat): find command turns through an indexed read on each status update

Status re-derived after every journal write still walked the whole history to
learn which turns belong to conversation commands. The host now passes a by-key
read of the same status rows (same display state, presentation membership and
stop-note projection, limited to the current /clear context), and the request,
preview and interruption readers check only the turns their backward scans reach,
the way the usage-limit reader already does. Clients without an index keep the
scan. A contract test drives real journal writes at 10x history and pins both the
constant indexed reads and the remaining per-row work.

* test(native-chat): count status body reads without Reflect.get or casts

* chore: drop accidental lockfile churn

* perf(native-chat): read the status display state once and pin indexed status parity

The host's status lookup now reads the journal's display state once per projection.
The status contract test covers the /clear boundary, an interruption verdict behind
a skipped command turn, a revised command turn, and the journal's per-row render
budget; the context-rows test expects the returned /clear sequence.

* test(native-chat): bound status work on the write that records an Orca stop

* test(native-chat): status follows a turn that becomes a command turn

* fix(native-chat): take the status lookup from the status read itself

Status read the journal's display state directly, which journals without queued
messages (test stand-ins, older wiring) do not have. The status read now returns
the by-key lookup bound to the state it rendered; readers whose status read has
none keep the scan.
2026-11-05 14:20:44 -08:00
Kelvin Amoaba b9f988be22 feat(mobile): continue a chat that Orca's stop cut off (#38287)
* feat(mobile): continue an interrupted chat from the phone

Desktop offers Continue on a turn Orca's own stop cut off; the phone only
showed the words. The offer and failure rules move to
src/shared/native-chat/native-chat-interrupted-continue.ts, desktop uses
them unchanged, and the phone drives them from its session over
agentSession.continueInterrupted when the host advertises it.

* refactor(native-chat): type the Continue answer instead of casting it

* fix(mobile): let a phone call agentSession.continueInterrupted

The host refused the method from phones, so Continue on the phone always
failed. Allow it on the execution-host route and advertise
agent-session.continue-interrupted.phone.v1, which the phone gates on:
hosts that advertise only continue-interrupted.v1 still refuse phones.

* fix(mobile): hide Continue when an older paired desktop relays the chat

A newer page on a server routed through an older desktop would offer
Continue that the desktop refuses to forward. Gate it on the relaying
desktop too; the workspace server context moves to a react-native-free
module so session hooks can read it. Long failure text now shrinks so
the banner's dismiss stays on screen.

* refactor(mobile): reuse the chat's Try Again look and shared Continue wording

The Continue button takes the Try Again pill styles and common.continue,
the shared helper takes the RPC's answer instead of a call wrapper, and
the phone hook memoizes its result and keys late answers in one place.

* fix(i18n): keep the Continue failure copy inline so catalogs rebuild it

* refactor(mobile): keep the structured session hook under its line cap

* fix(native-chat): check the session's agent audience before continuing a turn
2026-11-05 22:08:45 +00:00
Kelvin Amoaba 9055eb9344 feat(mobile): desktop chat links and code wrap on the phone (#38294)
* refactor(native-chat): move chat link rules and the file-existence checker to shared

GitHub reference linking, the reference-repo rule, chat file-path linkification,
the per-chat existence checker and the path-existence batcher are platform-free.
Move them to src/shared so the phone's chat can use the same rules; desktop keeps
its host adapters and behaves the same.

* feat(mobile): link #123 refs, check file paths and wrap code in chat

* test(mobile): pin which chat paths and refs become links

* refactor(mobile): parse repo link fields instead of casting

* refactor(mobile): own chat link state in the chat overlay

* fix(mobile): keep unchecked chat paths as precise as before

* fix(mobile): only peek at known paths while reasoning streams

* test(mobile): leave #123 splitting rules to the shared transform's tests

* refactor(native-chat): tidy shared link helpers and skip separator-free text

* test(native-chat): import the existence type from its shared home

* style(mobile): fold the code-span link handler onto one line
2026-11-05 21:24:09 +00:00
Kelvin Amoaba 7860261d18 feat(mobile): paste images and long text into the chat composer (#38591)
* feat(mobile): paste images and long text into the chat composer

* test(mobile): pin which composer pastes attach

* fix(mobile): keep a long paste as text when no upload can start

* fix(mobile): re-encode pasted images agents can't read as PNG

* test(mobile): pin composer paste routing at the composer field

* refactor(mobile): fold composer paste routing into its hook

* fix(mobile): read pasted images in the uploader so the composer needs no shell bridge

* test(mobile): stub the context ring in the composer paste test
2026-11-05 20:59:54 +00:00
Kelvin Amoaba 9b2f3105ee feat(mobile): show the context usage ring and its breakdown in the chat composer (#38371)
* feat(mobile): show the context usage ring in the chat composer

Desktop's ring reads the structured session's context facts; the phone
never read the host's contextUsage answer. The summary rules move to
src/shared so both read the same numbers, and the title card's anchored
card machinery is generalized so the ring's breakdown opens above the
composer without dropping the keyboard.

* refactor(native-chat): share the context ring's critical threshold

* test(mobile): stub the context ring where composer tests stub its siblings

* fix(mobile): keep the context card with the composer and the keyboard up

Touching the card no longer takes focus from the draft, the open card
moves with the composer as the keyboard or draft resizes it, and the
composer's own menu closes it.

* fix(mobile): close the context card when the composer hides, and let long titles wrap

* refactor(mobile): share the anchored card layer and the ring readout

* test(e2e): pass the new options arg in the permission publication test
2026-11-05 20:44:10 +00:00
Kelvin Amoaba a3f08b4075 feat(mobile): pin the agent's plan above the chat composer (#38359)
* feat(mobile): dock the chat's plan above the composer

Desktop docks the latest plan above the composer; the phone only drew it
inline in the transcript. Move desktop's docked-plan rule to src/shared and
draw it on the phone as a collapsible strip in the background-tasks box.

* perf(native-chat): keep the docked plan's identity until the plan changes

* refactor(native-chat): read the docked plan from the newest message back

* refactor(mobile): drop a cast in the docked plan's open memory

* test(mobile): pass the tray's new taskList in the recovery test
2026-11-05 20:31:10 +00:00
Kelvin Amoaba de7fa2addb feat(mobile): show background task rows in the chat transcript (#38264)
* feat(mobile): show background task rows in the chat transcript

* fix(mobile): truncate the task output path like desktop

* fix(mobile): scale and select task rows like the rest of the transcript

* fix(mobile): translate the task output line

* refactor(mobile): read task rows from the shared row content

* test(mobile): restore the text reader for task row tests
2026-11-05 20:16:34 +00:00
OrcaWinandOrcaWin 64cd31458d test: remove 31 low-value interaction and state tests (#38629)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-05 11:21:57 -08:00
Brennan Benson 61c069aac0 Keep a Claude chat's effort changeable after its first reply (#38272)
* fix(native-chat): keep a Claude chat's effort changeable after its first turn

After its first turn a Claude chat saves the model id Claude reports it ran
(claude-opus-5-5), while the model list names that model only by its alias
(opus). Every capability lookup matched on the row id, so the chat's model
had no effort choices and effort turned into display-only text on desktop
and phone.

A listed row now describes a model id by its own id or by the model it
resolves to. The match supplies capabilities only; the chat keeps showing and
sending the exact model it ran, so it never drifts when the alias moves. The
host applies the same rule to the row it adds for the chat's model, for
clients that read the answer's models.

* test(native-chat): cover exact-row precedence for a described model id

* fix(native-chat): remember an after-reply effort without changing the new-chat model

An effort pick in a chat on the resolved id it ran is remembered under the
listed row that runs that model and leaves the new-chat model untouched, as
the common pattern keeps the sticky model and updates only its options. The
resolved id is never stored as a default.

* refactor(native-chat): move the remembered-pick model choice into its own module

* fix(native-chat): keep a held effort pick from adopting a new-chat model

* test(native-chat): run the held-effort case as a Claude launch

* revert(native-chat): drop the host-side capability copy no live answer can use

Claude's live session listing carries no resolvedModel, so the host never matched there, and phones draw the host-served chat bundle, so every client already runs the shared lookup.

* Key Claude's model rows by the model each one runs

Claude's listing named rows by alias (opus), while a chat saves the model
it ran (claude-opus-5-5) after its first turn, so equivalent chats held two
kinds of model value and a chat's effort could go read-only. Rows are now
keyed by the versioned model they run, the common pattern: a pick saves the
same id the CLI reports. Aliases stay as their own rows with their own
effort levels; the picker lists one only while the chat is on it or a
search matches it, and the phone list leaves them out. A saved alias is
kept as the user picked it. A configured alias default marks the versioned
row it runs, and an effort picked in an existing or resumed chat no longer
changes the model new chats start on, whatever ids the chat and listing use.

* test: give the delayed-report alias test's timeout its reason

* Remember a new chat's picks by its first turn, and keep aliases reachable everywhere

- A chat counts as existing once it has a turn or a send, or when it was
  opened rather than launched here, not once its launch published: an empty
  new chat's effort pick adopts its model for new chats again, and every
  agent's existing chat keeps the remembered new-chat model.
- Only a row that names itself as the model it runs covers an alias, so an
  older host's alias rows stay listed beside a chat's stand-in row.
- The phone lists an alias of a listed model behind a More models toggle.
- The terminal-chat and commit-message model lists carry each row's
  resolvedModel, so they list aliases the same way; an older remote that
  omits it keeps its full list.

* fix(mobile): keep the More models toggle's state without an effect reset

* Keep commit-message aliases selectable and their resolved model out of saved settings

The Source Control model Select has no search, so it lists alias rows after
the versioned ones instead of hiding them. Discovered models are saved
without an alias row's resolvedModel, and the refresh compares that same
saved shape, so the settings cache gains no field.

* Drop an unrelated audit-tools lockfile change; reset the phone's More models toggle when its drawer closes

* test: build the saved-models test's settings without a cast
2026-11-05 00:43:23 -08:00
Brennan Benson e5a960cbf9 Show changed files directly in chat turns (#38256)
* Show changed files directly in chat turns

* Use the fixture frame for the diff interaction

* Keep changed filenames readable and preserve file actions

* Keep unconfirmed file changes in tool activity

* Capture changed files in completed transcript fixtures

* Preserve patch data with authoritative history status

* Keep mobile diff interaction coverage beside its card

* Assert the decoded patch line contract

* Exercise full returned history in catch-up coverage

* test(chat): target file summary when reopening patches
2026-11-04 17:53:16 -08:00
Kelvin Amoaba 7247685c74 feat(native-chat): let users pick when idle chat agents stop, or never (#38202)
* feat(native-chat): let users change or turn off the idle stop for chat agents

The idle sweep stopped every chat's agent after a hard-coded 30 minutes,
which broke peer messaging, Claude Remote Control and background
subagents. Settings > Chat > Behavior now picks the window, including
Never, and the sweep reads it every tick so a change applies without a
restart. Never only keeps agents running: a chat handle with no agent
still retires on the default window.

* test(native-chat): type the childless sweep fixture's journal parameter
2026-11-04 19:30:58 +00:00
Manuel MeurerandKelvin Amoaba 8fa41115a0 feat(native-chat): add a setting to keep the scroll position when sending (#38162)
* feat(native-chat): add a setting to keep the scroll position when sending

Own sends from a pane bring the latest into view and follow the reply.
A new Chat > Behavior setting, "Scroll to latest when sending" (on by
default), turns that off: a reader who scrolled up stays in place, one
at the end keeps following the reply, and Jump to latest still works.

The gate sits in the one reveal every send path reports to, so the
explicit Jump to latest button and find navigation are unaffected.

Fixes #38153

* fix(native-chat): keep following a reader at the end when reveal on send is off

A reader can sit at the end without following (a rail jump that clamps at
the end, a short nudge up). The setting's gate skipped their reveal, so
the sent message and its reply grew below the viewport. The list now
decides: off skips only readers who stopped away from the end, judged by
where they last scrolled so the send's own echo doesn't count.

* refactor(native-chat): read the scroll-on-send setting through one helper

Also drops the redundant 'scroll' search keyword (the title already
matches) and the settings switch call-shape test.

* fix(native-chat): decide the send reveal from where the reader was at the press

The last-scroll distance stayed small after output grew past a reader who
had nudged up, so a later send still jumped them with the setting off.
The list now reads live geometry, and a structured message, which reveals
only once the host admits it, captures that answer at the press, before
its own echo moves the end.

* fix(native-chat): read the reader before Resume waits for the host

Resume reveals only after the host lifts the pause, by which time the
drain may already have added rows below the reader.

---------

Co-authored-by: Kelvin Amoaba <97001695+AmoabaKelvin@users.noreply.github.com>
2026-11-04 19:30:42 +00:00
Brennan Benson 974bb4a7ca Preserve chat inputs through uncertain delivery and Stop (#32267)
* Give unconfirmed chat messages explicit recovery actions

* Resolve receipt settlement code quality findings

* Complete recovery copy localization and callback types

* Align send lifecycle contracts with explicit recovery actions

* Include the unconfirmed opener in the restart fixture type

* fix(chat): preserve recovery ownership across lifecycle boundaries

* Preserve send ownership across context replacement and recovery

* Separate history ingestion from live send settlement

* Preserve original send truth and reconcile acquired history

* Use summary-shaped history responses in acquisition coverage

* Preserve queued image recovery for released readers

* Prove independent late receipt recovery across reopen

* Preserve queued image sources in bounded catch-up projection

* Keep queued input and explicit chat retries in their original domains

* Preserve reader lifetime across main session interfaces

* Fix static checks after main integration

* Migrate retained recovery Stop contracts to current lifecycle

* test: use typed access for journal population counters

* fix: consolidate history page bounds type imports

* test: exercise legacy snapshot reuse through selected handoff

* Fix attachment draft typing and document test boundary casts

* Repair current journal integration types and contract fixtures

* Keep uncertain send recovery in queue reorder reopen contract

* Repair mobile contract boundaries and exact queue lookup

* Align input finalization contracts with current Stop ordering

* Keep recovery copies independent of queued message barriers

* Reconcile Stop and replay contracts with current lifecycle

* Update recovery tests for current module and draft APIs

* Align Stop recovery contracts with independent queue policy

* Expose independent recoveries to current queue controls

* Cover sending-only queue Resume visibility

* Adapt recovery contracts to shared queue projection

* Use current history and failure-word contracts in recovery tests

* test: retain released reader source contracts through queue settlement

* Keep uncertain sends in ordinary history and preserve saved queue choices

* test: prove mobile draft leaf subscription isolation

* Use typed operation instrumentation in mobile recovery test

* Align lifecycle test boundary typing with static rules

* Repair test module typing and retained runtime copy catalog

* Remove unused chat delivery notice translations

* test(chat): retain legacy handback without uncertainty notice

* fix(chat): omit saved uncertainty card captions

* test: bind released readers to exact queue wire and proof

* Replace archived reader evaluator with exact recorded contracts

* Mark queued edit test hook import as type-only

* Isolate queued card tests from native inline composer imports

* Complete structured mobile resolution in queued edit test

* Align mobile attachment cleanup lifetime test with send outcomes

* fix: restore journal prototype delegation methods

* Keep uncertain sends as ordinary messages in memory

* Release notes admission after uncertain opening completes

* fix: end opening selection operations at uncertain completion

* fix: derive selection admission from live requests and repair integration tests

* test: consolidate send imports and use a supported locale

* Fix CI test types and synchronize retired delivery catalogs

* Type exported test fixture mocks through the public Vitest API

* test: align selection and journal verification contracts

* Reconcile acquired history before journal projection

* Preserve saved invocation facts during history catch-up

* Repair journal recovery consumers and CI contracts

* Keep failed legacy import displays serializable and bounded

* Preserve journal owner boundaries in CI import cleanup

* Fix typed test fixtures for session recovery contracts

* fix: align history and recovery contract types

* test: verify logical rewind across released chats

* Bound retained queue and status reads

* Bound Stop and delivery reads to relevant journal inputs

* Bound subscriber catch-up and stopped-history reads

* test: align journal read fixtures and operation counts

* Bound automatic chat reads to current input evidence

* fix: align journal reader contracts and test fixtures

* test: type historical dispatch rejection fixtures

* fix: restore merged session projection and fixture types

* fix: preserve resumed queues across logical fork rewind

* Preserve queue pause chronology across logical rewinds

Keep original Stop and Resume coordinates while retaining matching warm failure evidence in the journal owner. Keep historical fixture authoring separate from current production writes.

* End historical fixture authoring before current queue actions

* Keep answer operations separate from retained messages

* Fix resting chat attention context

* Fix attention regression fixture provenance

* Validate retained RPC test frame reads

* Fix retained attention and RPC contract fixtures

* Keep send observations on canonical delivery evidence
2026-11-04 02:40:10 -08:00
OrcaWinandOrcaWin 25994e0b94 test: remove 1460 low-value test declarations (#38082)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-04 00:25:44 -08:00
Brennan Benson 163c5de81e Add Ultracode to Claude chat effort (#38010)
* Add Ultracode to Claude chat effort

* Correct Ultracode test type annotations

* Keep Claude workflow effort observations consistent

* Make effort picker test follow async option contract

* Keep effort coverage at its owning behavior layer

* Exercise workflow readback with recorded native settings

* Preserve configured workflow during effort reapplication
2026-11-03 21:57:07 -08:00
Brennan Benson c3212f0377 Preserve chat HTML appearance in file previews (#37890)
* Preserve chat visual appearance in file previews

* Deliver visual theme once and retain updates through canceled navigation

* Assert visual guest subscriptions stay bounded on repeated loads

* Bundle sandboxed file guest preloads independently

* Match preview media theme and keep build validation import safe

* Cover preview media handoff and retirement contracts

* Apply saved visual appearance before document scripts
2026-11-03 21:36:33 -08:00
Neil 926f8bad13 refactor: organize terminal and runtime contract owners (#38011) 2026-11-03 19:56:34 -08:00
Neil da96fadec3 refactor: organize source-control contract owners (#37990) 2026-11-03 19:12:25 -08:00
OrcaWinandOrcaWin a905a311c5 test: remove 72 low-value test declarations (#38002)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-03 17:38:41 -08:00
Neil 2c03c4b989 refactor: organize agent status and lifecycle owners (#37961) 2026-11-03 16:36:54 -08:00
Jinwoo Hong 7b45308ee8 fix(mobile): type desktop replies from shared contracts and keep phone list facts beside the desktop row (#37917)
* refactor(mobile): keep phone list facts beside the desktop's worktree row

The phone wrote its own list facts (lineage depth, host labels, list keys
and so on) onto the worktree.ps row object it got from the desktop, so a
desktop field with one of those names would be read as the phone's own.

List items are now { row, view }: the row is the desktop's, typed from the
shared RuntimeWorktreePsSummary contract, and view holds what the phone
works out. Host labels are a lookup beside the rows instead of fields on
them. A type test fails if the desktop row gains a view field's name or a
type the phone row would not accept, and a contract test feeds rows from
the desktop's own worktree.ps builder through the phone list.

* fix(mobile): type desktop replies from shared contracts and reject unchecked rows (#37923)

* wip: contract guards

* fix(mobile): type desktop replies from the shared contracts and ban unchecked z.custom

Session tabs, the createSupport reply and native-chat frames were typed by
hand on the phone, so a desktop change could leave the phone compiling
against a stale shape. They are now Pick/Partial of shared types; the
createSupport reply and native-chat transcript frames gain shared types the
desktop uses too, which also gives the phone the 'chat-program' reason it
was missing. Type tests fail when a desktop tab gains a phone-only name or
a field type the phone would not accept.

Catalog rows were admitted with z.custom<Worktree>() and no check. They now
need a string worktreeId, and an ast-grep rule rejects a z.custom with no
check anywhere in mobile/src.

* test(mobile): the desktop contract check also catches a null the phone would not accept
2026-11-03 18:33:05 -05:00
Brennan Benson b9a22101da Keep question answers visible until delivery completes (#37883)
* Keep async question answers stable until delivery

* Cover pending answers with recorded question input

* Cancel delayed answers when question controls disable

* Scope pending question answers to their form and journal order

* Verify revised questions and handover ordering through production sources

* Use typed phone answer fixtures

* Reuse answer delivery evidence and skip unquoted queue matching

* Supply derived journal scope in the translator regression

* Use named type imports for mobile question contracts

* Exercise canonical pending rows and buffered phone read coverage

* Align phone controller assertions with optional send intent

* Supply transcript metadata for phone question test fixtures

* Fix question prompt test literal typing
2026-11-03 15:16:53 -08:00
Kelvin AmoabaandVyacheslav Scherbinin ac6fa4ef46 fix(claude): reflect fallback without changing saved models (#37958)
* fix(claude): reflect model fallback in chat and composer

* test(claude): reproduce fallback display before and after

* fix(i18n): ship the model fallback notice in the runtime catalog

* fix(mobile): ship the model fallback notice in the runtime catalog

* fix(claude): accept unnamed init models in response observations

* fix(claude): keep fallback observations display-only

Response model metadata must not satisfy delayed input evidence or
change saved launch preferences.

* test(claude): type fallback regression fixtures

* test(claude): expect init model display reports

---------

Co-authored-by: Vyacheslav Scherbinin <gentslava@mail.ru>
2026-11-03 23:15:51 +00:00
Neil d5f2a17cd2 refactor: group agent launch contracts under concrete owners (#37915) 2026-11-03 14:45:49 -08:00
OrcaWinandOrcaWin bd5110671c test: remove 74 low-value test declarations (#37887)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-03 11:33:25 -08:00
OrcaWinandOrcaWin 106f1376e9 test: remove 37 low-value test declarations (#37885)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-03 11:22:34 -08:00
OrcaWinandOrcaWin f0a02936ac test: remove 96 low-value test declarations (#37882)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-03 11:19:42 -08:00
OrcaWin 29079b567f test: remove 151 low-value test declarations (#37870)
* test: remove 151 low-value test declarations

* test: prune obsolete wall-clock test exemptions
2026-11-03 11:07:43 -08:00
OrcaWin 31fb68b669 test: remove 47 low-value test declarations (#37860) 2026-11-03 09:56:05 -08:00
OrcaWin 39d02ae0bc test: remove 49 low-value test declarations (#37856) 2026-11-03 09:25:28 -08:00
OrcaWin e7542a3ca1 test: remove 52 low-value test declarations (#37854) 2026-11-03 09:07:13 -08:00