Brennan BensonandOrca 9b8324efb8 feat(agent-dashboard): persist hook status across Orca restart (#1480)
* feat(agent-dashboard): persist hook status across Orca restart

Hydrates the hook server's per-pane lastStatusByPaneKey from
userData/agent-hooks/last-status.json before binding the HTTP listener,
mirrors mutations to disk via a 250ms trailing debounce, and flushes
synchronously on stop(). Renderer dismissals fan out a new
agentStatus:drop IPC so the on-disk file evicts the entry and a
relaunch cannot resurrect it. Adds a bounded bootstrap queue in
useIpcEvents so events replayed by setListener() during window creation
are not dropped while App.tsx is still hydrating tabsByWorktree.

Gated on settings.experimentalAgentDashboard. Done, blocked, and quiet
working rows now all survive across restart.

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

* fix(agent-dashboard): harden hook persistence IPC and gate-off deletion

Address review findings on the retention-restart branch:

- Wrap agentStatus:getSnapshot and agentStatus:drop IPC handlers in
  try/catch so a throw cannot surface as an unhandled invoke rejection
  (silent startup-hydration failure) or crash main from a fire-and-
  forget listener.
- runStatusPersist no longer permanently suppresses gate-off deletion
  retries on transient unlink errors (e.g. EPERM); deletedOnDisable
  now flips only on success or ENOENT.
- Tighten tests: stale-version-hydrate now asserts the warn message
  content; getSnapshot test uses toEqual; drop-handler test rejects
  null/{}/[] in addition to the prior bad inputs.

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

* fix(agent-dashboard): bound on-disk hydrate growth and reject tabId/paneKey drift

- Drop hydrate entries older than 7 days (HYDRATE_MAX_AGE_MS) so stale
  rows from worktrees archived weeks ago do not pile up forever. PTY-
  teardown eviction handles closed panes; the TTL covers daemon-restored
  PTYs that never re-attach and crash-recovery paths.
- Reject hydrate entries whose `tabId` field diverges from the paneKey's
  tab segment. Cheap defensive add against future renamer/shape drift.

Doc updated to move TTL out of the follow-ups list (now in scope).
Tests: new "drops hydrate entries older than the TTL cutoff" and "drops
a hydrate entry whose tabId disagrees with the paneKey prefix"; existing
hydrate fixtures now use a `recentTs()` helper instead of fixed 2023
timestamps.

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

* fix(agent-dashboard): post-review polish on hook status persistence

Apply review-fix corrections on the agent-dashboard restart-persistence
work:

- Split dropStatusEntry from clearPaneState so renderer-driven dismiss
  IPC no longer wipes lastPromptByPaneKey/lastToolByPaneKey for a
  still-alive pane.
- Validate paneKey shape at the IPC boundary (isValidPaneKey).
- Let getSnapshot errors propagate instead of silently returning [] —
  matches the renderer's existing .catch and avoids masking a broken
  persistence path.
- Trust main's authoritative timing.stateStartedAt unconditionally on
  same-state pings; fall back to existing only when timing is absent.
- Use strict < on the snapshot/live updatedAt guard so two events in
  the same millisecond don't drop the second one (a <= guard regressed
  two existing slice tests).
- Don't reset snapshotRequestedForReadyWindow in the catch handler;
  combined with the per-store-update subscriber it would retry-storm
  on persistent IPC failure.
- scheduleStatusPersist now resets the timer on each call (true
  trailing-edge debounce) instead of leading-edge throttle.
- Fix doc references that named clearPaneState in dismiss/IPC context
  where the implementation uses dropStatusEntry; add type-level JSDoc
  on AgentStatusIpcPayload.

109/109 in-scope tests pass.

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

* fix(agent-dashboard): clean stale on-disk entries during hydrate

- Defensive `lastStatusByPaneKey.clear()` at top of `hydrateLastStatusFromDisk` keeps repeat-start() calls from silently merging prior-session state.
- When sanitize drops entries (drift, TTL, schema), log a single `[agent-hooks] last-status hydrate dropped N entries (kept M)` warn and synchronously rewrite the file. Pre-fix, stale entries stayed on disk until a fresh hook event triggered a debounced write — users who hadn't run an agent in 8+ days would re-drop the same entries every cold boot.
- Prime `lastWrittenJson` from the raw on-disk bytes (instead of re-serializing) when hydration is lossless — robust against future shape drift in `serializeStatusFile`.
- `LAST_STATUS_FILE_VERSION = 2` comment now records why v1 was skipped (in-flight branch shape).
- IPC test mock uses `vi.importActual` for `isValidPaneKey` so it stays in sync with the real validator.

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

* fix(agent-dashboard): persist acknowledgedAgentsByPaneKey across restart

