Repository navigation
test(ci): reuse setup across PTY connection suites - #29193
Conversation
d664792 to
821e6eb
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
58808c44-9d1a-4ba8-aaad-68dc4a1c3c8d
📒 Files selected for processing: 117
config/reliability-gates.jsoncconfig/scripts/check-reliability-gates.mjsconfig/scripts/check-reliability-gates.test.mjssrc/renderer/src/components/terminal-pane/pty-connection-agent-session-resume.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-agent-session-resume.test.tssrc/renderer/src/components/terminal-pane/pty-connection-cold-restore-agent-resume.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-cold-restore-agent-resume.test.tssrc/renderer/src/components/terminal-pane/pty-connection-cold-restore-repaint.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-cold-restore-repaint.test.tssrc/renderer/src/components/terminal-pane/pty-connection-cold-restore-resume-command.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-cold-restore-resume-command.test.tssrc/renderer/src/components/terminal-pane/pty-connection-command-finished-cleanup.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-command-finished-cleanup.test.tssrc/renderer/src/components/terminal-pane/pty-connection-completion-and-notification.test.tssrc/renderer/src/components/terminal-pane/pty-connection-daemon-snapshot-replay.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-daemon-snapshot-replay.test.tssrc/renderer/src/components/terminal-pane/pty-connection-deferred-reattach-live-output.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-deferred-reattach-live-output.test.tssrc/renderer/src/components/terminal-pane/pty-connection-deliberate-sleep-guard.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-deliberate-sleep-guard.test.tssrc/renderer/src/components/terminal-pane/pty-connection-foreground-agent-routing.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-foreground-agent-routing.test.tssrc/renderer/src/components/terminal-pane/pty-connection-foreground-agent-sampling.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-foreground-agent-sampling.test.tssrc/renderer/src/components/terminal-pane/pty-connection-foreground-agent.test.tssrc/renderer/src/components/terminal-pane/pty-connection-foreground-process-exit.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-foreground-process-exit.test.tssrc/renderer/src/components/terminal-pane/pty-connection-foreground-routing-confirmation.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-foreground-routing-confirmation.test.tssrc/renderer/src/components/terminal-pane/pty-connection-foreground-write-path.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-foreground-write-path.test.tssrc/renderer/src/components/terminal-pane/pty-connection-fresh-spawn-guards.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-fresh-spawn-guards.test.tssrc/renderer/src/components/terminal-pane/pty-connection-hibernation-wake.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-hibernation-wake.test.tssrc/renderer/src/components/terminal-pane/pty-connection-hidden-atlas-recovery.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-hidden-atlas-recovery.test.tssrc/renderer/src/components/terminal-pane/pty-connection-hidden-backlog-reconciliation.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-hidden-backlog-reconciliation.test.tssrc/renderer/src/components/terminal-pane/pty-connection-hidden-codex-queries.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-hidden-codex-queries.test.tssrc/renderer/src/components/terminal-pane/pty-connection-hidden-delivery-gate.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-hidden-delivery-gate.test.tssrc/renderer/src/components/terminal-pane/pty-connection-hidden-output-restore.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-hidden-output-restore.test.tssrc/renderer/src/components/terminal-pane/pty-connection-hidden-query-snapshot-restore.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-hidden-query-snapshot-restore.test.tssrc/renderer/src/components/terminal-pane/pty-connection-hidden-replay.test.tssrc/renderer/src/components/terminal-pane/pty-connection-hidden-snapshot-live-overlap.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-hidden-snapshot-live-overlap.test.tssrc/renderer/src/components/terminal-pane/pty-connection-hidden-snapshot-resize-signals.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-hidden-snapshot-resize-signals.test.tssrc/renderer/src/components/terminal-pane/pty-connection-hidden-tui-snapshot-replay.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-hidden-tui-snapshot-replay.test.tssrc/renderer/src/components/terminal-pane/pty-connection-hook-completion-bell-arbitration.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-hook-completion-bell-arbitration.test.tssrc/renderer/src/components/terminal-pane/pty-connection-hook-completion-side-effects.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-hook-completion-side-effects.test.tssrc/renderer/src/components/terminal-pane/pty-connection-input-and-repaint.test.tssrc/renderer/src/components/terminal-pane/pty-connection-interrupt-inference.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-interrupt-inference.test.tssrc/renderer/src/components/terminal-pane/pty-connection-kitty-keyboard-restore.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-kitty-keyboard-restore.test.tssrc/renderer/src/components/terminal-pane/pty-connection-main-side-effect-authority.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-main-side-effect-authority.test.tssrc/renderer/src/components/terminal-pane/pty-connection-mode-2031-subscriptions.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-mode-2031-subscriptions.test.tssrc/renderer/src/components/terminal-pane/pty-connection-notification-settings-gating.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-notification-settings-gating.test.tssrc/renderer/src/components/terminal-pane/pty-connection-park-reveal-model-snapshot.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-park-reveal-model-snapshot.test.tssrc/renderer/src/components/terminal-pane/pty-connection-pending-spawn.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-pending-spawn.test.tssrc/renderer/src/components/terminal-pane/pty-connection-pty-exit-teardown.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-pty-exit-teardown.test.tssrc/renderer/src/components/terminal-pane/pty-connection-reattach-mode-reset.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-reattach-mode-reset.test.tssrc/renderer/src/components/terminal-pane/pty-connection-remote-runtime-attach.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-remote-runtime-attach.test.tssrc/renderer/src/components/terminal-pane/pty-connection-renderer-risk-repaint.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-renderer-risk-repaint.test.tssrc/renderer/src/components/terminal-pane/pty-connection-replay-payload-handling.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-replay-payload-handling.test.tssrc/renderer/src/components/terminal-pane/pty-connection-restart-replacement.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-restart-replacement.test.tssrc/renderer/src/components/terminal-pane/pty-connection-restore-and-resume.test.tssrc/renderer/src/components/terminal-pane/pty-connection-runtime-owner-spawn-routing.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-runtime-owner-spawn-routing.test.tssrc/renderer/src/components/terminal-pane/pty-connection-session-liveness.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-session-liveness.test.tssrc/renderer/src/components/terminal-pane/pty-connection-setup-split-spawn.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-setup-split-spawn.test.tssrc/renderer/src/components/terminal-pane/pty-connection-sleeping-resume-banner.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-sleeping-resume-banner.test.tssrc/renderer/src/components/terminal-pane/pty-connection-spawn-and-startup.test.tssrc/renderer/src/components/terminal-pane/pty-connection-stalled-hidden-restore.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-stalled-hidden-restore.test.tssrc/renderer/src/components/terminal-pane/pty-connection-startup-command-delivery.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-startup-command-delivery.test.tssrc/renderer/src/components/terminal-pane/pty-connection-startup-draft-delivery.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-startup-draft-delivery.test.tssrc/renderer/src/components/terminal-pane/pty-connection-task-complete-dispatch.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-task-complete-dispatch.test.tssrc/renderer/src/components/terminal-pane/pty-connection-terminal-input-gating.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-terminal-input-gating.test.tssrc/renderer/src/components/terminal-pane/pty-connection-test-mocks.tssrc/renderer/src/components/terminal-pane/pty-connection-typed-agent-identity.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-typed-agent-identity.test.tssrc/renderer/src/components/terminal-pane/pty-connection-unanswered-command-finish.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-unanswered-command-finish.test.tssrc/renderer/src/components/terminal-pane/pty-connection-visibility-and-exit.test.tssrc/renderer/src/components/terminal-pane/pty-connection-visibility-resume-size.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-visibility-resume-size.test.tssrc/renderer/src/components/terminal-pane/pty-connection-windows-cjk-repaint.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-windows-cjk-repaint.test.tssrc/renderer/src/components/terminal-pane/pty-connection-windows-keyboard-reset.spec.tssrc/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.
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.
…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.
* 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
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
currentCommandfield. 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
Four candidate/baseline/baseline/candidate runs on exact base
fd21909and final head3de5a8bpass 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
3de5a8bpasses 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
13b79a2passes 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
Notes
Existing local, SSH and folder-workspace cases remain. No new platform-specific behavior.
Checklist
3de5a8b; current-main product composition also passed focused local checks