Skip to content

fix(runtime): close restored PTYs with missing tabs - #12905

Closed
jarbas-marco wants to merge 1 commit into
stablyai:mainfrom
jarbas-marco:jarbas-marco/system-config-maintenance-20260805
Closed

jarbas-marco wants to merge 1 commit into
stablyai:mainfrom
jarbas-marco:jarbas-marco/system-config-maintenance-20260805

Conversation

@jarbas-marco

Copy link
Copy Markdown

Summary

  • Fixes orca terminal close for restored live PTYs whose renderer tab no longer exists in persisted session state.
  • Falls back to closing only the addressed PTY when the durable close reports the exact tab_not_found error; every other error still surfaces.
  • Adds regression coverage for the ghost-terminal state observed in packaged Orca.

Screenshots

No visual change

Testing

  • pnpm lint (targeted oxfmt --check, oxlint, and changed-code quality gate passed)
  • pnpm typecheck
  • pnpm test (targeted runtime/shared/CLI tests passed: 13 tests)
  • pnpm build
  • Added or updated high-quality tests that would catch regressions, or explained why tests were not needed

Post-rebase verification:

  • Runtime close cluster: 5 passed
  • Shared/CLI close coverage: 8 passed
  • Node TypeScript check passed
  • Formatting, lint, diff check, and changed-code quality gate passed

AI Review Report

Reviewed the rebased diff against origin/main. The review checked exact-handle behavior, split-pane safety, durable-session/renderer-graph divergence, error narrowing, and agent-team cleanup. Only the literal tab_not_found condition takes the PTY fallback; other failures are rethrown. The fallback delegates to the existing handle-scoped close path, so sibling panes are not selected for termination.

Cross-platform compatibility was checked for macOS, Linux, and Windows. This change is confined to Electron main-runtime state handling and uses the existing PTY controller abstraction; it adds no shortcuts, labels, paths, shell behavior, or platform-specific branches.

Security Audit

No new IPC surface, command execution, path handling, authentication, secret handling, or dependency was introduced. Existing RPC authorization and terminal-handle resolution remain in place. The catch is intentionally exact so unrelated runtime or persistence failures are not hidden.

Notes

The fault was reproduced against packaged Orca 1.4.173 and 1.4.174-rc.0. Inspection of the 1.4.175 source found the same affected path. No installed application bundle was hotpatched.

@jarbas-marco
jarbas-marco force-pushed the jarbas-marco/system-config-maintenance-20260805 branch from 9ec427c to d2b3c66 Compare August 6, 2026 11:18
@Jinwoo-H

Copy link
Copy Markdown
Contributor

Closing this submitted branch as the same missing-persisted-tab behavior is already represented by canonical PR #12922, which remains the owner implementation path. We will not merge this duplicate branch; the diagnosis and contribution remain credited to @jarbas-marco. No action is requested from you. Thank you.

@Jinwoo-H Jinwoo-H closed this Aug 31, 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.

2 participants