Without this, agent rows the user already visited come back bold every relaunch now that the rows themselves survive restart (per docs/agent-dashboard-retention-restart.md). Hydrate sanitizes input field-by-field (rejects null/non-object/array, prototype-pollution keys, non-finite/non-positive values) and applies a 7-day TTL paralleling HYDRATE_MAX_AGE_MS in agent-hooks/server.ts so hard-quit/crash paths can't grow the persisted map forever.

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

* docs(agent-dashboard): drop in-tree retention/restart design doc

Doc was a working artifact for this branch; the rationale lives in commit
history and the comments next to the persistence/hydrate code. Scrubs the
three call-site references that named it.

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

---------

Co-authored-by: Orca <help@stably.ai>
2026-05-11 10:40:32 -07:00
2026-04-06 23:32:45 -07:00
2026-05-04 20:42:03 -07:00
2026-03-16 22:27:51 -07:00
2026-03-28 10:19:14 -07:00
2026-05-11 06:15:53 +00:00

Orca Orca

Supported Platforms Discord Follow on X

English · 中文 · 日本語 · Español

The AI Orchestrator for 100x builders.
Run Claude Code, Codex, or OpenCode side-by-side across repos — each in its own worktree, tracked in one place.
Available for macOS, Windows, and Linux.

Download 🐋

Orca Screenshot

Supported Agents

Orca supports any CLI agent (not just this list).

Claude Code   Codex   Gemini   Pi   Hermes Agent   OpenCode   Goose   Amp   Auggie   Autohand Code   Charm   Cline   Codebuff   Continue   Cursor   Droid   GitHub Copilot   Kilocode   Kimi   Kiro   Mistral Vibe   Qwen Code   Rovo Dev


Features

  • No login required — Bring your own Claude Code or Codex subscription.
  • Worktree-native — Every feature gets its own worktree. No stashing, no branch juggling. Spin up and switch instantly.
  • Multi-agent terminals — Run multiple AI agents side-by-side in tabs and panes. See which ones are active at a glance.
  • Built-in source control — Review AI-generated diffs, make quick edits, and commit without leaving Orca.
  • GitHub integration — PRs, issues, and Actions checks linked to each worktree automatically.
  • SSH support — Connect to remote machines and run agents on them directly from Orca.
  • Notifications — Know when an agent finishes or needs attention. Mark threads unread to come back later.

Install

Mac, Linux, Windows

Alternatively, install from a package manager:

macOS (Homebrew)

brew install --cask stablyai/orca/orca

Arch Linux (AUR)

# Precompiled binary
yay -S stably-orca-bin

# Build from GitHub source
yay -S stably-orca-git

[New] Annotate AI Diff

Comment directly on AI-generated diffs.

Annotate any line in an AI-generated diff with your feedback, then send it back to the agent to revise. Keep the review loop tight — no copying line numbers, no context switching.

Orca Annotate AI Diff — comment on AI-generated diffs and send feedback to the agent


[New] Hot Swap Codex Accounts

Multiple Codex accounts? Switch in one click.

If you run multiple Codex accounts to get the best token deal, Orca lets you hot-swap between them instantly — no re-login, no config files. Just pick an account and keep building.

Orca Codex Account Switcher — hot swap between multiple Codex accounts


[New] Per Worktree Browser & Design Mode

See your app. Click any element. Drop it into the chat.

Orca ships with a built-in browser right inside your worktree. Preview your app as you build, then switch to Design Mode — click any UI element and it lands directly in your AI chat as context. No screenshots, no copy-pasting selectors. Just point at what you want to change and tell the agent what to do.

Orca Design Mode — click any UI element and drop it into the chat


[New] Introducing the Orca CLI

Agent orchestration from your terminal.

Let your AI agent control your IDE. Use AI to add projects to your IDE, spin up worktrees, and update the current worktree's comment with meaningful progress checkpoints directly from the terminal. Ships with the Orca IDE (install under Settings).

npx skills add https://github.com/stablyai/orca --skill orca-cli

Community & Support

  • Discord: Join the community on Discord.
  • Twitter / X: Follow @orca_build for updates and announcements.
  • Feedback & Ideas: We ship fast. Missing something? Request a new feature.
  • Privacy: See the privacy & telemetry docs for what anonymous usage data Orca collects and how to opt out.
  • Show Support: Star this repo to follow along with our daily ships.

Developing

Want to contribute or run locally? See our CONTRIBUTING.md guide.

S
Description
Orca is the ADE for working with a fleet of parallel agents. Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.
Readme MIT
1.4 GiB
Languages
TypeScript 95.2%
JavaScript 4.1%
Swift 0.2%
CSS 0.1%
HCL 0.1%