Skip to content

test(ci): reuse setup across PTY connection suites - #29193

Merged
nwparker merged 3 commits into
mainfrom
nwparker/ci-pty-test-groups
Oct 15, 2026
Merged

nwparker merged 3 commits into
mainfrom
nwparker/ci-pty-test-groups

Conversation

@nwparker

@nwparker nwparker commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 115 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​13578 $\color{#cf222e}{\Huge{\mathbf{−}}}$​14871 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1293
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​92 $\color{#cf222e}{\Huge{\mathbf{−}}}$​75 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​17

ELI5

CI runs the same 604 terminal connection cases with less repeated file setup. No jobs or workers are added.

What Changed

Group 53 PTY connection test files into seven entrypoints, retaining their cases in named registration modules. Keep the reattach-binding file separate because two cases replace a dispatcher mock implementation. Each original suite retains its fixtures, hooks and cleanup; subscriptions retain the binding that created them.

Name the shared mock module .spec.ts, matching the existing test-only path rules. This prevents test support from selecting product packaging and Electron layout jobs. Routing rules are unchanged.

Correct an existing pending-spawn test to read and clear the same dynamic module instance as the code under test. Check that the registry is populated before cancellation, making its existing empty-registry assertion meaningful.

Update 15 reliability gates to use grouped entrypoints. Preserve every historical executed command and link it to its current equivalent through an optional, validated currentCommand field. Add eight validator cases; assertion text and gate policy remain unchanged.

Why

These files repeatedly import the same terminal code. Grouping reduces 54 discovered PTY files to eight while retaining original suite fixtures and failure locations. The standalone reattach file preserves the separate mock lifetime its cases require. Explicit historical-command links preserve evidence of what actually ran.

Linked Issue

N/A — maintainer CI maintenance.

Visual Proof

N/A — test organization and validation metadata only; no product UI change.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Four candidate/baseline/baseline/candidate runs on exact base fd21909 and final head 3de5a8b pass all 628 baseline and 636 candidate cases: 604 original PTY cases, 24 existing validator cases, and eight new validator cases. Ordered cases, suites, options, tags and statuses reconcile through the explicit filename/parent-suite mapping. All 117 source-path states are bound to the measured source, with the original clean branch restored afterward.

Combined command median: 11.74s → 9.96s (15.1% faster). Summed module time: 36.69s → 27.30s (25.6% lower); PTY module time alone fell 25.8%. The validator adds about 0.055 worker-seconds for eight new cases. These local measurements do not establish a whole-CI speedup.

The corrected pending-spawn group passes all 78 cases. Deliberately preventing cancellation cleanup makes the corrected registry assertion fail with one retained entry; production source was restored byte-for-byte afterward. Renderer typecheck, changed-code quality, formatting and commit hooks pass on macOS. The manifest validates all 146 gates and all 32 validator cases pass. Earlier grouped and reversed registration runs passed all 604 PTY cases.

The superseded hosted run exposed the shared mock filename selecting additional product jobs. Both local and final-head hosted classification select static checks, typechecks and units, with packaging and layout jobs excluded. Final head 3de5a8b passes the full selected workflow and all 30 reported check contexts are successful or intentionally skipped. Exact-source verification reconciles all 12,146 discovered roots, their runtime routes and per-root case/status counts, including all 604 original PTY cases. Existing skipped roots are unchanged. Total unit runner time is 2,940 seconds versus 2,960 seconds in the earlier comparison run; this is observational and does not establish a whole-CI speedup. The run spent substantial time waiting for runners; queue time is separate from execution cost.

The composition with main 13b79a2 passes 682 cases across the PTY, validator and affected layout suites, plus renderer typecheck. Main then added only the separate skill-update workflow; its content is preserved in the proposed merge. The composed tree was checked locally; full hosted evidence remains bound to the PR run’s original base.

AI Disclosure

Review

Independent source reviews preserve original cases, hooks, timers and fixtures, with the explicit pending-spawn assertion improvement above. All 54 origins map exactly once; the original reattach file stays byte-identical. Grouping changes shared mock lifetime: a late continuation could access a later suite's bound state. Complete grouped and reversed-order runs observed no failing interleaving. Isolation, retries, deadlines, discovery rules and product code remain unchanged.

Independent manifest reviews preserve all 415 historical runs, 881 assertion arrays and 21 comments. Active commands only replace moved paths and remove duplicate grouped operands.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Existing local, SSH and folder-workspace cases remain. No new platform-specific behavior.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • Full selected CI passed for final head 3de5a8b; current-main product composition also passed focused local checks

@nwparker
nwparker force-pushed the nwparker/ci-pty-test-groups branch from d664792 to 821e6eb Compare October 15, 2026 18:25
@nwparker
nwparker marked this pull request as draft October 15, 2026 18:26
@nwparker
nwparker marked this pull request as ready for review October 15, 2026 18:26
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 39389dec-3476-4214-8c56-889a06bbad2e
📥 Commits

Reviewing files that changed from the base of the PR and between b55f7fb and 3de5a8b.

📒 Files selected for processing: 54
  • src/renderer/src/components/terminal-pane/pty-connection-agent-session-resume.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-cold-restore-agent-resume.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-cold-restore-repaint.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-cold-restore-resume-command.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-command-finished-cleanup.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-daemon-snapshot-replay.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-deferred-reattach-live-output.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-deliberate-sleep-guard.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-foreground-agent-routing.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-foreground-agent-sampling.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-foreground-process-exit.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-foreground-routing-confirmation.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-foreground-write-path.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-fresh-spawn-guards.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hibernation-wake.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-atlas-recovery.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-backlog-reconciliation.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-codex-queries.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-delivery-gate.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-output-restore.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-query-snapshot-restore.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-snapshot-live-overlap.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-snapshot-resize-signals.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-tui-snapshot-replay.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hook-completion-bell-arbitration.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hook-completion-side-effects.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-interrupt-inference.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-kitty-keyboard-restore.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-main-side-effect-authority.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-mocks.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-mode-2031-subscriptions.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-notification-settings-gating.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-park-reveal-model-snapshot.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-pending-spawn.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-pty-exit-teardown.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-reattach-mode-reset.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-remote-runtime-attach.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-renderer-risk-repaint.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-replay-payload-handling.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-restart-replacement.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-runtime-owner-spawn-routing.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-session-liveness.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-setup-split-spawn.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-sleeping-resume-banner.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-stalled-hidden-restore.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-startup-command-delivery.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-startup-draft-delivery.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-task-complete-dispatch.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-terminal-input-gating.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-typed-agent-identity.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-unanswered-command-finish.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-visibility-resume-size.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-windows-cjk-repaint.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-windows-keyboard-reset.spec.ts
💤 Files with no reviewable changes: 1
  • src/renderer/src/components/terminal-pane/pty-connection-mocks.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📝 Walkthrough

Reliability-gate validation now accepts an optional currentCommand and checks it against declared commands. Gate records point to revised test commands and references. PTY connection tests have been split into focused suites, registered through Vitest entry points, and supplied with shared mocks. The reported changes are to test coverage and configuration; no product implementation or public declarations changed.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 3de5a

No actionable merge-blocking issue is established for this test and reliability-gate update. It is mergeable after normal checks.

Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 10.49% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 143 functions across 57 files. (4 skipped… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
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.
Title check Passed The title clearly and concisely describes the main change: reusing setup across PTY connection test suites.
Description check Passed The description follows the repository template and explains the grouping changes, rationale, testing, reliability-gate updates, review considerations, and checklist status. The maintainer-specific Li…
Full details: Docstring Coverage

Explanation

Docstring coverage is 10.49% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 143 functions across 57 files. (4 skipped: 4 over the file limit.)

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 58808c44-9d1a-4ba8-aaad-68dc4a1c3c8d
📥 Commits

Reviewing files that changed from the base of the PR and between fd21909 and b55f7fb.

📒 Files selected for processing: 117
  • config/reliability-gates.jsonc
  • config/scripts/check-reliability-gates.mjs
  • config/scripts/check-reliability-gates.test.mjs
  • src/renderer/src/components/terminal-pane/pty-connection-agent-session-resume.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-agent-session-resume.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-cold-restore-agent-resume.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-cold-restore-agent-resume.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-cold-restore-repaint.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-cold-restore-repaint.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-cold-restore-resume-command.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-cold-restore-resume-command.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-command-finished-cleanup.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-command-finished-cleanup.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-completion-and-notification.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-daemon-snapshot-replay.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-daemon-snapshot-replay.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-deferred-reattach-live-output.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-deferred-reattach-live-output.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-deliberate-sleep-guard.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-deliberate-sleep-guard.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-foreground-agent-routing.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-foreground-agent-routing.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-foreground-agent-sampling.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-foreground-agent-sampling.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-foreground-agent.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-foreground-process-exit.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-foreground-process-exit.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-foreground-routing-confirmation.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-foreground-routing-confirmation.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-foreground-write-path.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-foreground-write-path.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-fresh-spawn-guards.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-fresh-spawn-guards.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hibernation-wake.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hibernation-wake.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-atlas-recovery.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-atlas-recovery.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-backlog-reconciliation.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-backlog-reconciliation.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-codex-queries.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-codex-queries.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-delivery-gate.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-delivery-gate.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-output-restore.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-output-restore.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-query-snapshot-restore.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-query-snapshot-restore.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-replay.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-snapshot-live-overlap.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-snapshot-live-overlap.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-snapshot-resize-signals.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-snapshot-resize-signals.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-tui-snapshot-replay.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-tui-snapshot-replay.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hook-completion-bell-arbitration.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hook-completion-bell-arbitration.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hook-completion-side-effects.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hook-completion-side-effects.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-input-and-repaint.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-interrupt-inference.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-interrupt-inference.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-kitty-keyboard-restore.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-kitty-keyboard-restore.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-main-side-effect-authority.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-main-side-effect-authority.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-mode-2031-subscriptions.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-mode-2031-subscriptions.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-notification-settings-gating.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-notification-settings-gating.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-park-reveal-model-snapshot.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-park-reveal-model-snapshot.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-pending-spawn.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-pending-spawn.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-pty-exit-teardown.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-pty-exit-teardown.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-reattach-mode-reset.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-reattach-mode-reset.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-remote-runtime-attach.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-remote-runtime-attach.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-renderer-risk-repaint.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-renderer-risk-repaint.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-replay-payload-handling.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-replay-payload-handling.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-restart-replacement.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-restart-replacement.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-restore-and-resume.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-runtime-owner-spawn-routing.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-runtime-owner-spawn-routing.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-session-liveness.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-session-liveness.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-setup-split-spawn.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-setup-split-spawn.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-sleeping-resume-banner.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-sleeping-resume-banner.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-spawn-and-startup.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-stalled-hidden-restore.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-stalled-hidden-restore.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-startup-command-delivery.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-startup-command-delivery.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-startup-draft-delivery.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-startup-draft-delivery.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-task-complete-dispatch.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-task-complete-dispatch.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-terminal-input-gating.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-terminal-input-gating.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-test-mocks.ts
  • src/renderer/src/components/terminal-pane/pty-connection-typed-agent-identity.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-typed-agent-identity.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-unanswered-command-finish.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-unanswered-command-finish.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-visibility-and-exit.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-visibility-resume-size.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-visibility-resume-size.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-windows-cjk-repaint.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-windows-cjk-repaint.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-windows-keyboard-reset.spec.ts
  • src/renderer/src/components/terminal-pane/pty-connection-windows-keyboard-reset.test.ts
💤 Files with no reviewable changes: 16
  • src/renderer/src/components/terminal-pane/pty-connection-agent-session-resume.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-foreground-agent-sampling.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-command-finished-cleanup.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-daemon-snapshot-replay.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-cold-restore-resume-command.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-foreground-agent-routing.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hidden-atlas-recovery.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-fresh-spawn-guards.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-foreground-write-path.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-foreground-process-exit.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-cold-restore-repaint.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-cold-restore-agent-resume.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-foreground-routing-confirmation.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-deferred-reattach-live-output.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-hibernation-wake.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-deliberate-sleep-guard.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@nwparker
nwparker merged commit 2c100ef into main Oct 15, 2026
30 checks passed
brennanb2025 added a commit that referenced this pull request Oct 16, 2026
Main grouped the PTY connection suites (#29193) and moved this file to a .spec.ts registered from pty-connection-spawn-and-startup.test.ts. Taking main's copy here keeps the following main merge free of a modify/delete conflict; this PR's test changes are reapplied after the merge.
brennanb2025 added a commit that referenced this pull request Oct 16, 2026
…n under its line limit

The deliberate-sleep spec moved in #29193; this carries the PR's changes into it: a pane mounted after wake waits for issued teardown, an unqualified pane waits for every same-id host's teardown, and a queued startup waits too.

The merge left claude-structured-session-acquisition.ts over 300 lines. resolveClaudeAcquisitionError, which already builds the exit-unproven error, now decides whether to release the acquisition.
brennanb2025 added a commit that referenced this pull request Oct 19, 2026
* fix(sidebar): Sleep stops a workspace's native chat agents

Sleeping a workspace stopped terminals and browsers but never its structured (native)
chats, so their claude/codex process kept running, and Sleep was disabled for a
workspace whose only content was a chat.

Sleep now stops each chat's agent through a new agentSession.sleep (the host's close,
keeping the tab), routed to the host recorded on the chat's tab; an older host without
the capability fails Sleep with a clear message. The Sleep menu counts a chat.

* Fix native chat Sleep ownership and delayed teardown

* Stop native chat sessions when sleeping their workspace

* Fix sleep teardown wake and host-qualified receipt races

* Verify mobile Sleep sends the selected desktop host

* Keep worktree Sleep RPC within method file limit

* Use sleep intent as attempt identity

* Gate workspace sleep on structured client support

* fix(native-chat): preserve sleep stop receipts and send timing

* fix(native-chat): keep superseded workspace sleeps quiet

* fix(native-chat): ignore superseded failed sleep stops

* Fix sleep lifetime test resolver types

* Accept workspace Sleep for already ended chats

* Sleep native chats through the shared no-toast sleep core

Main split runSleepWorktrees into sleepWorktreesReportingFailures (no toast) and
a toasting wrapper. Move the native chat stop, host routing and typed failures
into the shared core so the WSL move's Sleep request also stops chats, and
report every workspace not verifiably slept (an unconfirmed chat stop included)
in failedWorktreeIds. Fold one ACP adapter field onto a line so main's file plus
this PR's ownership check stays within the file length limit.

* Import isStructuredTab from its shared module

* fix(native-chat): leave chat rows to their host through Sleep

Sleep's worktree status drop deleted the chat's row, which the host feed then
rewrote, so the outcome depended on which write landed last. Open chat tabs
own their rows (same rule as terminal-tab close), and a chat only makes a
workspace sleepable while its host holds the agent's process.

* fix(native-chat): judge the Sleep receipt by facts, not lane occupancy

A running chat's stop queues the provider's own requested-close end report
onto the chat's lane, so the lane-occupancy check read every proven stop as
superseded and dropped its receipt. Later work now counts only once it
exists: a moved fence, a child, delivery, child work, a pending submission,
a pending create or attach, or an open dispatch.

* test(native-chat): report a fake close's end only for an acquired child

* Preserve canonical workspace identity when sleeping

* Propagate optional sleep host through file command contract

* Move the deliberate-sleep PTY tests to main's spec file

Main grouped the PTY connection suites (#29193) and moved this file to a .spec.ts registered from pty-connection-spawn-and-startup.test.ts. Taking main's copy here keeps the following main merge free of a modify/delete conflict; this PR's test changes are reapplied after the merge.

* Reapply Sleep's teardown waits to the moved PTY spec; keep acquisition under its line limit

The deliberate-sleep spec moved in #29193; this carries the PR's changes into it: a pane mounted after wake waits for issued teardown, an unqualified pane waits for every same-id host's teardown, and a queued startup waits too.

The merge left claude-structured-session-acquisition.ts over 300 lines. resolveClaudeAcquisitionError, which already builds the exit-unproven error, now decides whether to release the acquisition.

* test: keep the Sleep receipt checks on the closed handle and kept record

* fix(sidebar): a single-workspace Sleep failure says workspace, not workspaces

* fix(sidebar): Sleep stops a workspace's chats on every host that has a copy

* test: drop redundant casts from the Sleep flow test state

* fix(sidebar): stop a workspace's chats after its terminals, leaving main's teardown owner check as is

* fix: admit workspace chat stops before teardown waits

* fix: retain browser teardown caller sequencing

* fix: retire failed acquisitions after observed root exit
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