Resume agent sessions from mobile history#6969
Merged
brennanb2025 merged 16 commits intoJul 3, 2026
Merged
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 <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
1a2b64b
into
brennanb2025/add-agents-to-mobile
2 checks passed
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.