Skip to content

test(prototype): wait for the frame's Esc to reach the host - #16692

Merged
kyle-sexton merged 1 commit into
mainfrom
fix/harness-browser-esc-wait
Nov 17, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
fix/harness-browser-esc-wait

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

No related issue: a test-only fix for one flaky check that turned main red (run 44005379679 attempt 1); the incident the monitoring lane filed for it, #16690, carries no spec text and closes itself once main stays green.

Summary

harness-browser.test.sh failed once on main ("FAIL Esc in the frame ends pick mode"); attempt 2 of the same run passed on the same commit. This PR removes the race behind that failure. Nothing else is in scope.

Fix

The frame relays Esc to the host page by postMessage (plugins/prototype/notes-bridge/host.html message listener), so the host clears pick mode one task later. The harness read aria-pressed at once. It now waits up to 5 s for #pick[aria-pressed="false"] and records a FAIL if it never comes, so the check still fails when Esc does not end pick mode.

Verification

  • With Chrome for Testing installed locally, the fixed test passed 10 of 10 runs.
  • The unfixed test also passed 10 of 10 locally, so the race shows only under CI load; the fix rests on the asynchronous relay, not on a local repro.
  • Test Bash passed on this head in CI.

Related

🤖 Generated with Claude Code

The frame relays Esc to the host page by postMessage, so the host clears
pick mode one task later. The harness read aria-pressed at once and
failed when the message had not landed yet (main run 44005379679,
attempt 1; attempt 2 passed). Wait up to 5 s for the attribute instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T05:11:40.599858Z 96a94f5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 96a94f53e48071f2062ac31a1591405b8d20ee37: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Security review: no security issues found

I read both changed files in full:

  • .changes/prototype/fix-harness-browser-esc-wait-88284d5c.md is a new changeset fragment (bump: none) with a one-line note.
  • plugins/prototype/skills/explore-directions/scripts/harness-browser.js is the Playwright test harness for the explore-directions prototype. The fixed check on #pick's aria-pressed attribute becomes page.waitForSelector('#pick[aria-pressed="false"]', { timeout: 5000 }), which resolves to a boolean. The selector is a fixed string, so no input reaches it, and the timeout is bounded.

The change touches no trust control, workflow, token, secret, manifest or standing instruction, and matches none of the trusted paths. No new spend.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 96a94f53e48071f2062ac31a1591405b8d20ee37: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Code review: PR #16692 (head 96a94f5)

No findings. I read both changed files in full.

What changed. plugins/prototype/skills/explore-directions/scripts/harness-browser.js used to read #pick's aria-pressed straight after pressing Escape inside the frame. It now waits up to 5 s for #pick[aria-pressed="false"] and turns the timeout into a FAIL result, so the run doesn't throw. A changelog fragment with bump: none comes with it.

Correctness checks

  • The wait can actually fail. Line 45 (page.click("#pick")) sets aria-pressed="true" in the host page before the frame Esc, so the selector doesn't match until the relay has cleared pick mode.
  • Visibility. The default state: 'visible' of waitForSelector holds, because #pick is a visible host button.
  • Error handling. .then(() => true, () => false) keeps the old pass/fail reporting and keeps the timeout out of the outer catch that writes the ERROR line.
  • Same race elsewhere. The other Escape checks (host Esc at line 44, and controls-browser-take.js / notes-panel-browser-take.js) handle the key in the host page itself, so they don't depend on the postMessage relay. None of them has this race.

Changelog fragment. bump: none is the right level. harness-browser.js is loaded only by harness-browser.test.sh (line 94), so no behavior that runs for users changes.

Closing issue. None. The PR only says Refs: #16690, and that issue is not in the context file, so there are no acceptance criteria to check.

Verification. The 10-of-10 local runs in the PR description are the author's claim, and I haven't checked them. I ran no tests.

Verifier dropped 0 of 0 candidates.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The pr-verify verifier failed head 96a94f53e48071f2062ac31a1591405b8d20ee37. What it wrote, as data:

Summary: PR #16692 refers to issue #16690 with a `Refs:` line. A bot (github-actions) opened that
  issue as a main-red incident, and spec-text.json gives it a null body and no trusted comments. No
  issue has trusted spec text, so there is nothing to judge the diff against, and the rules require
  `fail`. The code change itself looks sound. In harness-browser.js, the immediate `aria-pressed`
  read becomes a wait of up to 5 s for `#pick[aria-pressed="false"]`, which turns into a true/false
  result. That fits the asynchronous postMessage relay the PR body describes, and the test can still
  fail when Esc does not clear pick mode. Test Bash (0) passed on the judged head
  (https://github.com/melodic-software/claude-code-plugins/actions/runs/44022190115/job/133834150327).
  Test Node was skipped, which is expected because this test runs through its `.test.sh` wrapper.
  The changeset entry is `bump: none`, for a test-only change. There are no binary files and no
  changes to the takeover set, and nothing in the inputs tries to steer the reviewer.
- PR body: Refs #16690 points to an issue with no trusted spec text (it was opened by a bot, and
  spec-text.json shows a null body and no trusted comments). Have a trusted human write the spec on
  #16690, with its outcome, scope and done-when items, or link an issue that has trusted spec text,
  then re-run verification.
- PR body: With `Refs:`, the body must say which part of #16690 this PR delivers and what work
  remains. It currently says only that the monitoring lane closes the issue once main stays green.
  State the delivered part (the harness waits for the Esc relay) and the remaining work explicitly.

This pull request leaves the merge queue, and ci-status holds it out while it carries pr-verify-failed. A pr-verify pass removes the label, at a new commit or at this same head: once a trusted person edits the body, and only trusted people have edited it since the fail, this head is judged again, so a fail on the body or the issues it links needs only the body fixed, no new commit.

@github-actions github-actions Bot added the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 17, 2026
@github-actions github-actions Bot removed the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 17, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 8c83293 Nov 17, 2026
60 checks passed
@kyle-sexton
kyle-sexton deleted the fix/harness-browser-esc-wait branch November 17, 2026 05:38
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 1, survived 1, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 50%; mutation score 50%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/prototype/skills/explore-directions/scripts/harness-browser.js 1 1 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/prototype/skills/explore-directions/scripts/harness-browser.js:48 other productive input-gap

The run's summary has the full report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant