* Track update check attempts to prevent stale races and handle stalls
- Sequence each update check with an attempt ID to prevent stale event handlers (like async changelog fetches) from overwriting newer check states.
- Introduce a 45-second timeout to gracefully fail or retry hung update checks that stall before reaching updater events.
- Settle checks with a brief grace period when the updater promise resolves without firing a terminal event.
* Ignore update-available events when no active check attempt exists
Prevents processing stale events from the auto-updater after a silent
background check has already settled, which could otherwise overwrite
more recent check states or trigger unexpected status transitions.
* Ignore stale electron-updater events from previous check attempts
Introduce attempt tracking to bind emitted updater events to the active
update check. This prevents stale events (such as checking, available,
not available, or errors) from previous checks or preflight stages
from triggering false state transitions or duplicate status updates.
- Track the launched and active attempt IDs during update preflight
- Ignore events if their attempt ID does not match the active check
- Allow error events to propagate during active download/install phases
- Clear pending nudge campaigns on silent follow-up checks settling to not-available
* Improve built-in browser downloads
Implements docs/browser-normal-download-behavior.md with automatic OS Downloads saving, collision-safe destinations, and renderer download controls.
* Clean up browser downloads on tab closure and guest destruction
- Cancel and drop pending download records when webview guests are destroyed or closed to prevent memory leaks and dangling state.
- Purge tracking entries for cancelled downloads lacking an active tab.
- Document filename normalization and reservation assumptions in download builder.
- Translate "Copy Terminal ID" context menu action in Spanish and Chinese locales.
Narrow RateLimitService provider config wiring so OpenCode Go receives provider-specific config while Gemini keeps its OAuth-enabled setting through a separate resolver.\n\nValidated locally with the full src/main/rate-limits test suite and typecheck.
Ensure that when a visible fallback PR has been merged (e.g., outside
Orca with a deleted head branch), it is still accepted and refreshed by
branch lookup instead of being discarded as an implicit merged PR.
* Add `acceptMergedFallbackPR` option to GitHub branch lookups
* Enable this option during manual and background refreshes of fallback PRs
* Plumb the new option through preload APIs, IPC handlers, and RPC protocols
Introduce optional `task-title` and `display-name` parameters for orchestration tasks, persisting them in the database and propagating them through the RPC and Orca runtime.
This allows the CLI, dashboard, activity page, and sidebar to display concise, user-friendly labels for dispatched worker agents instead of verbose, raw system preambles.
* Add test file for workspace delete bug
Co-authored-by: Orca <help@stably.ai>
* Fix Windows workspace deletion runtime resolution
Resolve project-created workspace deletion through the selected project runtime so Windows paths are listed strictly without falsely tripping the unregistered worktree guard.
Design doc: docs/delete-workspace-windows-unregistered.md
---------
Co-authored-by: Orca <help@stably.ai>
Reveals the standard workspace delete action from sidebar rows on hover or keyboard focus, while keeping primary/main worktrees protected.
Maintainer follow-up:
- prevent hidden delete buttons from receiving pointer events
- merge latest main and resolve localization conflict
Validated with CI PR Checks plus local typecheck, lint, Vitest, and Electron hover/focus/delete-confirmation checks.
Maps Kimi AskUserQuestion PreToolUse events to waiting, exposes the Kimi hook status IPC/preload surface, and hardens Kimi session parsing plus remote hook path construction.
createLaunchEnv adds a team (with nested panes map) per agent-team leader,
keyed by a fresh teamId. The only eviction (removeTeamForLeaderHandle) ran
solely from closeTerminal (explicit user-close). The natural-exit paths
onPtyExit and dropDisconnectedPtyRecord tore down every other per-pty map
but never the team, so a leader exiting on its own leaked the team + panes
map permanently.
Evict via the leader handle (handleByPtyId.get(ptyId)) in both onPtyExit
and dropDisconnectedPtyRecord, mirroring the closeTerminal call. Add
getActiveTeamCount for assertability.
Regression test drives the real onPtyExit/dropDisconnectedPtyRecord: fails
before the fix (teams leak) and passes after.
Co-authored-by: Orca <help@stably.ai>
onData creates+sets a pty record before the stopped-state guard, and onExit
deletes the record instead of leaving a tombstone. A data chunk arriving
after onExit (the exit-then-data race in pty.ts shutdown) resurrected a
fresh record that nothing ever deleted, and double-counted the session.
ptyId is a fresh per-spawn UUID, so the three ptyId-keyed maps grew
unbounded.
Track exited ids in a bounded FIFO and refuse onData resurrection for them.
Regression test fails before the fix (record resurrected, 200 leaked) and
passes after.
Co-authored-by: Orca <help@stably.ai>
recordCoalescedCrashBreadcrumb set entries keyed by agent:${agentType}:${state}
with no prune and no cap. agentType is an open string (length-trimmed only,
never enum-checked) over the relay/SSH/OSC ingest paths, so the map grew
unbounded over a long multi-agent session — the sibling breadcrumbs array
is capped at 30, but this map was not.
Prune entries past their suppression window and LRU-cap to 128, mirroring
ProcessGoneDedupe's prune/maxKeys idiom.
Regression test fails before the fix (1000 keys) and passes after.
Co-authored-by: Orca <help@stably.ai>
handleWriteError adds a sessionId to disabledSessions on any best-effort
history write failure. closeSession (the normal PTY-exit teardown) deleted
the writer but never the disabled flag; the only other deletes are on id
reuse (never happens) and explicit user-kill. A session poisoned by a
transient mid-life write error then exiting normally leaked its id in
disabledSessions forever.
Delete the flag in closeSession after writers.delete. Add isSessionDisabled
and disabledSessionCount test accessors.
Regression test fails before the fix (50 ids leak) and passes after.
Co-authored-by: Orca <help@stably.ai>
* Allow deleting downloaded speech models on desktop and mobile
Implement safe deletion of local speech models across desktop and
mobile platforms.
- Add a shared helper to coordinate STT service teardown, file deletion,
and voice settings cleanup.
- Prevent deleting speech models that are currently in use or starting.
- Update desktop and mobile settings UIs to expose the delete action.
* Track multiple pending model deletions and update action disabling
- Replace the single pending delete ID string state with a Set of IDs on desktop settings to track multiple concurrently deleting models.
- Switch the desktop delete action to use the standard themed Button component.
- Disable all row interactions on the mobile voice model list when any model action is busy.
- Add unit test coverage verifying that individual row delete button disabled states behave correctly.
* feat(worktree): reuse an existing branch when creating a worktree (#5181)
Adds an explicit "Reuse this branch" checkbox to the new-worktree composer.
When an existing local branch is selected in the smart name field, the
checkbox (default on) checks that branch out instead of creating a new
branch from it — and the choice now survives renaming the worktree folder.
Previously, reusing an existing branch only worked implicitly: it required
keeping the auto-filled worktree name equal to the branch, and editing the
name silently reverted to "create a new branch". There was no discoverable,
durable control — the gap the issue reports.
The fix is renderer-only: picking an existing local branch already sets
baseBranch === branchNameOverride, so the existing backend reuse path
(`git worktree add <path> <branch>`, preserveBranchOnDelete) checks the
branch out correctly across local/SSH/runtime. The checkbox pins that
override via the existing branchNameOverridePreservesNameEdits flag so the
worktree folder can be named independently while the branch is reused;
unchecking creates a fresh branch from the selected ref as base.
- New pure helper resolveComposerBranchReuse (local-vs-remote + default).
- Checkbox hidden for remote-only refs and non-branch sources.
- Tests: pure helper, card render/toggle, and a backend integration test
proving a renamed folder still reuses the exact branch.
* fix(worktree): refine reuse-branch checkbox (placement, label, eligibility)
Address review feedback on the "Reuse branch" control:
- Move the checkbox directly under the branch (smart) selection instead of the
Advanced "Name" field — the worktree folder name can legitimately differ from
the branch, so the choice belongs next to the branch pick and is now visible
without expanding Advanced.
- Rename the label "Reuse this branch" -> "Reuse branch".
- Make eligibility dynamic: reuse is impossible when the branch is already
checked out in another worktree (git allows a branch in only one worktree), so
the checkbox is now hidden in that case (it was already hidden for remote-only
refs). When a busy branch is picked, the override is no longer pinned to it, so
creation cleanly falls back to a new branch from that ref as base instead of a
silently-suffixed branch.
Adds isBranchCheckedOutInWorktrees (pure, unit-tested) and threads the repo's
worktree branch list from the store into the selection logic.
* feat(worktree): animate the reuse-branch row's show/hide
Keep the "Reuse branch" row mounted and collapse it with a grid-rows
transition (same pattern as the Advanced drawer) instead of conditionally
rendering it, so the create-worktree dialog grows and shrinks smoothly when the
option appears/disappears as the selected branch changes. The checkbox is taken
out of the tab order while collapsed.
* refactor(worktree): address review nits on reuse-branch control
From a multi-dimensional review of the branch (all findings low severity):
- Reset reuse state (reuseEligibleBranch, reuseSelectedBranch,
branchNameOverridePreservesNameEdits) on repo and project switches, matching
the other reset paths — avoids carrying stale branch-scoped state.
- Disable the reuse checkbox while collapsed so no focusable control lives
inside the aria-hidden row.
- Extract the busy-branch override decision into a pure resolveComposerReuseOverride
helper and unit-test it (busy local branch drops the override; remote-only ref
keeps it) — pins the "no suffixed-branch collision" guarantee.
- Note the worktreesByRepo visibility limitation near the busy-branch check
(a branch busy only in a hidden external worktree is caught by the backend).
- Strengthen tests: reuse-checkbox toggle in both directions, empty worktree
list case.
* fix(daemon): reap dead terminal sessions and clear stale checkpoint flags
TerminalHost.sessions never removed exited sessions: sessionIds are minted
fresh per pane and never reused, so each dead Session pinned a @xterm/headless
emulator (~5000 rows of scrollback) for the lifetime of the long-lived daemon
process. Nothing reads a dead session's emulator (getSnapshot/takePendingOutput/
listSessions all skip !isAlive), so it was pure retained memory.
Wire a Session onExit hook to TerminalHost.reapSession, which disposes the
emulator and drops the entry from the map. Fires on natural exit and the
kill-timeout force-dispose path; the immediate-kill path reaps inline. This is
the 'TerminalHost dead-session cleanup' the handleSubprocessExit comment already
anticipated.
Also clear DaemonPtyAdapter.sessionsNeedingFullCheckpoint on session exit and
non-keepHistory shutdown — a cold-restored session that exited before its first
checkpoint stranded a permanent Set entry.
Regression tests assert the emulator is disposed / the flag cleared on exit
(both fail before the fix). Full daemon suite (557 tests) stays green.
Co-authored-by: Orca <help@stably.ai>
* test(daemon): cover forceDispose reaping; fix stale comments
Review follow-up:
- Update the 'already-exited session' test: with reaping, natural exit disposes
+ drops the session (never force-killed) at exit time via session.dispose, so
host.dispose only sees live sessions. Comments now match; assert the exited
session is gone from listSessions.
- Add a forceDispose (graceful-kill-timeout) test: a stubborn child that ignores
kill is force-disposed after KILL_TIMEOUT_MS, disposing its emulator and reaping.
- Clarify the shutdown() comment that the unconditional checkpoint-flag delete is
a harmless no-op under keepHistory.
Co-authored-by: Orca <help@stably.ai>
---------
Co-authored-by: Orca <help@stably.ai>
* fix(window): remove double title bar on Linux
On Linux the BrowserWindow titleBarStyle fell through to undefined, so
the native WM title bar stayed and stacked on top of Orca's own
renderer-drawn titlebar — two title bars. macOS (hiddenInset) and
Windows (hidden) already suppress the native one.
Drop the native frame on Linux (frame: false) and extend the renderer's
Windows-only custom-titlebar branches (logo/menu anchor, app-name
hiding, window-controls spacer + CSS vars, and the WindowControls
min/max/close cluster) to Linux via a shared `hasCustomTitleBar` flag,
so Linux gets one title bar with working window controls — matching the
Windows custom-titlebar path.
Fixes#5724
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* review: harden Linux custom titlebar gating
Co-authored-by: Orca <help@stably.ai>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
Co-authored-by: Orca <help@stably.ai>
Speed up Windows CLI launch by delivering short startup commands through shell args, falling back to stdin for oversized commands, and moving Codex historical session bridging into an incremental background task. Includes review fixes for Windows symlink and WSL test reliability.