Commit Graph
5094 Commits
Author SHA1 Message Date
Brennan Benson 555545b02a fix: fence reentrant terminal lifecycle cleanup 2026-07-13 16:33:21 -07:00
Brennan Benson ec57a10e02 Merge remote-tracking branch 'origin/main' into fix/renderer-crash-white-screen 2026-07-13 16:01:53 -07:00
Brennan Benson eddddc0682 fix: publish terminal handler groups atomically 2026-07-13 16:01:15 -07:00
833724830f Fix folder workspace Git status path (#8326)
* Fix folder workspace Git status path

* fix(git): resolve folder-workspace path for all local filesystem ops

Extend the folder-workspace suffix stripping beyond git status: every
local Git subprocess cwd, the WSL-context probe, the first-work
branch/folder rename hooks, and the renderer session placeholders now
resolve the synthetic `::workspace:<uuid>` instance id to its backing
folder via splitWorktreeIdForFilesystem. Without this they would spawn
Git (or fs ops) against a nonexistent directory (ENOENT).

Co-authored-by: Orca <help@stably.ai>

* Preserve folder workspace rename instance ids

* Read folder workspace suffix from worktree id

---------

Co-authored-by: Jinjing <6427696+AmethystLiang@users.noreply.github.com>
Co-authored-by: Orca <help@stably.ai>
2026-07-13 15:47:17 -07:00
f90cd6ebc9 fix(cli): preserve WSL cwd through the Windows bridge (#6965) (#7640)
* fix(cli): preserve WSL cwd through the Windows bridge (#6965)

# Conflicts:
#	src/cli/index.test.ts
#	src/cli/index.ts

* fix(cli): preserve bridge exit codes (#6965)

* fix(cli): harden WSL cwd bridge compatibility

* chore(cli): align cwd tests with main

* fix(cli): repair deleted WSL cwd before path conversion

* chore: preserve main formatting after merge

---------

Co-authored-by: Brennan Benson <brennanbenson@Brennans-MacBook-Pro.local>
Co-authored-by: Brennan Benson <79079362+brennanb2025@users.noreply.github.com>
2026-07-13 15:44:32 -07:00
Brennan BensonandBrennan Benson 53a09afbef feat(mobile): match desktop's Smart workspace source picker exactly (#7985)
* feat(mobile): start a workspace from a branch, issue/PR, or Linear ticket

Unify mobile workspace creation with desktop. The "+" Create Workspace
modal now has a primary "Start from" field that opens a tabbed search
drawer (Branch · GitHub · GitLab · Linear), letting a user start a
workspace from an existing/new git branch, a GitHub issue/PR, a GitLab
issue/MR, or a Linear ticket — in addition to the default blank workspace.

No new backend is required: the search RPCs (github.listWorkItems,
gitlab.listWorkItems, linear.searchIssues/listIssues, repo.searchRefs) and
the worktree.create linked-item params were already used by the mobile
Tasks screen. This surfaces them in the create flow, reusing the existing
pure modules (buildTaskWorkspaceCreateParams, shouldResolveHostedReviewStartPoint,
filterAvailableTaskProviders).

Details:
- New pure modules: workspace-source-selection, use-workspace-source-search,
  source-workspace-create, worktree-create-retry, blank-workspace-create
  (the blank/retry path extracted from the modal for reuse + line budget).
- New UI: WorkspaceSourcePickerDrawer (+ row) and SetupHookTrustDrawer
  (extracted from the modal).
- Older paired desktops (missing the mobile.tasks.v1 capability) degrade to
  Branch + Blank only; GitLab/Linear tabs appear only when available.
- GitHub/GitLab sources pin their repo; switching repos resets the source.
  PR/MR sources resolve their base branch at create time; SSH repos gate
  search until connected (Linear search is repo/SSH-independent).

* fix(mobile): hydrate settings/trust before availability probes settle

Review fixes for #7985: setTrustedOrcaHooks/setRuntimeSettings no longer
wait on status.get/preflight.check/linear.status (a first-open
preflight.check can take seconds, widening the spurious setup-trust
re-prompt window). Also adds param-parity tests for createBlankWorkspace
and a GitLab MR base-resolve test.

* feat(mobile): match desktop's Smart source picker exactly

Rework the mobile create-workspace source picker to be a faithful port of
desktop's Smart picker instead of the earlier divergent "Start from" drawer.

The mobile field is now the workspace-name input AND the source search, with the
exact desktop tabs — Smart · GitHub · Linear · GitLab · Branch · Name. "Smart"
fans out across GitHub + GitLab + Linear + branches, prepends a "Use '<name>'"
row, and resolves pasted URLs / #123 / STA-42 to exact items (with a cross-repo
switch prompt). Selecting a source shows a pill and moves the editable name into
Advanced. The invented "Blank workspace" concept is removed — the neutral state
is just a typed/empty name (blank submit still yields a creature name).

DRY: the pure desktop logic (smart-workspace-source-results, -command-value,
github-links, gitlab-links, work-item-link-query-bounds, github-work-item-identity)
moves to src/shared/new-workspace/ with re-export shims at the old renderer paths,
so both renderer and mobile share one implementation. composer-branch-selection
and workspace-name were already shared and are reused directly.

Two read-only lookup RPCs are allowlisted for mobile so pasted GitLab URLs and
cross-repo GitHub URLs resolve to exact items (github.workItemByOwnerRepo,
gitlab.workItemByPath).

New mobile modules are split for max-lines: use-mobile-composer-source (selection
state + desktop-parity handlers, PR/MR base resolve), use-smart-workspace-source
+ smart-source-fan-out/-search-requests/-paste-intent (RPC orchestration),
composer-linked-work-item / work-item-lookup-text / mobile-smart-source-modes
(pure logic), and SmartWorkspaceSourceField/Drawer/Row + SmartWorkspaceAdvancedFields.
Replaces WorkspaceSourcePickerDrawer/Row, workspace-source-selection,
use-workspace-source-search, and MobileWorkspaceNameInput.

Reviewed by three adversarial agents + re-reviewed after fixes: GitHub search now
returns issues AND PRs (not issues-only), Linear defaults to assigned, create-branch
preserves slashy names, cross-repo PR base resolves against the item's own repo,
displayName is suppressed for user-edited names, and the smart-mode GitHub fan-out
respects availability. tsc/oxlint/max-lines-ratchet clean; 1328 mobile tests pass.

* fix(mobile): keep smart source drawer fully visible

* refactor: share workspace creation behavior across clients

* fix: address workspace creation review findings

---------

Co-authored-by: Brennan Benson <brennanbenson@Brennans-MacBook-Pro.local>
2026-07-13 15:38:02 -07:00
Brennan Benson 5e4eb0b274 Merge remote-tracking branch 'origin/main' into fix/renderer-crash-white-screen 2026-07-13 15:33:38 -07:00
Brennan Benson 8b1425d949 fix: preserve terminal handler group ownership 2026-07-13 15:32:19 -07:00
Jinjing 280103aa04 Allow replying to any comment in a thread, not just the root (#8562)
Reply state now tracks a comment id instead of a group id, and reply composers/handlers are threaded through each comment row (root and replies alike) so any comment can receive an inline reply rather than only the thread root.
2026-07-13 15:20:43 -07:00
Brennan Benson dc345e547a fix: revoke suspended terminal handler ownership 2026-07-13 15:10:50 -07:00
Brennan Benson b114983754 fix(terminal): transfer renderer handler admission 2026-07-13 14:53:41 -07:00
Brennan Benson b35367b2fc fix(terminal): scope pre-handler state to admission 2026-07-13 14:32:21 -07:00
Brennan Benson b294046538 Merge remote-tracking branch 'origin/main' into fix/renderer-crash-white-screen 2026-07-13 14:30:07 -07:00
Brennan Benson 65c65c37e8 fix(terminal): stop stale PTY resize after worktree reveal (#8502)
* fix(terminal): stop stale PTY resize after worktree reveal

The visibility-resume size readback captures xterm's pre-reveal grid as
its resize target while the applied-size read is in flight. A reveal fit
or snapshot-restore resize can change the grid mid-flight without
queuing a newer request, so the resolved callback "repaired" the PTY
back to the pre-reveal grid — an idle TUI (Claude Code) then redraws
for the wrong grid until a manual resize (refs #7951, #7240).
Instrumented traces show the stale capture on every reveal; correctness
relied on the read winning FIFO against the fit's resize, which busy
daemons and SSH/relay round-trips lose.

Re-measure xterm at resolve time and re-run against the fresh grid
instead of forwarding a stale target. Adds an e2e seam that delays the
readback dispatch to reproduce the losing ordering, unit repros that
fail without the guard, and a hidden-resize/reveal-cycle e2e spec.

* test(terminal): cover single-flight convergence under an oscillating grid

* docs(e2e): note the WINCH bar is illustrative, not a Windows ground truth

The reveal repro asserts on pty:getSize convergence; the bottom-bar TUI
only makes the pane WINCH-reactive. Record that a long-lived process can
miss Node's stdout 'resize' event under Windows ConPTY even when the OS
PTY was resized, so future readers don't add a flaky bar-content check.
2026-07-13 14:17:49 -07:00
Brennan Benson 230625e6ed fix(terminal): fence stale exit overflow probes 2026-07-13 14:07:01 -07:00
Brennan Benson d30f59eefc fix(terminal): serialize renderer session admission 2026-07-13 13:44:26 -07:00
Brennan Benson 01a977a7f5 Merge remote-tracking branch 'origin/main' into fix/renderer-crash-white-screen
# Conflicts:
#	src/main/runtime/orca-runtime.ts
2026-07-13 13:20:15 -07:00
Brennan Benson c509aeceed fix(terminal): serialize daemon session admission 2026-07-13 13:14:40 -07:00
Jinjing 5be44d1553 fix(native-chat): target native chat to the active split leaf (#8569)
* fix(native-chat): target native chat to the active split leaf

* fix(native-chat): harden split leaf reassignment

* fix(native-chat): tolerate missing layout state
2026-07-13 13:07:52 -07:00
Jinjing 39b2ec832e fix(native-chat): scope composer sends to the active turn (#8568)
* fix(native-chat): scope composer sends to the active turn

* fix(native-chat): close pending send lifecycle gaps

* fix(native-chat): deduplicate pending message derivation
2026-07-13 13:07:25 -07:00
Jinjing 476b6f97d0 fix(native-chat): preserve initial chat mode on paired-host launches (#8567)
* fix(native-chat): preserve initial chat mode on paired-host launches

* fix(native-chat): keep paired launch mode authoritative

* fix(native-chat): preserve mode through PTY materialization
2026-07-13 13:06:59 -07:00
Brennan Benson 9a8fed5070 Merge remote-tracking branch 'origin/main' into fix/renderer-crash-white-screen 2026-07-13 12:48:29 -07:00
Brennan Benson aa50c6d988 fix(terminal): reject exited daemon admissions 2026-07-13 12:47:49 -07:00
Brennan Benson fc458f2b30 Remove finished and killed claude subagents from the sidebar roster (#8522)
* Remove finished and killed claude subagents from the sidebar roster

Finished one-shot subagents stayed in the pane roster as permanent idle
rows (dozens per ultracode/workflow session), and a subagent killed
without its SubagentStop hook stayed 'working' forever, pinning the pane
working. SubagentStop now removes one-shot entries (teammates only idle:
they are alive and resumable), and a lead Stop's present background_tasks
list is treated as authoritative for non-teammates - unlisted entries are
removed. Teammates are identified by their name-embedding agent ids
(a<name>-<hex>, verified against live hook captures).

* Fix Claude subagent roster reconciliation

* Drop named workflow lanes that share the teammate id shape

Workflow/named one-shot agents report name-embedding lifecycle ids
(afinder-C-<hex>, agent_type = the label), indistinguishable by shape
from resumable teammates - so the roster retained them as idle rows
(observed live: a 32-row 12h-old pile). Unlike teammates they ARE
listed id-exact as subagent-typed background tasks, including inside
their own SubagentStop payload. Use that corroboration to remove them
on stop, reclassify task-listed teammate-shaped entries as one-shots,
and reap teammate-shaped leftovers when a complete inventory lists no
teammate-typed task at all (a teams session always lists its teammates,
even idle ones).
2026-07-13 12:47:17 -07:00
Kaynan Sampaio de Camargoandkaynan dc4fb2aa03 fix(native-chat): retry not-yet-flushed transcripts instead of settling into a permanent error (#8418)
* fix(native-chat): retry not-yet-flushed transcripts instead of settling into a permanent error

A freshly-created session's transcript .jsonl lands on disk seconds to
minutes after the process starts. Native chat's one-shot read raced that
first flush: a miss became a permanent "No transcript found" error and
the live-tail subscription silently degraded to a no-op, so the pane
never recovered even after the file appeared.

- transcript-reader/read-cache: mark the miss with notFound so callers
  can tell "not flushed yet" from a real parse/IO error (never cached).
- transcript-watch: poll resolve+install (500ms backoff, 5s cap) for the
  subscription's lifetime instead of returning a dead no-op watcher.
- use-native-chat-live-session: retry a notFound read with backoff for
  up to 60s while staying in the loading state, and let live appends
  render over a stale initial-read error.

Fixes #8401

Claude-Session: https://claude.ai/code/session_01HA5g3X7wCakBttBpDru9Fp

* fix(native-chat): address CodeRabbit review — ENOENT retryable, content over spinner, blank-id guard, unref poll timer

- transcript-reader: an ENOENT after a successful resolve is the same
  first-flush/rotation race as an unresolved path — mark it notFound.
- use-native-chat-live-session: live appends landing mid-retry render
  instead of the loading state (mirrors the stale-error gate).
- transcript-watch: bail out for a blank session id with no explicit
  file (nothing to resolve-poll), and unref the poll timer so headless
  serve shutdown is never held open by an unresolvable session.

Claude-Session: https://claude.ai/code/session_01HA5g3X7wCakBttBpDru9Fp

---------

Co-authored-by: kaynan <kaynan.camargo@terceiro-sky.com.br>
2026-07-13 12:45:46 -07:00
Jinjing 527c692b71 Improve git pull on remote (#8524)
* Fall back to a merge when a divergent pull has no reconciliation strateg

- Git 2.27+ refuses `git pull` on divergent branches unless pull.rebase or
  pull.ff is configured. Retry with `--no-rebase` (Git's historical default)
  so pulls succeed out of the box on fresh hosts.
- Skip the fallback whenever the caller already specified a reconciliation
  strategy (e.g. --ff-only, --rebase) so explicit policies still fail as
  expected on divergence.
- Applied identically in the local git pull path and the relay/SSH git
  handler so both surfaces behave the same way.

* Refactor divergent-pull merge fallback into shared helper

Extracts the retry-as-merge logic (duplicated between local git and
relay SSH pull paths) into `runPullWithDivergenceFallback` in
git-remote-error.ts, so both callers share one implementation and
test coverage.
2026-07-13 12:42:55 -07:00
Brennan Benson c1fd70bc97 Merge remote-tracking branch 'origin/main' into fix/renderer-crash-white-screen 2026-07-13 12:21:33 -07:00
Brennan Benson 5024b4d8d4 fix(terminal): fence synchronous daemon exits 2026-07-13 12:21:01 -07:00
Brennan Benson 4dacb08ec5 fix(terminal): publish daemon sessions before output 2026-07-13 12:00:21 -07:00
Brennan Benson 2384370d25 fix: fence teardown from replacement sessions 2026-07-13 11:43:21 -07:00
Brennan Benson 9a2379211e Search worktrees by cached review metadata (#8505)
* feat(renderer): search worktrees by review metadata

* fix(renderer): scope review search by execution host
2026-07-13 11:23:28 -07:00
Brennan Benson 971b1d9b0c fix: retain terminal shutdown ownership until exit proof 2026-07-13 11:10:20 -07:00
Brennan Benson 7ba4ff0c7e fix: preserve terminal shutdown ownership under concurrency 2026-07-13 10:22:58 -07:00
Brennan Benson 79b6036a7b fix terminal teardown admission and retry races 2026-07-13 09:51:47 -07:00
Brennan Benson 173300196a fix retained terminal shutdown ownership gaps 2026-07-13 09:09:15 -07:00
Brennan Benson 498b3ea3a8 fix terminal exit proof generation races 2026-07-13 08:21:55 -07:00
Brennan Benson 905777c49a refactor: remove dead renderer retry hooks 2026-07-13 07:40:29 -07:00
Brennan Benson 42c5017e66 fix: retain unknown daemon exit proof 2026-07-13 07:27:01 -07:00
Brennan Benson 5d607ddbbb Merge remote-tracking branch 'origin/main' into fix/renderer-crash-white-screen
# Conflicts:
#	config/reliability-gates.jsonc
#	src/main/ipc/pty.ts
2026-07-13 07:13:52 -07:00
Brennan Benson 4d299463b2 fix: fence stale PTY exit generations 2026-07-13 07:10:42 -07:00
Brennan Benson 9bc3b6bd0f fix: fence provider route generations 2026-07-13 06:51:04 -07:00
fsdwen 7b3103f890 fix(i18n): correct 'run' translations from '跑步' to '执行' in zh.json (#8554)
Fixes #8553

'跑步' (jogging) was used in computing/automation contexts where
the correct term is '执行' (execute). 11 entries fixed across:
- TabBarQuickCommandsButton: Run
- Scripts settings: When to run
- quick.commands.search: run (keyword tag)
- ReviewPRViewAnimatedVisual: Running
- AutomationRunHistory: Run (column header)
- AutomationRunPageFrame: Back to runs
- AutomationsPage: Runs, run
- ExternalAutomationManagers: run
- ExternalAutomationRunTable: Runs, run

Note: key e66091daf4 already correctly translated as '运行'.
2026-07-13 06:50:18 -07:00
Brennan Benson 73709e16f2 fix: preserve teardown ownership across fallback paths 2026-07-13 06:31:52 -07:00
Brennan Benson e70046a757 fix: drain terminal owners before process shutdown 2026-07-13 05:46:23 -07:00
JinjingandOrca 13ed697cc2 Fix windows serve wsl barrier (#8559)
* fix(startup): bound serve WSL reconciliation wait

* test(startup): cover WSL barrier fail-open on early reconciliation rejection

Co-authored-by: Orca <help@stably.ai>

* feat(serve): surface managed WSL reconciliation status to headless clients

Expose reconciliation state ('pending'|'settled'|'failed') in the
orca_server_ready payload and a wsl-cli-barrier startup milestone, so
headless/SSH agents can tell the fail-open barrier outlived its budget
and a WSL PTY launch may still race an un-migrated registration.

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Orca <help@stably.ai>
2026-07-13 05:40:09 -07:00
Jinjing 6091995e75 perf(worktree-watcher): skip head-identity reads on index-only bursts (#8558)
An index rewrite cannot move HEAD, yet every quiet local Git-common status
burst was calling readGitCommonHeadIdentities, which scans the primary
checkout plus every linked worktree sequentially (~1,500 file reads for 500
worktrees) even when only index files changed.

Split the conflated git-status signal into two: index churn stays
`gitStatusRepoIds`, while logs/HEAD (and other reflog head moves) become a
distinct `headIdentityRepoIds` signal. Source Control is still notified for
both, but readGitCommonHeadIdentities now runs only for true head triggers
(and structural ticks, which re-baseline silently). Index-only bursts do zero
head-identity reads.

Adds deterministic tests: index-only bursts read zero head identities across
linked and primary checkouts; logs/HEAD still refreshes identities for both;
plus coalescing and debounce coverage.
2026-07-13 05:40:02 -07:00
Jinjing 17f032dbd5 Fix WSL orchestration CLI preambles (#8561) 2026-07-13 05:39:52 -07:00
Jinjing 6eda9cdb27 fix(ssh): bound healthy relay watcher processes (#8556) 2026-07-13 05:32:31 -07:00
Brennan Benson 0839a48b93 fix: retain daemon and relay shutdown owners 2026-07-13 05:09:54 -07:00
Brennan Benson bfd28680a3 fix: preserve terminal teardown ownership until exit 2026-07-13 04:37:41 -07:00