Skip to content

test(e2e): force the stale-title window in the live-reattach mode check - #35936

Merged
nwparker merged 1 commit into
mainfrom
test-live-reattach-title-pin
Oct 29, 2026
Merged

nwparker merged 1 commit into
mainfrom
test-live-reattach-title-pin

Conversation

@nwparker

@nwparker nwparker commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​62 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​61
Prod 0 0 0 0

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:

  • 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.

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, focus false).

  • 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
@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This test-only change appears safe to merge.

Summary

This test-only change forces the stale-title window during a serve restart.

  • The live-reattach test holds the stale title through a serve restart.

No actionable issues were found. No tests were run during this review.

Reviews (1) · Last reviewed commit: "test(e2e): force the stale-title window ..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

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: Passed 5
Check name Status Explanation
Title check Passed The title clearly identifies the main change: forcing the stale-title window in the live-reattach end-to-end test.
Description check Passed 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 Passed 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 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.
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.

❤️ 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

Nitpick comments: 1
tests/e2e/paired-serve-respawn-process-state.spec.ts: 1

191-191: Trivial · Functional Correctness · Quick win

Assert the reattached title through the DOM.

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.

Files selected for processing: 1
  • tests/e2e/paired-serve-respawn-process-state.spec.ts

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

},
runtimePaneTitlesByTabId: {
...state.runtimePaneTitlesByTabId,
[id]: { ...state.runtimePaneTitlesByTabId[id], [paneId]: pinnedTitle ?? '' }

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.

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)

@nwparker
nwparker merged commit 8cc6878 into main Oct 29, 2026
46 checks passed
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