mirror of
https://github.com/stablyai/orca.git
synced 2026-11-18 11:54:46 +00:00
b83e76f01e66fa9d2467a2fb2fa12b5e1b7be62e
2842
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
a1f7f97671 |
Orchestration v3: coordinators end their turn and Orca wakes them (#36137)
* fix(orchestration): keep a terminal's mail from being consumed by another terminal, and let settled structured workers take further tasks A plain orchestration check consumed the named terminal's mail whatever terminal ran it, so a coordinator checking a worker's handle took the worker's message. A consuming check from a terminal whose own live pane is a different terminal's is now refused; --peek and --all still read it without consuming. worker-start --terminal and dispatch --inject routed a structured worker (structworker_ handle) as a terminal and failed with terminal_unsupported_for_agent_session. Any agent-session party now takes its task as a send into its session, while a structured worker keeps the pane and process authority its first Dispatch had. * fix(orchestration): fence check by live terminal incl. acks; defer injecting structured workers Review fixes for the mail fence and structured worker reuse: - The check fence compares the caller's and the mailbox's live terminal process instead of recorded panes, so exited terminals keep the old behaviour and two processes sharing a recorded pane are told apart. It also covers --ack in every read mode. The caller lookup is shared with the lifecycle caller fence. - dispatch --inject to a structured worker stays refused as before: an injected Dispatch takes no custody, so releasing the first Dispatch could close a session working on the second. worker-start --terminal reuse transfers custody and stays supported. - worker-start decides pane-less chat authority from the resolved party and passes the session down, so delivery and next commands no longer re-derive it from the address spelling. - Receipts name an agent session, not a chat. * fix(orchestration): an exited caller's env pane names no caller The caller lookup fell back to the env pane key whenever the env handle was not live, so an exited terminal's pane resolved to whatever terminal now occupies it, and a tmux worker's own check was refused. The pane fallback now applies only when the env handle is not proven exited. * fix(terminal): keep surviving terminals streaming to main after a restart Main now attaches every live local daemon session it adopts at startup, not only ones a window pane or remote view is showing, and re-attaches after a daemon endpoint drop. The attach snapshot seeds main's screen, tail and title, and an attached-but-silent agent gets an output clock so readiness can see it has gone quiet. Waits on a survivor main could not attach fail at once instead of timing out. * fix(terminal): restore only pane-less streams after endpoint loss; one attach state - Endpoint loss re-attaches in main only sessions no renderer view reports; a pane restores its own. - The attach hide skips views mid-attach and leaves a pane's own hidden claim alone on failure. - One per-session stream state (attaching, attached, lost) replaces three sets and is forgotten on exit. - Waits retry the attach before failing, including after a failed re-attach. - The output clock starts wherever a reattach result is seeded, so pane reattaches get it too. * refactor(terminal): attach survivors at inventory adoption only; waits on unattached survivors fail at once; one ptyId output clock * test(e2e): scope the restart attach spec's terminal listing to the unopened workspace * fix(terminal): narrow survivor attach: waits behave as on main, one quiet clock per generation, keep main's hidden mark on failed attach * Teach the orchestration guide when to hand off and to end the turn after dispatch * Rewrap a messaging reference line * Keep the original placement default and skill trigger; keep the accuracy fixes * Point DAG retries at --retry-of and drop the last blocking-wait instruction * Check the served orchestration guide by its new worker heading * Apply council review: best-effort wake, full completion rule, restored safety rules, fixed scope and settled wording * Say when the orchestration skill applies, and prefer own subagents otherwise * Name the polling, steering, checkout, and worker fan-out habits to avoid * fix(orchestration): wake a coordinator whose turn ended while its program still reports working Claude Code keeps its OSC 7501 report on working while an agent-teams teammate is alive, even after the lead's own turn ends. The mailbox gate, idle edges and tui-idle all read that report, so worker mail was stored and never typed. A hook turn end newer than the program's working report now counts as rest; hook rows re-classify the PTY so the existing idle edge delivers. Agent Teams panes now join their claude hook rows. * fix(orchestration): compare the lead's own turn end, not the row's receipt A child's hook restamps the row's receivedAt while the lead's turn is still the old one, which could mark rest under a newer program working report. Use the lead's turn-end stamp on this runtime's clock, after the latest input. * feat(orchestration): a consuming check marks the batch it returns as handled * Say why watch scripts and open waits block the wake * feat(orchestration): release settled workers automatically after a grace period * fix(orchestration): use checked row reads for delivery cursors * fix(orchestration): trust a live own-process turn end instead of comparing clocks Drop programActivitySince and the turn-end clock mapping: replays and SSH host clocks made the comparison unreliable. A Claude lead counts as at rest under a program working report when its hook turn end is a live transition from this pane's host and launch, past the existing input and respawn floors. * test(orchestration): drop cast in ack no-op check * test(orchestration): seed legacy outstanding batch for held chat nudges * test(orchestration): built CLI check hands its batch over * test(orchestration): annotate unchanged casts and stub the keep item in tab menu tests * fix(orchestration): let real input, explicit release and host releases converge with automatic release - Record worker takeover at the owning runtime when it accepts UI input, before the bytes reach the PTY. - Run remote attachment releases through the same per-resource single-flight as local ones. - Apply the confirmed-release home projection when host observation reports a host-side release, and carry the host deadline in fleet snapshots. - Prove restart recovery with a file-backed database reopened by a fresh runtime. * test(orchestration): classify the keep RPC's worker fields instead of counting methods * fix(orchestration): checked delivery reads and observer and recovery help * refactor(orchestration): end a check when it hands over a batch; wake rides the wait result * fix(orchestration): refuse an automatic close after real input, join remote releases, converge the home - An automatic close checks the terminal's last driving-input time right before closing and keeps a worker someone typed into after worker_done; typing itself does no orchestration database work. - Remote releases share the per-resource single-flight with local release, so a home worker-release joins the host timer's close. - Host fleet snapshots and federationShow report released and the pending deadline; the home applies the existing release projection inside its observation fence. - Real restart tests: a file-backed database reopened by a fresh runtime releases a missed deadline once and finishes interrupted requests. * fix(orchestration): receipt a shared wake batch on arrival and report the applied Run ack * fix(orchestration): deliver the wake to a working coordinator; agents queue mid-turn input The wake was typed only into a live idle pane, so a Claude lead whose program status stayed working (teammate alive) never got it. Agents queue or steer text typed mid-turn, so a pane takes mail when live idle or working; dialogs, permission prompts, exited agents, unsettled panes and cold-parked Enter still hold it. Drops the held-batch Enter deferral and the per-turn-end hook logic. * fix(orchestration): record each remote release request before joining, publish archives only through the conditional commit - Each remote release caller records its own request before joining a close under way, and the close decides on the current row, so an explicit release that overlaps the host timer clears the automatic deadline. - Remote capture publishes its archive through commitWorkerTerminalArchiveForRelease, so a retain during capture leaves no stale archive for worker-read. - Remote worker-show projects the fenced host deadline and its next action. - The input guard lives in its own module instead of the scheduler. * feat(orchestration): start a worker in one step; worker-start creates the coordinator's Run when none is bound worker-start --spec now creates and binds a Run for a root coordinator with no bound Run, through the same path run-create uses, and names the Run it created or joined in every receipt. Workers on a Dispatch keep starting helpers in their own Run and never get a new one. A new CLI against an older runtime runs run-create and retries; old CLIs need no change. * fix(orchestration): drop the older-runtime fallback; check the spec before a Run is created The CLI fallback matched a refusal text the client decorates, could not prove the caller was a root coordinator on an older runtime, and recovered an inner run-create under the worker-start command. Older runtimes keep their refusal and the guide says to run-create first there. The prompt budget check now runs before worker-start can create a Run. * Route report-back requests to coordinators, complete the steer command, and label the wake loop branches * Say workers are done only when worker_done confirms, wait for helpers to settle, and let bare-shell workers exit * Route report-back requests away from handoff and steer supervised workers through their mailbox * docs(orchestration): teach auto-handled check, retry-request and inbox recovery in the guides * Describe the mid-turn wake in the messaging reference * docs(orchestration): say terminal workers are released 2 minutes after worker_done - The guide's Completion section, the reuse recipe and the recovery reference now describe the automatic release and its autoReleaseAt deadline: reuse or worker-retain before it; explicit worker-release still works and is required for chat workers and workers without a deadline. - The worker preamble says the terminal stays available until Orca releases it, about 2 minutes after worker_done unless retained. - Regenerated the bundled guides. * feat(orchestration): receipts say when to end the turn * feat(orchestration): tell the coordinator when a worker stops without worker_done * test+docs: worker stop reports * fix(orchestration): judge the empty-check stop with execution-host verdicts * test: drop casts from worker stop tests * Say that report-back requests still mean end the turn * Say that report-back requests still mean end the turn * fix(orchestration): stop reports wait for children, keep their Dispatch, and relay intact * fix(orchestration): a stop belongs to the Dispatch active when it was seen; restored stamps announce nothing * fix(orchestration): never say to stop while a remote worker runs * Shrink the orchestration guide to the end-state workflow * fix(orchestration): stop reports quote the agent's last words, or the screen for errors and prompts * fix(orchestration): withhold the stop while chat failure mail is off * test: a clean finish quotes the agent's last words * fix(orchestration): stop asking workers for heartbeats Workers are no longer told to send periodic heartbeats. A heartbeat that still arrives from an older worker or peer only records last_heartbeat_at: it is stored already handled, so it never lands in a coordinator inbox and never wakes a coordinator or a check --wait. Removes the stale-heartbeat warning and the heartbeat interval plumbing that only fed the preamble. * fix(settings): remove the worker heartbeat controls The Worker heartbeats switch and Heartbeat interval field only changed the worker preamble text, which no longer mentions heartbeats. Saved values are dropped on load as retired settings. * fix(orchestration): wake a coordinator that reports program status but never sets a title Program status only re-classified a pane that had a title, so a titleless agent (agy) never got a live status and the wake gate refused it. * fix(orchestration): a new Run no longer cuts a coordinator off from its earlier Run * test(orchestration): drop heartbeat-batch cases the handled heartbeat row removed * fix(orchestration): redact capabilities from a stop report's quoted output * fix(orchestration): never wake a mailbox for a heartbeat One rule at the runtime notification entry replaces per-call-site read checks, so mutation replay and federated control-mail import stay silent for heartbeats too. * Shrink the orchestration references and worker preamble to the end-state workflow * Name the older-Orca bind refusal as worker-start prints it * Owner-fence test: a refused foreign ack changes nothing, whatever the worker's own check already handled * Integration: drop the duplicate consumingCheck after merging #34043 and #35293 * Integration: await the worker-start next receipt before naming its Run * Apply review round 1: drain to zero, release without auto-release, retry after stop, Run before a DAG * Apply review round 2: start ready DAG Tasks, block when no failure wake, replay sends by request ID * Apply review round 3: one receipt-based wait rule for starts and wakes * fix(orchestration): a worker stopped without reporting needs action, and stop keeps its output worker-list projected a stop-reported attempt as live, in_progress, no action. It now projects finished_unverified with a worker-read recovery until mail reaches the worker. worker-stop closed the terminal before anything archived it, so release reported the archive unavailable; stop now archives the output first. * Revert "Owner-fence test: a refused foreign ack changes nothing, whatever the worker's own check already handled" This reverts commit |
||
|
|
527e7082b6 |
Reduce whole-app hitches when many chats are running (#35624)
* Move chat journal checkpoints off the host thread * Apply checkpoint lifecycle style and teardown test checks * Wake journal checkpoints for cleanup writes and retire fixture owners * Use fixed time in attachment checkpoint fixture * Derive checkpoint timer handles and check unref capability * Preserve journal test close completion and event typing * test: await journal close before fixture reuse and cleanup * test: await registered journal fixture cleanup * test: integrate goal sweep fixture with journal ownership * Simplify journal checkpoint worker lifecycle |
||
|
|
a68230334e |
Let automations run in Chat (#34332)
* Let automations run in Chat or Terminal through the shared agent launcher * Preserve automation targets and complete owned terminal lifecycles * Keep stale prompt projection available when recomputing * Count repeated desktop lifecycle resource cleanup * Preserve automation targets and observe committed chat work * Scope automation observation and reconciliation work to each operation * Restore automation server composition and process import boundaries * fix(automations): preserve busy chat reuse and runtime boundaries * Correct shutdown test acquisition and exported measurement types * Correct automation fixture contracts and duplicate imports * Keep Chat automations separate from Terminal execution * Preserve Chat automation intent while support loads * Resolve automation Chat validation diagnostics * Remove unused automation style directives * Make automation surface classes statically inspectable * Move automation surface styling into a toggle group variant * Correct automation launch test receipt and output fixtures * Account for pane and prompt journal reads in delivery test * Preserve admitted automation surface across save effects * Separate automation page test actions from their lifecycle owner * Complete automation route test fixture input * Reopen saved automation chats through the existing record owner * test: isolate session action fixtures and complete tab groups |
||
|
|
67d09d7653 |
feat(cli): open a browser tab in a split pane with tab create --split (#35665)
* feat(cli): open a browser tab in a split pane with `tab create --split` `orca tab create` could only add a tab to an existing pane, so an agent had no way to put a page beside its terminal. `--split <right|left|down|up>` creates a new pane next to the calling terminal (ORCA_TAB_ID), falling back to the active pane, and opens the page there without taking focus. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNtbMA9iVj9T4rBUjn5u6W * refactor(browser): share one type for the tab-create IPC payload The preload listener, its callback, the preload API contract and main's sender each declared the payload separately, and the listener copy had already drifted from the new split fields. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(browser): open the CLI split pane and its tab in one step Creating an empty group and then filling it fails when main owns the layout, because the window's group doesn't exist until main's frame lands. createBrowserTab's split option carries both to whichever owner draws them, so the rollback for a half-made pane goes away. SSH hosts already cannot choose a new tab's group, so their CLI's split is stripped like targetGroupId. * fix(browser): split in the caller's workspace and refuse splits that can't happen A CLI run outside its workspace's directory sends no workspace, so the renderer fell back to the active one and missed the caller's terminal. The caller's tab now picks the workspace when none was named. An SSH host's split and an empty --split= both turned into a plain tab reported as success; both are refused instead. --------- Co-authored-by: Kalvin Mizzi <kalvin@mizzi.com> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
d59d6229cc |
Refresh phone tab streams when capabilities change (#36321)
* Refresh live client projections when connection capabilities change * Skip unchanged tab stream frames on capability change and test the phone socket wiring * Keep Pi status audiences on their opening capabilities * Merge duplicate test import, restore comment placement and cover a skipped capability change * Say which streams read live client capabilities * Mark the tab stream test's runtime stub cast with the casting directive |
||
|
|
c18bf6529b |
test: remove 46 low-value test suites (#36403)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com> |
||
|
|
0a12f82757 |
fix(browser): list browser tabs restored after a restart in tab list and load them on switch (#35563)
* feat(browser): list restored tabs in tab list and load them on demand After a restart Orca restores browser tabs lazily: a tab gets a page only once the user opens it. tab list only reported tabs with a live page, so an agent in a worktree with 26 restored tabs saw one and concluded there were none. tab list now reads the tab bar from the session snapshot the renderer already publishes on every tab change, and reports every tab in tab-bar order. Tabs without a page carry loaded: false. tab switch and tab close --index resolve indexes against the same list, and switching to an unloaded tab loads it in the background first. Waking a page now also waits for its first load to finish, so the next command does not read a blank page. Headless serve keeps every page live, so it lists as before. * fix(browser): list the tab bar even when Orca has no window open With the window closed the app keeps running and its restored tabs still exist, so tab list should report them. Headless snapshots are built from live pages only, and the merge dedupes those, so dropping the window check lists nothing extra there. * fix(browser): list an id held by a live page and a client page once * fix(browser): wait for the first load of a tab headless serve wakes Headless serve starts a restored page and returned at once, so the next command could read a blank page mid-load. It now waits for the first load, as the window path already did. * refactor(browser): keep the tab listing beside the browser tab catalog Main moved the runtime browser commands into runtime/browser/ since this was written. Also drops a window lookup the catalog no longer uses, and corrects the headless note: those snapshots list saved pages that have not started yet. * fix(browser): keep paired-server mirrors out of tab list and close indexed rows like --page A window also publishes the browser tabs it mirrors from paired runtimes, which this host can never load, so the tab bar is read only for workspaces this host owns. tab close --index now closes the listed row exactly as --page does, keeping its worktree, so an unstarted headless tab is retired instead of reported closed and left saved. With nothing active, the first live page is marked current again, matching where a pageless command goes. * fix(browser): wait for first load only on tab switch, and show tab indexes from the listing Every --page command wakes an unloaded page, including the tab show a remote browser pane awaits before streaming, so waiting up to 10 s for the first load there held the stream back. Only tab switch waits now. tab show reports a tab's index from the same listing tab list and close use. * fix(browser): list restored tabs in an SSH host's bridged workspace, and reject fractional close indexes An SSH host's workspace can have no repo row on the desktop, yet its pages render in the desktop window, so the bridge's scoped workspace counts as this host's own. A non-integer --index no longer falls through to closing the active tab. * test(browser): give the restored-tabs e2e's timeout and lease wait their reasons * test(browser): read restored-tabs RPC results through the shared e2e reader Reuses the browser e2e rpc helper instead of a local Reflect.get copy, and types the listing test's snapshot rows. * fix(browser): index tab show in the caller's scope, as tab list does * fix(browser): report an out-of-range close index as browser_tab_not_found Matches tab switch, so agents can recover by re-listing. The restored-tabs e2e now asserts the raw loaded value instead of coercing a missing one. --------- Co-authored-by: fanzzzd <fanzzzd@outlook.com> |
||
|
|
0eaa1f9049 |
test: remove 45 low-value suites (audit 843) (#36396)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com> |
||
|
|
08337d8995 |
test: remove 39 low-value test suites (#36389)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com> |
||
|
|
dd7496be80 |
feat(browser): let agents drive sign-in and payment popups as pages (#36253)
* feat(browser): let agents drive popup windows like OAuth sign-in as pages window.open popups that keep their opener stay native windows, but the agent bridge now lists each one in tab list as popup-<n> with its opener, so --page, tab switch and tab close reach it. When a popup the agent switched into closes, its next command lands on the opener. * fix(browser): reach popups over SSH, through the Electron sidecar, and by implicit tab close * fix(browser): keep sidecar popups ordered after tabs and handing back to their opener * fix(browser): skip the tab wake-up wait for popups and keep the agent's claim when a popup hands back * fix(browser): refresh the opener's claim on hand-back and settle tab close after the popup is gone * refactor(browser): share routing retarget and idle-window helpers for popup hand-back * refactor(browser): move popup routing helpers into bridge state to keep tabs under its line cap * test(browser): expect the popup's url and title in its snapshot result |
||
|
|
dcaeaaa1fc |
feat(browser): typed snapshot flags, screenshots saved as files, and a guide that keeps browser work in Orca (#36257)
* feat(browser): typed snapshot flags and screenshots saved as files for agents orca snapshot takes --interactive, --compact, --depth, --selector, --urls, --delta and --full, passed to agent-browser on every route. The header now shows the page title and URL. orca screenshot and full-screenshot save the image where the CLI runs and print its path, in CSS pixels, with --if-changed and --annotate. Flag help for exec, wait and download is written for those commands, and the orca-cli guide sends web pages to Orca's browser unless the user picked another tool. * fix(browser): scale screenshots by the scrollbar-free axis and keep snapshot metadata behind SSH admission * fix(browser): upscale low-DPR screenshots and wrap a torn-down tab's screenshot error * fix(browser): give each screenshot its own file and keep typed screenshot errors * refactor(browser): share the agent-browser screenshot reader between Electron and orcad * refactor(browser): move snapshot and screenshot params under the line cap |
||
|
|
d3595c3304 | feat(browser): agent browser actions report what they caused (#36278) | ||
|
|
34f173bb88 |
test: remove 40 low-value test suites (#36336)
* test: remove 40 low-value test suites * test: preserve historical reliability command mapping --------- Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com> |
||
|
|
5a925965d5 |
fix(git): compare staged renames against their HEAD source (#34779)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com> |
||
|
|
d1aff3a5be |
fix(git): fence WSL login-shell stdout for all buffered git reads (#35053)
Buffered gitExecFileAsync reads now always fence login-shell rc output, and non-zero exits de-fence error.stdout. The per-call captureWslLoginShellOutput opt-in is removed since it is no longer meaningful. Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com> |
||
|
|
5c2bfed948 |
fix(browser): find a hidden tab on the first agent command after a window reload (#36307)
* fix(browser): find a hidden tab on the first agent command after a window reload Right after a renderer reload, the first agent browser command on a hidden tab failed with browser_tab_not_found. Main sent browser:activateView before the reloaded renderer had restored its tabs, so nothing mounted; and the bridge reused the page's agent-browser session bound to the guest the reload destroyed. Wait for the main window's existing readiness signal before activating a hidden tab, and retire a session whose guest changed. agent-browser answers `close` and exits ~100 ms later, so destroySession waits for the old daemon's socket to go before the session name is reused. * test(browser): read the replacement proxy's guest from its constructor call |
||
|
|
cf5f427d43 |
Keep worktree branches unless CLI deletion is requested (#35948)
* Keep CLI-removed worktree branches unless requested * Bind branch policy checks to removal connections * Remove redundant local default removal test row * Negotiate worktree branch policy on the mutation connection * Fix removal integration compiler boundaries and type imports * Use checked annotations in paired removal fixtures * Reset CLI integration exit status across test runtimes |
||
|
|
e9be993f47 |
cli: add orca plugin dev load/unload/reload, list, logs, enable and disable (#36288)
* cli: add orca plugin dev load/unload/reload, list, logs, enable and disable * cli: move plugin handler groups out of the manifest |
||
|
|
756d623955 |
perf(terminal): bound the in-process macOS process table's blocking calls and ps fallbacks (#31783) (#36282)
* fix(terminal): bound the in-process macOS process table's blocking calls and ps fallbacks (#31783) Follow-up to #35987 from its post-merge reviews. - cwd and executable path: node-pty's readProcessCwd/readProcessPath now run PROC_PIDVNODEPATHINFO and proc_pidpath on a libuv worker (the synchronous exports are gone, so an older pty.node falls back to ps/lsof). JS caps them at two outstanding lookups and 250ms; a wedged mount or a full cap answers from lsof -b, which never stats, so a dead NFS/SMB/FUSE mount cannot freeze the daemon's event loop or take the whole pool. - Unreadable argv prints "(comm)", as ps does, instead of a proc_pidpath lookup under Orca's credentials on the table worker. - The table exports each row's euid. Argv recovery runs setuid ps only for another user's processes, never for our own mid-exec or exiting ones (or SIDL/exiting rows), which ps cannot read either: a pane looping short commands forked ps on ~15% of full reads, now none. - Recovery is coalesced per process across concurrent readers and a failed recovery waits 5s before costing another ps. The cache keys on comm and start time. - Full-table and shell-foreground captures, which feed strict evidence with the capture's age, take only argv ps read after their request; display readers keep the 30s cache. - While the reader is down (stalled-pool breaker open, or a rejecting addon, which now backs off 1s..30s), runPsInProcess runs /bin/ps itself through one shared budget: identical invocations share a run, a burst of 4 forks then one a second, and a run spawned before a request never answers it. Descendant teardown and foreground-group signalling keep their own full-timeout ps (callerRunsPs). 13 pollers at 750ms: 1,040 ps/min before, 63 after. No daemon protocol bump: the wire format is unchanged, and each daemon loads JS and pty.node from the same runtime copy. * fix(terminal): make the libproc reader survive worker teardown, fail closed and share one fair fork budget (#31783) Review follow-ups to the previous commit. - Native: every libproc AsyncWorker derives from OrcaPromiseWorker, which skips JS completion once an env cleanup hook marks the env closing and swallows a Napi::Error thrown mid-teardown. Terminating a worker_thread with cwd or table reads in flight aborted the process; 200 terminates each now survive. - (comm) in a terminal's foreground group (argv neither reader recovered, e.g. a root `su`) judges 'unknown', never 'agent', so the launch line is not typed into it. - Fresh argv only for getFreshSnapshot captures; the 500ms TTL readers keep the 30s cache. Argv recovery runs through its own fork budget (2, then one per 2s). Root `su` pane, 13 pollers at 750ms: TTL 79 -> 2 ps/min, fresh 158 -> 31. - The fork budget serves invocations in FIFO turns, grouping each one's waiters onto one run. 13 streams: served 80,42,1,1,2,0x8 -> 10-12 each. - Forced subprocess captures (a held naming pass) go through the fallback budget: 5 readers, 400 direct ps/min -> 63, 395 of 400 captures served. - A failed recovery is retried 5s after ps gave up, not after it started. - Tests pin Orca's euid instead of reading the runner's and assuming root is 0. - process-cwd keeps one lsof per pid until it exits, so a dead mount no longer leaks one per poll; shell readiness reads the exe path through runProcess, which gives up on an lsof that ignores SIGTERM. - A #35987 pty.node (table reader, no async path reads) keeps the in-process table; cwd/path use lsof, with a one-time warning. - captureProcessTable moves to process-table-ps-capture.ts. * fix(terminal): make withheld argv unverifiable and reuse recovered argv for at most 2s (#31783) Round-2 review follow-ups. - Worker teardown: drop OrcaPromiseWorker and its env flag (Node drains the pool before cleanup hooks, so it never fired). node-pty's mac pty target now builds with NODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS, which covers both the call-in and completion paths. The smoke test now calls the reads from a timer while terminating: the previous build aborted 2 of 3 runs, this one survives 3/3 x 100. pty.cc is back to the first follow-up's exact content. - A foreground process whose argv ps withheld (`(comm)`: another user's, exiting, or a recovery the budget skipped) makes the batch resolver, and so host-stamped evidence, `argv_unreadable`/unverifiable rather than live with no agent; agent-foreground resolution reports it unavailable. - judgeTerminalForeground fails closed only for an unreadable shell (`(bash)` from a root `su`), not our own exiting `(git)`. - Recovered argv is reused for at most 2s per identity (pid, start, comm) for every reader (the next commit ages evidence by it), and fresh reads no longer queue behind the recovery budget. Root `su` pane, 13 fresh pollers: p50 2,989ms -> 53ms, 31 -> 26 ps/min (TTL reader 1 -> 26). - The fork budgets serve interactive and fresh readers before display polls (cheap and TTL snapshot captures), FIFO within each. 20 display streams plus a 3s launch-paste read every 5s: 0/12 -> 12/12 served, polls 4-7 each. - On a selected terminal, the foreground group's argv is recovered even with no process of ours left (`exec su`); the root login is not. - Budgeted captures keep the 32 MiB output ceiling. * fix(terminal): age strict evidence by its oldest recovered argv (#31783) Round-3 review follow-ups. - Recovered argv carried no read time, so a capture reusing it (cached, or a recovery still in flight) stamped its own capture time over argv up to 2s older, and the remote write guard could take a same-comm re-exec for the agent. Rows now carry when ps read their recovered argv; runPsInProcess reports the oldest through onArgvReadAt, and the snapshot reader stamps capturedAtMs at that input, so capturedAgeMs is the age of the oldest input and consumers' own freshness checks (the write guard's 500ms) decide. A recovery begun more than 2s before a reader asked no longer answers it, and an older recovery finishing late cannot replace a newer one. - resolveSpawnFileForegroundFromRows reports a withheld `(node)` foreground unavailable. - One budget queue entry per invocation: an interactive request promotes a queued poll's, a poll joins an interactive one. - parseShellForegroundRows gets its JSDoc back. * fix(terminal): keep a cached name from authorizing a refused write; integer, under-2s argv ages (#31783) Round-4 review follow-ups. - When the relay's evidence declines a write (stale, unverifiable, another agent), its foreground name may still prove the shell but no longer proves the agent: that name can be the tracker's 1s display cache, e.g. `claude` cached just before Claude exited to a root shell under su. Relays that send no evidence keep the name as before. - Snapshot ages round up to whole milliseconds; the wire rejects fractions from the monotonic-to-wall conversion. - Recovered argv is reused for at most 1.5s, so reuse plus the 500ms snapshot cache stays under the 2s freshness gate; reuse ages from when that ps spawned, not from the wait for its fork token, and only an answer is remembered (a timed-out or withheld run proves nothing). Fork budget unchanged. Root su pane, 13 pollers: 30 ps/min; fresh p50 51ms; strict evidence age p50 752ms, max 1,508ms. * fix(terminal): keep the relay's agent name behind structurally unverifiable evidence (#31783) The previous commit refused the name fallback whenever the relay sent any evidence, so `unverifiable` evidence for structural reasons also blocked writes: npm Codex (node codex.js spawning native codex) and Gemini (relaunching itself) put two agent rows in the foreground group (ambiguous_foreground_group), and remote tmux reads multiplexer_boundary. On SSH POSIX hosts that dropped launch prompts and failed worker briefs, conversation send/cancel and automations with agent_not_in_foreground. The name now cannot authorize only when the evidence saw the group (`live`: stale, or no agent in it, as in the cached-`claude`-over-root-shell repro) or withheld a foreground argv (`argv_unreadable`, possibly a root `su` shell). Other unverifiable reasons keep the name fallback, as before this branch. * fix(terminal): let a relay name complete only fresh agent-positive evidence (#31783) The SSH name fallback still let a stale or cached name authorize a write under any unverifiable reason but argv_unreadable: ps EAGAIN (process_table_unreadable) after the tracker cached `claude` over a root bash, anchor_missing, tty_boundary (`sudo -i` with use_pty, a root shell on a new pty), or a 1.5s-old ambiguous capture. - The name now completes evidence only when it is fresh (within the guard's 500ms bound), its reason is one that saw an agent row (ambiguous_foreground_group, multiplexer_boundary, candidate_start_time_missing), and the name is the launched agent. Every other reason, including ones this build does not know, reads unknown. Relays that send no evidence keep the name, for mixed versions. - The relay's evidence names one agent that holds two rows of the group (npm Codex: node codex.js spawning native codex; Gemini relaunching itself), so a new relay proves them live even when its name is `node`. Two different agents stay ambiguous. No wire change. * fix(terminal): judge a relay name by the host's capture age; keep old relays' npm Codex (#31783) - Name completion compared the capture's start with the read's start, so a slow response made old evidence look fresh: a capture 1,500ms old arriving after 1,100ms passed. It now uses the host-reported capturedAgeMs against the 500ms bound, which latency cannot shrink. Live evidence keeps its capture-start rule. - Relays before same-agent dedupe report npm Codex (node wrapper plus native binary) as ambiguous_foreground_group and name it `node`. For that reason only, `node` now completes the evidence when the launched agent is npm-installed per the node entrypoint tables; other agents and reasons stay fail-closed. * fix(terminal): bound relay-name completion by twice the snapshot TTL (#31783) The 500ms bound refused ~9.5% of tmux name completions on a host with 13 pollers (cached snapshot up to one 500ms TTL old plus ~30ms capture, max 528ms), and a refusal drops the launch prompt or throws with no retry. The bound is now 2 x PROCESS_TABLE_SNAPSHOT_MAX_STALENESS_MS (1s), still on the host-reported age: 0 of 767 reads exceed it, the delayed 1,500ms repro still refuses, and the cached-name hazard (the tracker's ~1s display cache) is no wider. * fix(terminal): complete relay evidence with a name read now, not the display cache (#31783) With the 1s bound, a capture at 0-528ms, `codex` cached at 100ms, Codex exiting at 101ms and the guard at 999ms still let the cached name authorize a write over the bash that replaced it. - Name completion (structural reasons, host age within 2x the snapshot TTL) now asks confirmForegroundProcess, which reads the foreground now (a fresh scan, or node-pty's raw process name) rather than the tracker's 1s display cache; a null answer reads unknown. No new wire surface: the local daemon answers confirmForegroundProcess, paired runtimes evaluate guards locally, and the production controller returns null (read as unknown, failing safe) when a provider lacks it. Controllers without the method, and relays sending no evidence, keep the cached name as the legacy path. - Live evidence also accepts a host-reported age within 2x the TTL, so a real agent behind a 500-528ms cached snapshot on a fast link is no longer refused; a capture begun after the read was asked still counts, and 5,000ms-old evidence still refuses. * fix(terminal): confirm live evidence older than one snapshot TTL with a fresh read (#31783) Accepting live evidence up to 2x the TTL reopened the window the previous commit closed for name completion: a capture at 0-528ms, the agent exiting at ~529ms, and at 999ms `live claude` still read as agent over a bash. Live evidence begun no more than one TTL before the read was asked (so any host age within one TTL, however long ps took) still answers alone. Between that and 2x the TTL, confirmForegroundProcess reads the foreground now: the launched agent proves it, a shell reads shell, anything else unknown. Controllers without that read fall through and refuse, as before. Reachability: the remote (host.remote) write-guard path has no production caller since the SSH provider's removal (#27499); the registry dispatches only local providers and paired runtimes evaluate guards locally. This is defence in depth for any future remote provider. |
||
|
|
4410ef318e |
fix(browser): let agents and users answer page alert, confirm and prompt dialogs on their page (#36268)
* fix(browser): let agents and users answer page alert, confirm and prompt dialogs on their page * fix(browser): watch a replacement guest for dialogs and ignore the opening keypress * fix(browser): ignore a repeated Enter in a guarded prompt field |
||
|
|
9470b4618c | plugins: require an explicit approve fingerprint for RPC plugin grants (#36279) | ||
|
|
46595532b9 |
fix(pi): use discovery for shared model menus and defaults (#36194)
* fix(pi): keep the last good model list when discovery fails * test(pi): allow void-returning catalog close mock * fix(pi): make discovery own account model menus and defaults * test(pi): align prewarm recovery with discovery ownership * refactor: compact catalog default entry construction |
||
|
|
28e4764cdd |
Keep existing Continue actions reliable after agent exit and failed starts (#36074)
* Fix lifecycle handling for existing Continue actions * Preserve legacy import and owned Windows cleanup * Match pending creation membership contract * fix(continue): align sweep and imported source contracts * Combine terminal claim type imports * Classify own-property checks as layout reads * Report pre-spawn failure in WSL cwd fixture * Load saved CLI history without a retained source row |
||
|
|
0b2158a394 |
fix(wsl): name the stopped distro, in the user's language, when main holds a terminal start (#36228)
Worktree-create startup, setup and initial terminals built their warning from the raw terminal_held_wsl_distro_* code, and the window showed it as is, as it did for a held pane recovery. Main now writes the readable sentence into those warnings, and the window swaps either form for localized copy naming the distro. The runtime spawn's hold and its wslBackgroundStart option now share one verdict. |
||
|
|
8aac9c1254 |
test: remove 28 low-value test suites (#36226)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com> |
||
|
|
067a0dd1b4 |
fix(runtime): delegated devices follow the device file, and quarantine keeps external adds (#36222)
* fix(runtime): plan delegated children over the device file as it is now An unchanged child removed on disk skipped the save and its merge, so its stale token was handed back. The upsert now adopts external edits first and mints a fresh child; a parent removed on disk mints none. * fix(runtime): a delegated phone stops authenticating once its desktop is gone Removing a desktop's row on disk (or any removal short of revokeRuntimeAccess's cascade) left its delegated phone rows valid. Token and per-request principal auth now refuse a delegated child whose parent device is no longer in the registry. * fix(runtime): keep devices another writer adds while our own quarantine is unwritten While quarantinedUntilWritten is set, the save no longer skips the disk read; it merges with no known baseline, so the file's absence revokes nothing but a device the pairing CLI added since is kept. |
||
|
|
bf3e7ed405 |
Show a card in the coordinator's chat when it starts a worker (#35263)
* Snapshot agent message relations and verify task display prefixes * Show native chat agent messages in navigable cards * Keep agent message cards derived from canonical input and sidebar state * test: correct agent card contracts and cover raw queue editing * test: repair agent card runtime and operation contracts * fix: preserve queued image previews and typed test measurements * fix: use checked worker fixture and owned sender button typography * fix: complete agent card fixtures and native presentation * test: preserve queued edit exports and current authorship * test: use namespace type imports in queued edit fixture * Show newly started workers in native chats * Preserve sender progress and consolidate card contracts * Simplify sender and notice contract instrumentation * Remove duplicate sender and notice measurement mirrors * Use a template literal for the dispatch boundary fixture * Correct sender and notice verification phase accounting * Consolidate agent message tests around user contracts * Restore folded agent message preview on focus exit * Consolidate agent message regression coverage * Consolidate agent message fixture data * Fix display text test lint diagnostics * Use conversation view type for mail test records * Reuse active copy control in card workflow test * Use fixed timestamp in worker start context fixture * Count fixture array reads without reflective access * Use a typed store in runtime state fixture * Fix worker card fixture types and CLI transport project includes |
||
|
|
dc99281085 |
feat(source-control): resolve merge conflicts and complete merges from the phone (#36160)
* feat(source-control): resolve conflicts with one host operation shared by desktop and mobile * feat(mobile): resolve merge conflicts and complete merges from Source Control * test(mobile): pin Complete merge refusals and the older-desktop message * fix(source-control): only resolve paths Git still reports as conflicted * fix(source-control): refuse to keep a missing file and serialize conflict resolution per worktree * fix(source-control): resolve only the exact conflicted path * fix(source-control): match conflicted paths in Git's separator form on Windows and WSL * fix(source-control): accept only the resolutions the live conflict offers * fix(source-control): refuse to keep a both-modified file that is gone from disk * feat(mobile): translate the merge conflict actions * test(runtime): keep the mobile allowlist test under its line cap * fix(mobile): let VoiceOver reach conflict action buttons |
||
|
|
5cf3a8256e |
Let sidebar card properties hide agent model badges (#36026)
* feat(sidebar): let card properties hide agent model badges * Disable model visibility control until preferences load * Register model label and separate WSL test projects * test: complete serialized WSL routing fixture * test: align legacy row snapshots with model badge token * refactor(sidebar): colocate compact card reveal helper |
||
|
|
1ed54cf4b5 |
fix(mobile): restore alerts without native push (#36125)
* fix(mobile): restore alerts without native push * test(mobile): refresh notification reply matrix |
||
|
|
6b937c7e5f |
fix(source-control): resolve delete/modify conflicts and complete merges from the panel (#35347)
* fix(source-control): resolve delete/modify conflicts and complete merges from the panel * fix(source-control): address review findings on conflict resolution * fix(source-control): save every view of the file before marking a conflict resolved * fix(source-control): match unsaved conflict views by physical file only * test(source-control): prove completeMerge refuses with a commit template set * refactor(source-control): reuse autosave view matching and refresh only after a completed merge * fix(source-control): drop the untranslated Complete merge fallback text * fix(source-control): refuse Keep file when the file is gone and re-read unsaved views on retry * fix(source-control): let Keep file stage conflicted symlinks with missing targets * fix(source-control): run one conflict resolution per file at a time |
||
|
|
b578e3012e |
fix(pi): the thinking menu before the first message matches the chat's (#34592)
* fix(pi): the thinking menu before the first message matches the chat's Pi's pre-session catalog now asks Pi for its models over RPC and builds each menu with the same projection a running chat uses, falling back to the text listing only when Pi cannot answer over RPC. * fix(pi): preserve remembered off effort on precise model lists * test(pi): focus effort regression and stop fallback contracts * test(pi): allow metadata reads between ordered option writes * fix(pi): derive supported effort without replacing accepted intent * test: cover host effort projection and refreshed frozen queues * test: consolidate session option imports * test: normalize absent catalog fixture records * test: isolate host fixture types from client projects * Preserve legacy effort capture for other agents |
||
|
|
ddd4518d7d |
Stop the saved chat status writer from remembering every closed chat (#36105)
* fix(native-chat): stop the saved-status writer from remembering every closed chat The writer deduped turn-edge writes with a per-chat memo that was never cleared, so a long-running app kept one entry for every chat it had ever shown. Dedupe against the saved record instead, holding only edges whose write is still in flight; a reopened chat still skips an edge already saved. * test: cover settled chat status writer retention * test: simplify saved status retention contracts |
||
|
|
b187d55e15 |
fix(computer-use): cap every macOS permission helper launch path at one per 5 s (#34390) (#36150)
* fix(computer-use): replace the macOS permission status gate with one 5s launch floor (#34390) Follows up #36028. The earlier gate grew background/explicit flags, epochs, backoff and a setup pgrep path that reviewers could not make correct. - Status: one probe at a time and one 5s launch floor shared by every reader, so every path stays at <=12 helper launches/min. Readers inside the floor join the running probe or ride one trailing probe that fires only if someone waits. Only grants are cached (until the floor expires); denials and errors are never served, so a grant shows within one floor locally and on web. No app epochs: without a denial cache they bought nothing. Off macOS the gate is skipped. - Setup: one launch per 5s across every permission, claimed synchronously; a request inside the window is queued (latest wins) and reported as launchQueued. Kill-and-relaunch stays so a click always re-shows the helper. Setup reuses the gate's in-flight/cached/last result instead of probing. - Reset checks helper availability from the bundle and invalidates after any tccutil attempt, including partial failures. - Remove the background flag from preload/IPC/renderer/web, the app-activity binding, and the sidecar permission_denied invalidation. * fix(computer-use): close the remaining gaps in the permission launch floor (#34390) - Clear the trailing timer whenever any probe launches and re-check the floor when it fires, so a late timer can never launch inside the floor. - Setup reuses a denial only until the floor expires. - A reader that joins a probe older than 300ms and gets a denial rides the next probe, so a grant shows within about one floor even after a stale web/RPC probe. - Setup requests are numbered on arrival, including ones that coalesce, so the latest request wins (A, B, A launches A); a queued launch already covered by a newer launch is dropped. Reset and will-quit cancel any queued launch. - The settings pane says "Opening…" and the CLI says queued for queued launches. * fix(computer-use): measure permission launch floors from real spawns and cancel setup on every host (#34390) - Both 5s floors use performance.now, so a wall-clock step cannot stretch or skip them. - The status floor counts from the later of claim and the actual `open` spawn, and the setup window from after its spawn, so a slow mkdtemp or pkill can't allow a 13th spawn in a 60s window. - Setup cancellation registers through AppEnvironment quit handlers (desktop, headless Electron serve, orcad) and orcad's shutdown trigger; reset and shutdown bump a generation so an Open still waiting on status never launches. - Reset cancels queued setup before its first await. - A setup request leaves the coalescing map when it launches, so a later request for the same permission queues and wins (latest-wins across microtasks). - A failed probe clears the remembered denial. * fix(computer-use): drop setup coalescing and gate setup on a host-wide shutdown flag (#34390) - Remove the per-permission setupInFlight map. Every Open goes through the 5s window and seq-ordered queue; a queued request with the same args that arrived before the last spawn was already shown by it, so concurrent same-permission Opens still spawn once. This fixes stale entries after reset turning the next Open into a no-op or a cancelled one. - A cancelled Open (reset or shutdown) rejects with an error instead of returning launchedHelper: false, which every client rendered as "setup complete". - Replace the per-host cancel calls with src/main/host-shutdown-state.ts, set synchronously by Electron will-quit and orcad's shutdown admission; setup checks it before every spawn, including the queued timer. - Track the status cache's expiry from the probe that produced it, so starting a new probe cannot revive an expired grant. - The queued setup timer re-checks its deadline and re-arms when early, and both timers round delays up; a throwing spawn there is logged, not uncaught. * fix(computer-use): keep setup latest-wins after slow probes and surface cancelled setups (#34390) - Record the launching request's seq; an older request that resumes or is queued after a newer one spawned is dropped, so latest-wins holds when requests resume out of order behind a probe. - orcad sets the host shutdown flag on every cleanup entry, including failed startup. - The web facade only falls back for hosts without computer.permissions; other failures, such as a cancelled Open, reject so the pane and onboarding show them. - The cancellation check runs before an untargeted Open can report everything granted. - Opens that arrive mid-reset wait for it, so reset's helper cleanup cannot kill what they open. - Queued wording now says a newer request or a reset may replace it. * fix(computer-use): wait out a reset before an Open reads permission status (#34390) |
||
|
|
17a681b8f8 |
Suppress agent CLI updates for unattended automation launches (#36133)
* fix: suppress CLI updates for unattended automation launches * fix: preserve updater suppression precedence and host launch expectations |
||
|
|
a874ff9d76 | fix(relay): diagnose desktop clock drift (#36139) | ||
|
|
12f9f8175c | fix(mobile): hide handles for unavailable terminals (#36135) | ||
|
|
fee06ab9c3 |
test: remove low-value test inventories and wording fences (#36114)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com> |
||
|
|
f9a21bcfff |
test: remove redundant schema,registration,compact and language mapping cases (#36075)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com> |
||
|
|
ab674d13e5 |
test(sidebar): drop the wall-clock urgent-publish timing test (#36054)
The 20ms real-timer assertion flaked under CI load (21ms on #35949). The fake-timer test above it already proves the urgent write publishes within one microtask while a scan is held, so the timing copy added no coverage. |
||
|
|
6f99d480b3 |
fix(agents): stop a foreign agent name in task text from taking a pane (#19309)
* refactor(agents): extract the title name-anchoring vocabulary Pure move, no behaviour change. The name tokens, display labels and the bare-name/whole-title resolvers come out of agent-title-evidence.ts into agent-title-name-anchoring.ts so more than one predicate can resolve a name to an agent through the same implementation rather than by convention. Nothing is added or reworded on the way out; the extracted functions are unchanged and simply exported. Verified by the existing suites: the title, identity and sidebar tests all pass untouched. The identity ratchet moves with it — titleHasAgentName's two parser-implementation callsites now live in the new module — so this commit is green on its own rather than leaving the ratchet red until the next one. * fix(agents): stop a foreign agent name in task text from taking a pane A Claude pane's WORKING title is a bare braille spinner plus task text, so any agent name inside that text resolved the title to a committed foreign identity. The guard that fixed the mirror-image bug was written for the Claude label only, so every other name short-circuited above it and took the pane from its owner — the tab icon in use-tab-agent.ts, and the sidebar/dashboard row in worktree-title-derived-agent-rows.ts, which never consulted the owner at all. Make the rule agent-neutral in both directions: a title may only take a pane from a known owner when it PRESENTS that agent, never when the name merely occurs in free-form task text. titlePresentsAgent sits beside collectAgentTitleEvidence and resolves names through the vocabulary they now share. It differs from the parser in one respect: the parser asks who a title names given no owner, so it must refuse anything a task sentence could forge; this predicate is told which agent to check, so it also accepts that one name in an identity POSITION — the whole undecorated remainder, or the head of a `Name:` frame. The colon is what separates `Codex: fix cursor offsets` from `Claude Code compare Opencode`. resolveTabAgentFromSignals exists twice, already drifted in owner handling. useTabAgent calls the copy in use-tab-agent.ts, which is what paints the tab icon; every existing test imports the copy in tab-agent-from-signals.ts. Both are fixed, and the new suite runs its whole contract through both so a future divergence fails instead of hiding. * fix(agents): let the title label map admit a missing label Narrowing the map's value type to TuiAgent surfaced an inaccuracy that was always there: noUncheckedIndexedAccess is off, so indexing Record<string, _> types every lookup as a hit, and `label` is arbitrary text parsed off a terminal title. The compiler concluded the `?? 'unknown'` fallback was unreachable and the unknown-label comparison impossible. The runtime disagrees — the map carries a fixed set of ~10 labels and misses everything else. Deleting the branch would return undefined where the function returns 'unknown' today, so the type is what is wrong. Partial<Record<...>> makes absence expressible and leaves behaviour unchanged. Pinned by a test, since nothing else forced the map to be honest about this. * fix(agents): let an agent's own sigil still present it against an owner titlePresentsAgent read only anchoredNames, so it missed the evidence class the parser ranks highest: a vendor marker, the sigil an agent emits itself and task text cannot forge. Gemini's four glyphs and Cursor's native literal are markers, not anchored names, so every Gemini working, idle and permission title — and Cursor's literal — failed the gate and the pane stayed on its previous owner. Run Claude, let it finish, run gemini in the same pane: tab and sidebar both stayed Claude. The bug this change exists to fix, mirrored. Admitting the whole vendor class would have reintroduced #8940 the other way, because Claude's '. ', '* ' and idle sigil are generic — OpenCode emits them too — so they prove activity, not identity. hasGenericClaudeStatusPrefix already modelled that distinction inside terminal-title-agent-type.ts; it moves to agent-title-core.ts so both callers share the one definition. Not isGenericClaudeStatusClaim, which is that model plus a clause for a different question: it treats a 'claude' token as upgrading a generic prefix into a real claim, which is right when asking whether a title may MINT Claude identity and wrong when asking whether it PRESENTS Claude. Applied here it would have let ". port the claude prompt" reclaim an OpenCode pane. The predicate is now one memoized set per title rather than a memoized first line and an uncached scan, so the common path — a title presenting nobody — no longer re-runs the name matchers over every wrapper segment on each render. * fix(agents): gate on one identity-frame grammar, ratcheted against the corpus Two review rounds found the same class of defect: the gate was a second model of "does this title present an agent", poorer than the model its callers use. Round 1 missed an evidence class, round 2 missed four whole ROUTES in a different function. A third patch would have bought the fifth route. getAgentLabel mints identity through routes the evidence parser cannot express, because titleHasAgentName asks whether a name occurs ANYWHERE and never where. One Codex branch therefore serves both 'codex working' and the mid-sentence mention this change exists to reject. Route identity cannot separate them; the gate genuinely needs position information the resolver discards. So the models cannot be collapsed. What they can be is one GRAMMAR plus an enforced agreement: agentForIdentityFrame generalizes what isClaudeIdentityFrameSegment has always described — a name, an optional status word, an optional '- action required' — which was agent-neutral in shape and applied only to Claude. That was the same one-way-guard mistake as the original bug, one level down. Generalized, it covers every minting route: bare names, 'Codex: ...', em-dash frames, name plus status, Windows launcher forms, '|'-headed titles and Pi's native format. The positional and vendor-marker rules fold into it rather than stacking beside it. terminal-title-pane-claim-corpus.test.ts is the enforcement. It sweeps the whole classification corpus, and any title getAgentLabel still mints an identity from must remain able to claim a pane. Shared code cannot enforce this because the two models legitimately differ; the corpus can, and it names the offending title when a future route is added. Corpus: 14 lost claims before this commit, 0 after. One intended gain, 'claude.bat working', listed and explained in the ratchet: the old gate accepted 'aider.ps1 ready' for aider and refused the identical form for Claude purely because the guard was Claude-only. * fix(agents): stop reading a wrapper prefix as an identity frame The head grammar treated '|' as a separator an agent puts after its own name. Wrappers PREFIX the pane's title and the innermost title comes LAST (terminal-title-wrapper-segments.ts), so a name before a '|' is a tmux window or an ssh host, never the pane. `claude | zsh` on a Codex-owned pane therefore handed it to Claude through all three consumers — this change's own bug, inverted. Wrapper-joined titles already reach the real pane title through getEvidenceTitleSegments' suffix splitting, which is what actually resolves `ssh host | opencode ready`; the separator was not carrying that case. '>' goes too. Pi's native `π > session` is matched before the head grammar runs, so the only titles it affected were `name > text` breadcrumbs, which are closer to task text than to an identity frame. That narrows `⠋ gemini > next steps` and `⠋ codex > plan` relative to the previous gate; both are pinned as intended rejections, since refusing leaves the pane with its known owner, which is the safe direction on ambiguous evidence. The corpus gain assertion is renamed to say it is corpus-scoped. Over every string literal in the repo the change gains more than the one title this 67-title corpus can see, mostly the same Claude symmetry, and the test should not read as a global guarantee. Near-misses the grammar deliberately accepts are pinned too, so the boundary is visible and moving it requires editing a list. * fix(agents): admit identity frames before trusting terminal titles * fix(agents): separate title identity from readiness policy * Preserve title frame boundaries and normalization identity * Preserve activity token whitespace at title wrapper boundaries * test: expose typed mailbox idle evidence source * test: scope title projection work contract to renderer * test: distinguish task activity from agent identity --------- Co-authored-by: Merge Sim <sim@local> |
||
|
|
2e38249a7d |
Keep a chat's accepted model options in what it shows and sends (#31208)
* Keep a chat's accepted pick in what it shows and sends A pick held while a new chat is created is committed into the chat's active option record once accepted, through the same step a normal pick takes, and older options reads are dropped. The host also publishes the chat's saved effort, Fast and speed as optional status fields so another device's pick moves the option stamp and re-reads options. * Keep chat picks ordered and capture displayed send selection * fix: keep chat choices in one controller with accepted input capture * fix: pass captured Codex model input to the turn request * Keep structured chat option pickers usable during turns * Preserve logical selection ownership across runtime transitions * Consolidate selection lifecycle contract coverage * Consolidate mobile structured send imports * Preserve legacy action outcomes and opening message identity * Consolidate repeated selection test setup and assertions * Fix option reset admission and preserve uncertain write notices * fix(chat): complete option contract fixture types * test(chat): place affinity integration in cross-layer suite |
||
|
|
e8e0803672 |
fix(wsl): hold main's background WSL start before the cwd probe; let the user's runtime start check a WSL folder (#35971)
* fix(wsl): hold main's background WSL start in the shared preflight; folder launch scope honours the user's act Main's background start (no wslUserAct) is now held in resolvePtySpawnStartupTarget, before the startup cwd probe and any provider. A runtime start the user asked for (CLI, window, phone, split) checks a WSL folder workspace's path as their act, so it may start the distro; background work is refused with the stopped-distro message instead of folder_workspace_path_unavailable. * fix(wsl): agent-session create and user resume check a WSL folder as the user's act; background holds with Start * fix(wsl): agent-session ensure and a failed start's kept pane pass the user's act to the WSL folder check * test(e2e): a prepared terminal.create dedupes as the caller's act |
||
|
|
e08cb10cc6 |
Prevent resting chats from delaying native command menus (#35069)
* Scope native chat command discovery to menu demand * Fix command discovery CI imports and test timing * fix: recover demanded command menus after context retirement * test: load command host fixture before mocked consumers * test: retain eager cache reads across command expiry * test: cover command recovery after pending deadline * test: count demanded command renders and query isolation * test: load mobile command host fixture during collection * test: type command batch fields from subscribe events * test: check command event arrays without assertion * Fix command discovery fixture project boundaries * Name command fixture mocks with public Vitest types * Assert opening metadata on resumed session snapshots * test: assert passive command population boundaries * test: cover mobile command capability handoff * test: correct capability proof scope adapters |
||
|
|
e69baa3499 |
fix(linear): stop writes when their caller lifetime ends (#35020)
* fix(linear): bound write preparation and mutation to one caller lifetime * fix(linear): isolate cancellable preparation from shared reads * test(linear): keep CLI lifetime coverage in its compiler project * fix(linear): preserve comment change failure guidance * test(linear): place CLI and runtime coverage with integration tests * test(linear): reset CLI exit status across runtimes * fix(linear): preserve truthful confirmation deadline causes * test(linear): support renamed workspace selector in fixture * test(linear): adapt relation lifetime fixture to client factory |
||
|
|
e32c794f7b |
fix: restore record lint and session fixture validation (#36065)
Compose the exact changes from PR36056 and PR36058 so lint and session fixture contracts pass together. |
||
|
|
7321b066e8 |
Show messages between agents as cards with the other agent's status (#34824)
* Snapshot agent message relations and verify task display prefixes * Show native chat agent messages in navigable cards * Keep agent message cards derived from canonical input and sidebar state * test: correct agent card contracts and cover raw queue editing * test: repair agent card runtime and operation contracts * fix: preserve queued image previews and typed test measurements * fix: use checked worker fixture and owned sender button typography * fix: complete agent card fixtures and native presentation * test: preserve queued edit exports and current authorship * test: use namespace type imports in queued edit fixture * Preserve sender progress and consolidate card contracts * Simplify sender and notice contract instrumentation * Remove duplicate sender and notice measurement mirrors * Use a template literal for the dispatch boundary fixture * Correct sender and notice verification phase accounting * Consolidate agent message tests around user contracts * Restore folded agent message preview on focus exit * Consolidate agent message regression coverage * Consolidate agent message fixture data * Fix display text test lint diagnostics * Use conversation view type for mail test records * Reuse active copy control in card workflow test |
||
|
|
91efcc4df0 |
Add a per-host running terminal limit setting (#31396)
* feat: configure the running terminal limit for each host * fix: bound terminal policy saves through fresh confirmation * Fix truncated zero-size system file reads * Load actual filesystem fixtures once per test module * Preserve slept terminal ownership through capacity retries * Fix terminal limit CI quality checks * Correct slept terminal resume test types * Move the slept terminal Resume fix to its own pull request The Resume correction fixes a bug that already exists at the default limit, so it now lives in #35401 and this change only adds the terminal limit setting. * Keep terminal limits effective when saved settings cannot be read * Require a numeric edit before repairing terminal limits * Derive terminal default from startup host capacity * Apply terminal policy reads when validated results settle * Align terminal limit tests with static analysis gates * Inject daemon startup errors at the publication boundary * Format terminal capacity using the app language |
||
|
|
6d76f5a77b |
Keep a sleeping conversation resumable when the terminal limit is reached (#35401)
* Keep a sleeping conversation resumable when the terminal limit is reached Resuming a slept pane while the host terminal limit was reached could drop the Resume screen and fall back to a plain spawn. Route capacity refusals back into the deferred sleep state, retry through the main-owned resume, and keep the original session and provider until space frees up. A later Sleep or cancellation still wins. * Retain sleeping pane retries after transient owner failures * Verify sleeping pane retry lookup bounds at scale * Correct sleeping pane retry test fixture types * Use transport attach contract in terminal test fixture * Construct complete terminal transport test fixture |
||
|
|
98f5d13689 |
A kill that reached the agent ends it, so the next message after Stop goes through (#34653)
* fix(native-chat): a kill that reached the agent ends it, so the next message goes through
After Stop, tab close, idle rest or workspace sleep, Orca force-kills the
agent. It used to accept the old agent as gone only when it saw the exit
report within about a second; otherwise every later message re-ran the kill
and was refused with "Couldn't stop {agent} from before." A kill delivered to
the agent itself now ends it and releases the chat with kill-delivered
evidence; the refusal remains only when the kill could not reach the agent.
When writing the chat's journal fails and the following kill can't be
confirmed, recovery now records the close with its fault instead of silently
returning, so the turn no longer stays Working and later sends retry the stop.
Tracked in STA-12354 and STA-12355.
* Preserve provider kill evidence across cleanup retries
* Exercise ACP setup gate with real managed teardown
* fix: preserve Claude writer termination evidence through settlement
* test: consolidate termination evidence contracts
* fix: restore Pi connection exit listener contract
* test: load actual ACP teardown before timed cases
* fix: correct lifecycle contract typing and test boundaries
* test: make Claude piped fixture mock types portable
* test: expect supervised OpenCode probe teardown
* test: align remaining supervised teardown expectations
* fix: align Stop feedback with terminal writer evidence
* test: remove redundant mocked Codex continuation case
* fix: keep adapter declaration and Stop fixture checks portable
* test: keep Stop fixture clock unchanged
* test: read canonical provider handle when reopening Stop journal
|