Skip to content

Resume agents after PTY cold restore - #5045

Merged
Jinwoo-H merged 1 commit into
mainfrom
Jinwoo-H/feature-improve-agent-session-restoration-for-ce
Jun 9, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
Jinwoo-H/feature-improve-agent-session-restoration-for-ce

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • resume cached provider sessions when restored PTY reattach falls back to daemon cold-restore or a replacement shell
  • keep live snapshot/replay reattach behavior unchanged so surviving PTYs do not duplicate agent processes
  • add regression coverage for cold-restore resume and live-snapshot non-resume paths

Context

Issue #4698 asks whether Orca already does what Herdr does for restored agent sessions. The answer was: normal app crashes should keep daemon PTYs alive and Orca already reattaches those, and #4706 added provider-session resume for slept worktrees. The missing case was when the PTY daemon/session itself is gone: Orca restored scrollback into a fresh shell but did not launch the provider resume command, which matches the reported blank-terminal symptom.

This patch connects the existing provider-session metadata and resume-command builder to that cold-restore/fresh-fallback path.

Closes #4698
Closes #4557

Verification

  • pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-connection.test.ts
  • pnpm exec vitest run --config config/vitest.config.ts src/shared/agent-session-resume.test.ts src/shared/tui-agent-startup.test.ts src/main/daemon/daemon-pty-adapter.test.ts
  • pnpm run typecheck:web
  • git diff --check
  • pnpm run lint -- src/renderer/src/components/terminal-pane/pty-connection.ts src/renderer/src/components/terminal-pane/pty-connection.test.ts

Notes: lint passed with existing unrelated react-hooks warnings in WorktreeJumpPalette.tsx and useSettingsNavigationMetadata.ts.

Made with Orca 🐋

@Jinwoo-H
Jinwoo-H merged commit 280db4a into main Jun 9, 2026
2 checks passed
@Jinwoo-H
Jinwoo-H deleted the Jinwoo-H/feature-improve-agent-session-restoration-for-ce branch June 9, 2026 21:36
Jinwoo-H added a commit that referenced this pull request Jun 11, 2026
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Improve agent session restoration for certain edge cases [Bug]: Awaking sleeping session does not start agent automatically

1 participant