Skip to content

test(worktree): lock fail-closed invariant behind the #9197 selector_not_found swallow - #11073

Draft
OrcaWin wants to merge 1 commit into
stablyai:mainfrom
OrcaWin:salvage-9197-failclosed
Draft

OrcaWin wants to merge 1 commit into
stablyai:mainfrom
OrcaWin:salvage-9197-failclosed

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #9625 (which landed the selector_not_found swallow for WSL worktree deletion, superseding #9601).

#9625's test covers the happy path — a swallowed selector_not_found means "no graph terminals to stop", so a clean delete proceeds. This adds the pairing invariant that swallow quietly depends on: a provider-visible PTY that genuinely cannot be physically stopped must still fail the destructive delete closed, even when the runtime selector can't resolve.

The swallow relaxes only the renderer-graph sweep. If it ever leaked into the provider-visible fail-closed path, a wedged PTY on a WSL \wsl.localhost↔\wsl$ alias miss would let filesystem removal proceed over a live process. This test locks that boundary.

Requested by @nwparker when closing #9601 as superseded — landing the salvageable regression test separately.

… swallowed but a PTY refuses to stop (stablyai#9197)

Follow-up to stablyai#9625, which landed the selector_not_found swallow. That test
covers the happy path (no graph terminals to stop); this adds the pairing
invariant the swallow depends on: a provider-visible PTY that cannot be
physically stopped must still fail the destructive delete closed. Requested
by @nwparker when closing stablyai#9601 as superseded.
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 34c33052-9abb-4bde-b0a4-55c8b03234fc

📥 Commits

Reviewing files that changed from the base of the PR and between e104010 and b76088b.

📒 Files selected for processing (1)
  • src/main/runtime/worktree-teardown.test.ts

📝 Walkthrough

Walkthrough

Adds a Vitest case for killAllProcessesForWorktree where runtime selection fails with selector_not_found, a provider PTY remains present, and its shutdown rejects. The test verifies that teardown rejects with Failed to physically stop every PTY rather than proceeding with filesystem removal.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the summary but omits the required template sections for screenshots, testing checklist, AI review report, security audit, and notes. Add the missing sections from the template, including screenshots/no visual change, testing checklist, AI review report, security audit, and notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: a worktree regression test around the selector_not_found swallow and fail-closed behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@OrcaWin

OrcaWin commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator Author

Moving this PR to draft because it has been untouched for more than 80 days (latest recorded PR activity or commit timestamp: 2026-07-28T03:30:14Z; checked on 2026-10-27). This keeps the review queue focused on active work while preserving the proposal. Please mark it ready for review when work resumes.

This branch has not been deployed

No deployments
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