Repository navigation
Resume agent sessions from mobile history - #6969
Merged
brennanb2025 merged 16 commits intoJul 3, 2026
Merged
brennanb2025 merged 16 commits into
brennanb2025 merged 16 commits into
Conversation
|
Ready to review this PR? Stage has broken it down into 7 individual chapters for you: Chapters generated by Stage for commit d46d908 on Jul 2, 2026 4:12am UTC. |
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
brennanb2025
merged commit Jul 3, 2026
1a2b64b
into
brennanb2025/add-agents-to-mobile
2 checks passed
brennanb2025
added a commit
that referenced
this pull request
Jul 10, 2026
* Show agent session history on mobile Bring the desktop "Agent Session History" panel to Orca Mobile as a per-worktree screen: browse past agent transcript sessions across the host with scope tabs (Workspace/Project/All), search, grouping, session cards, and tap-to-read message previews. The transcript scan previously ran only over Electron IPC, so mobile could not reach it. Expose it over the runtime RPC protocol mobile already speaks (aiVault.listSessions) so the scan runs on whichever host owns the transcripts — correct for local and SSH/remote hosts. Both the desktop IPC handler and the new RPC method share one cache, so opening the desktop panel and the mobile screen never double-scan. The pure filter/group/display logic is lifted into /shared (the renderer re-exports it) so the standalone mobile package can reuse it. Mobile narrows scoped tabs client-side by cwd path-prefix because the host scan treats scope paths as a widening union. Resume-from-mobile is intentionally a follow-up. * Fix mobile agent history list rendering and RPC authorization - Authorize aiVault.listSessions in the mobile RPC allowlist so the mobile client's call is not rejected before dispatch (without this the screen could never load sessions at runtime). - Name each SectionList section's rows `data` (the field React Native reads) instead of `cards`, fixing a type error and silent empty-section rendering. * Address review feedback on agent session history - Match quoted repo:/path: search operator values so labels and paths with spaces match (e.g. path:"/Users/ada/My Project"). - Hold a scoped tab in loading until the worktree list resolves instead of firing an unscoped fetch that briefly shows unrelated host history; proceed once loaded even if the worktree is absent (no stuck spinner). - Clear cached host capabilities on disconnect/host-switch and failed status.get so a capability-gated action can't linger for a host that doesn't support it. - Cover the real OrcaRuntimeService codex-home forwarding path and the quoted-operator parser with tests. * Hide redundant mobile current worktree badges Co-authored-by: Orca <[email protected]> * Resume agent sessions from mobile history (#6969) Co-authored-by: Orca <[email protected]> * Adapt merged seams to main's lint and reply-sender hardening Co-authored-by: Orca <[email protected]> * Cap mobile project-scope paths to the aiVault RPC bound Co-authored-by: Orca <[email protected]> * Share the aiVault scopePaths bound between the RPC schema and mobile Co-authored-by: Orca <[email protected]> * Guard shared AI Vault inflight cleanup against concurrent key replacement The extracted cache module's .finally() cleared inflight tracking unconditionally, dropping the if (inflightKey === key) guard its sibling outer cache kept: an older scan resolving after a different-key scan replaced the tracking would null the newer scan's dedup slot, so a re-request started a duplicate transcript rescan. Mirrors the sibling guard; the regression test flushes a macrotask so a reverted guard fails fast on the call count instead of hanging. Co-authored-by: Orca <[email protected]> * Harden aiVault.listSessions contract and gate mobile header entry on capability - Clamp scopePaths (64) instead of rejecting, cap limit at 2000, and make executionHostId optional so mobile can omit it; restamp per caller. - Retain successful mobile terminal-create mutation ids for 60s so resume retries dedupe after transient socket drops. - Gate the session-header Agent History action on the aiVault.v1 capability (mirrors the host-list action) so old hosts never show a dead-end entry. - Fix stale contract comments (scopePaths clamp semantics; filters move includes quoted repo:/path: operator parsing). * Add subagent field to session test fixtures after #7423 merge AiVaultSession.subagent became required on main; the five fixtures added on this branch predate it. Top-level scanned sessions carry null. --------- Co-authored-by: Orca <[email protected]> Co-authored-by: Brennan Benson <[email protected]>
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
* Show agent session history on mobile Bring the desktop "Agent Session History" panel to Orca Mobile as a per-worktree screen: browse past agent transcript sessions across the host with scope tabs (Workspace/Project/All), search, grouping, session cards, and tap-to-read message previews. The transcript scan previously ran only over Electron IPC, so mobile could not reach it. Expose it over the runtime RPC protocol mobile already speaks (aiVault.listSessions) so the scan runs on whichever host owns the transcripts — correct for local and SSH/remote hosts. Both the desktop IPC handler and the new RPC method share one cache, so opening the desktop panel and the mobile screen never double-scan. The pure filter/group/display logic is lifted into /shared (the renderer re-exports it) so the standalone mobile package can reuse it. Mobile narrows scoped tabs client-side by cwd path-prefix because the host scan treats scope paths as a widening union. Resume-from-mobile is intentionally a follow-up. * Fix mobile agent history list rendering and RPC authorization - Authorize aiVault.listSessions in the mobile RPC allowlist so the mobile client's call is not rejected before dispatch (without this the screen could never load sessions at runtime). - Name each SectionList section's rows `data` (the field React Native reads) instead of `cards`, fixing a type error and silent empty-section rendering. * Address review feedback on agent session history - Match quoted repo:/path: search operator values so labels and paths with spaces match (e.g. path:"/Users/ada/My Project"). - Hold a scoped tab in loading until the worktree list resolves instead of firing an unscoped fetch that briefly shows unrelated host history; proceed once loaded even if the worktree is absent (no stuck spinner). - Clear cached host capabilities on disconnect/host-switch and failed status.get so a capability-gated action can't linger for a host that doesn't support it. - Cover the real OrcaRuntimeService codex-home forwarding path and the quoted-operator parser with tests. * Hide redundant mobile current worktree badges Co-authored-by: Orca <[email protected]> * Resume agent sessions from mobile history (stablyai#6969) Co-authored-by: Orca <[email protected]> * Adapt merged seams to main's lint and reply-sender hardening Co-authored-by: Orca <[email protected]> * Cap mobile project-scope paths to the aiVault RPC bound Co-authored-by: Orca <[email protected]> * Share the aiVault scopePaths bound between the RPC schema and mobile Co-authored-by: Orca <[email protected]> * Guard shared AI Vault inflight cleanup against concurrent key replacement The extracted cache module's .finally() cleared inflight tracking unconditionally, dropping the if (inflightKey === key) guard its sibling outer cache kept: an older scan resolving after a different-key scan replaced the tracking would null the newer scan's dedup slot, so a re-request started a duplicate transcript rescan. Mirrors the sibling guard; the regression test flushes a macrotask so a reverted guard fails fast on the call count instead of hanging. Co-authored-by: Orca <[email protected]> * Harden aiVault.listSessions contract and gate mobile header entry on capability - Clamp scopePaths (64) instead of rejecting, cap limit at 2000, and make executionHostId optional so mobile can omit it; restamp per caller. - Retain successful mobile terminal-create mutation ids for 60s so resume retries dedupe after transient socket drops. - Gate the session-header Agent History action on the aiVault.v1 capability (mirrors the host-list action) so old hosts never show a dead-end entry. - Fix stale contract comments (scopePaths clamp semantics; filters move includes quoted repo:/path: operator parsing). * Add subagent field to session test fixtures after stablyai#7423 merge AiVaultSession.subagent became required on main; the five fixtures added on this branch predate it. Top-level scanned sessions carry null. --------- Co-authored-by: Orca <[email protected]> Co-authored-by: Brennan Benson <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Resume to mobile Agent Session History. Tapping Resume resolves the session worktree first, falls back to the active route worktree when desktop would, guards unsupported targets, creates a fresh terminal in the resolved worktree, sends the shared AI Vault resume command with Enter, and navigates mobile to that session.
This PR is intentionally stacked on
brennanb2025/add-agents-to-mobile(PR1). It does not add desktop's copy/open/jump overflow actions to mobile; this PR is scoped to user-initiated resume.Follow-up parity fix: mobile worktree ordering now matches desktop ordering semantics for smart/Agent activity, recent, name, manual, repo collation, pinned overlay behavior, and no-grouping
Allsection behavior.Design Approach
The implementation follows
design-docs/mobile-agent-session-history-resume-pr2.mdand desktop's right-sidebar AI Vault resume behavior. Mobile now reuses the shared AI Vault command builder and startup planning path, including command overrides, default args/env, Windows shell family handling, Codex home handling, and POSIX command construction for SSH execution hosts.For ordering parity, mobile consumes the host/runtime summary fields that desktop owns (
sortOrder,manualOrder,lastActivityAt,createdAt,isMainWorktree,hasHostSidebarActivity, status metadata) instead of locally inventing different mobile-only ranking rules.Review And Completeness
Design-review outcome: the earlier PR2 design ambiguity was resolved in favor of current desktop parity: local and SSH targets are resumable, while runtime/unknown targets are blocked.
Implementation deviations: mobile now fetches
settings.getat resume time so command overrides/default launch settings are honored;worktree.psexposeshostId,terminalPlatform, ordering, and sidebar-activity fields; mobile RPC allowsfolderWorkspace.listandprojectGroup.listfor folder workspace target guards.Completeness verification: headline resume behavior is implemented for local and SSH worktrees; runtime-hosted and unknown workspaces remain intentionally blocked with an explanatory message. Headline ordering behavior is implemented for the data mobile receives from the host; mobile does not independently recompute desktop smart attention from live renderer pane state.
Broad app consistency: compared desktop AI Vault Resume, mobile history browse/preview, mobile terminal launch flows, SSH worktree behavior, folder workspace metadata, desktop sidebar sort comparators, pinned overlay behavior, and grouped/ungrouped workspace sections.
Risks And Non-goals
Non-goals: Copy Resume Command, Copy Session ID, open/reveal/jump actions, and other desktop overflow affordances are not added here.
Accepted risk: mobile depends on the host runtime's tab state after
session.tabs.createTerminal, matching existing mobile launch flows.Accepted gap update: Android emulator QA was refreshed on
sdk_gphone64_arm64; the mobile Resume tap-through created a freshTerminal 2indemo-project/mainand sent the shared-builder Codex resume command, but the seeded disposable fixture used a noncanonical session id so Codex returnedNo saved session found. A follow-up attempt with a canonical disposable session was blocked by an Android app ANR while selecting Agent Session History from the long-press worktree action sheet, so a fully successful live Codex resume remains unproven.Ordering caveat: smart/Agent activity parity uses desktop's persisted host
sortOrdersnapshot. If mobile must recompute live smart attention without that desktop/host snapshot, the runtime contract would need to carry live tab/pane attention inputs that are not part of this PR.Performance
Perf audit result: the resume hot path only does extra metadata fetches after explicit Resume intent, so history browsing/search remains unchanged. Session-worktree and target resolution are pure in-memory scans over already-loaded worktree/repo summaries. Ordering parity keeps sorting in-memory over the existing mobile list and uses deterministic comparators covered by unit tests.
Validation
Docker recovery:
docker infoinitially reported no daemon while stale Docker Desktop backend PID67939was present. I opened Docker, tried boundeddocker version/info/status/start/stopprobes, interrupted my own stuckdocker desktop stop, killed only stale Docker backend PID67939withSIGKILL, reopened Docker Desktop, and confirmeddocker inforeached Server29.2.1.SSH/runtime validation:
ORCA_E2E_SSH_DOCKER=1 pnpm exec playwright test tests/e2e/ssh-docker-relay-perf.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1 --grep "keeps an SSH workspace terminal usable"passed. This created a real Linux Docker SSH target, connected Orca to it, added a remote repo/worktree, created an SSH terminal, verified remote output before and after disconnect/reconnect, built the relay bundle, and cleaned up the container.Android emulator QA follow-up (2026-07-01):
emulator-5554, modelsdk_gphone64_arm64, boot completed, packagecom.stably.orca.mobileinstalled./tmp/orca-pr2-android-1782942367/android-loaded-clean.png,/tmp/orca-pr2-android-1782942367/android-connected-after-pair.png./tmp/orca-pr2-android-1782942367/android-main-longpress-actions.png, prior ready screen/tmp/orca-pr2-android-1782942367/android-agent-history-ready.png.Resumeopeneddemo-project/main, createdTerminal 2, and sentcd '/Users/thebr/source/repos/Stably/demo-project' && CODEX_HOME=... codex resume ...:/tmp/orca-pr2-android-1782942367/android-after-resume.png, settled command/error screenshot/tmp/orca-pr2-android-1782942367/android-after-resume-settled.png.session.tabs.listshowed two terminals for the demo worktree, withTerminal 2active andlaunchAgent: codex.Orca isn't responding:/tmp/orca-pr2-android-1782942367/android-agent-history-selected-second-tap.png,/tmp/orca-pr2-android-1782942367/android-after-anr-wait.png.Focused checks run:
pnpm --dir mobile test -- src/worktree/workspace-list-sections.test.ts src/worktree/mobile-workspace-lineage.test.ts src/worktree/worktree-list-snapshot.test.tspnpm --dir mobile test -- src/worktree/workspace-list-sections.test.tspnpm exec vitest run src/main/runtime/orca-runtime.test.ts -t "builds a compact worktree summary from persisted and live runtime state"pnpm --dir mobile exec vitest run src/session/session-panel-host.test.ts src/agent-history/agent-history-session-card.test.ts src/agent-history/agent-history-resume-target.test.tspnpm --dir mobile exec tsc --noEmitpnpm run typecheck:nodepnpm --dir mobile lintgit diff --checkEarlier focused checks:
cd mobile && pnpm exec vitest run src/agent-history src/session/ai-vault-resume-launch.test.ts(5 files, 49 tests)pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orca-runtime.test.ts(515 tests)pnpm exec oxlint <touched files>pnpm run typecheckcd mobile && pnpm exec tsc --noEmit -p tsconfig.jsonpnpm exec oxfmt --check <touched files>Post-PR Stabilization
After the latest push (
d46d908a08cd872502202adbed1bc33f11614cad), both GitHubverifychecks pass. No CodeRabbit issue or review comments were present in the PR review-comment API at the final sweep; the only PR issue comment is Stage's generated chapter summary.