You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(e2e): force the stale-title window in the live-reattach mode check - #35936
#35920 fixed a timing bug: after a server restart, a live agent's mouse and focus settings could be switched off. The test for it only caught the bad timing about one run in five. This makes the test hit that timing on every run.
What Changed
This changes the test only. In paired-serve-respawn-process-state.spec.ts, the step that restarts serve and keeps the same process now does two things for the length of the restart:
pins the paired client's published pane title to the tab default ("Terminal 1");
clears that pane's status.
That is the exact state the client is in when the host has not yet republished the live title. The reattach image's own title therefore has to prove the live agent on its own. The pin is a page-side store subscription that is released through a JSHandle. There are no production seams.
Why
Relying on timing that lands in the window about one run in five leaves #35920 effectively unguarded. A host-side delay would not reproduce the bug faithfully. The snapshot's title comes from the same tracker the delayed seed writes, so delaying the seed also removes the title the fix reads. The real race is the client seeing the stale published title, and this pins exactly that.
With them (current main), it passes in every run: 4/4, 2/2, 2/2, 3/3 and 3/3. Releasing the pin restores the client's prior title and status, so the respawn step after it still starts from the live agent's title.
check:changed passes (13/13), including the flaky-pattern and e2e typecheck ratchets. Codex: no findings.
Tested on macOS. The spec is skipped on Windows because it uses POSIX printf.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
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
Test-only change. It has no effect on security, cross-platform behavior, SSH, mobile or compatibility.
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)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
The same-process serve restart step relied on timing to land the reattach
replay inside the window where the host still publishes the tab-default
title, which happened about one run in five. Pin the client's published
pane title to the tab default and clear its pane status for the duration
of the restart, so the replayed image's own title alone must prove the
live agent. The check fails 3/3 without #35920 and passes with it.
Refs #35559
The end-to-end test adds a helper that pins a pane’s published title to Terminal 1 and removes its agent-status entries during store updates. The test uses this helper during a serve-process restart, verifies that the reattached pane retains its terminal modes, then releases the pin and checks that the live Claude Code title returns.
Priority: Low
Merge Risk: Moderate · up to 598dc
The restart test can pass without proving that reattachment restores the live title or that the tab displays it. Strengthen those assertions before merging this test-only change.
Pre-merge checks: 5
Check name
Status
Explanation
Title check
The title clearly identifies the main change: forcing the stale-title window in the live-reattach end-to-end test.
Description check
The description is complete and focused. It explains the problem, test-only change, rationale, linked issue reference, testing results, platform scope, and checklist status. The linked issue uses `Ref…
Docstring Coverage
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Description check
Explanation
The description is complete and focused. It explains the problem, test-only change, rationale, linked issue reference, testing results, platform scope, and checklist status. The linked issue uses Refs #35559 instead of the template's Fixes # format, but the issue reference is present.
Full details: Docstring Coverage
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.
Finishing Touches
📝 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.
The E2E rule applies. readPaneState reads store state, while the test must also validate the user-visible tab title. The existing toBeVisible() check confirms only that the tab exists. Add a DOM title assertion after reattach and keep the store assertion for the post-restart title source.
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 58bf7aa2-ad34-4974-9b4b-e302134590e1
Commits
Reviewing files that changed from the base of the PR and between 010d0d5 and 598dc53.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Major · Functional Correctness · Quick win
Do not restore the pre-restart title as proof of reattachment.
The test confirms that pinnedTitle contains “Claude Code” before the restart. The release callback then writes that captured value back. As a result, the new assertion can pass even if the reattach image never restores the live title. Check the post-restart title from the reattach path before restoring test state. (raw.githubusercontent.com)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
#35920 fixed a timing bug: after a server restart, a live agent's mouse and focus settings could be switched off. The test for it only caught the bad timing about one run in five. This makes the test hit that timing on every run.
What Changed
This changes the test only. In
paired-serve-respawn-process-state.spec.ts, the step that restarts serve and keeps the same process now does two things for the length of the restart:That is the exact state the client is in when the host has not yet republished the live title. The reattach image's own title therefore has to prove the live agent on its own. The pin is a page-side store subscription that is released through a
JSHandle. There are no production seams.Why
Relying on timing that lands in the window about one run in five leaves #35920 effectively unguarded. A host-side delay would not reproduce the bug faithfully. The snapshot's title comes from the same tracker the delayed seed writes, so delaying the seed also removes the title the fix reads. The real race is the client seeing the stale published title, and this pins exactly that.
Linked Issue
Refs #35559
Visual Proof
N/A. This is a test-only change.
Testing
Without fix(terminal): judge live-agent reattach modes by the image's own title #35920's production changes, the check fails 3/3 (mouse
none, focusfalse).With them (current main), it passes in every run: 4/4, 2/2, 2/2, 3/3 and 3/3. Releasing the pin restores the client's prior title and status, so the respawn step after it still starts from the live agent's title.
check:changed passes (13/13), including the flaky-pattern and e2e typecheck ratchets. Codex: no findings.
Tested on macOS. The spec is skipped on Windows because it uses POSIX
printf.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Agent skill upstream boundary
Notes
Test-only change. It has no effect on security, cross-platform behavior, SSH, mobile or compatibility.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)