Skip to content

fix(terminal): reattach panes across daemon protocol upgrade - #12351

Merged
OrcaWin merged 1 commit into
mainfrom
fix-rc-terminal-owner-unknown
Aug 3, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
fix-rc-terminal-owner-unknown

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • restore terminal panes hosted by the preserved v1.4.167 protocol-v30 daemon
  • keep native atomic attach-only behavior for protocol v31+
  • reject and immediately retire any replacement session created by a legacy exit race
  • strip launch commands and agent metadata from stable-pane adoption requests

Regression

cd68a8b00c introduced protocol-v31 stable-pane attachOnly, while the compatibility router intentionally preserved live v30 daemons from v1.4.167. Every restored pane was routed to its valid v30 owner and then rejected locally with terminal_pane_owner_unknown before any daemon RPC.

Validation

  • pnpm exec vitest run --config config/vitest.config.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/daemon/daemon-pty-router.test.ts src/main/daemon/degraded-daemon-pty-provider.test.ts --reporter=dot
  • pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty.test.ts -t 'persisted owner|stable-pane owner|completed runtime-owned pane' --reporter=dot
  • pnpm run typecheck:node
  • pnpm run check:code-quality:changed
  • pnpm run check:max-lines-ratchet
  • pnpm run check:reliability-gates

@OrcaWin
OrcaWin merged commit e5174a4 into main Aug 3, 2026
47 checks passed
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6f4561da-e385-4f9a-adc0-7cc0d9441cf1

📥 Commits

Reviewing files that changed from the base of the PR and between a4944f5 and 991a7f0.

📒 Files selected for processing (2)
  • src/main/daemon/daemon-pty-adapter.test.ts
  • src/main/daemon/daemon-pty-adapter.ts

📝 Walkthrough

Walkthrough

The PTY adapter now handles attach-only spawning during execution instead of rejecting legacy protocols at entry. It omits creation parameters for attach-only requests and sends the attach-only flag only to supported daemons. Legacy emulation rejects unexpected replacement sessions with SessionNotFoundError after immediate cleanup. Tests cover stable-pane reattachment and replacement-session race handling.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant