Skip to content

fix(gui): cancel Remote Link sheet focus work (#7611) - #7650

Merged
lidge-jun merged 3 commits into
devfrom
lane/l2-remote-link-focus
Oct 24, 2026
Merged

lidge-jun merged 3 commits into
devfrom
lane/l2-remote-link-focus

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Closes test(gui): remote-link Add child focus-restore case is flaky on macOS #7611. Keep the Add child sheet's deferred opening-focus timer owned by its React effect, cancelling it on close and unmount so it cannot steal focus after the trigger has been restored.
  • Dispose each happy-dom window after React unmount and before restoring globals, including failed tests. Add deterministic close/unmount regressions that prove opening focus works and assert cancellation before draining any callback. Preserve the original focus-restoration assertion.
  • Decision: the issue still reproduces with happy-dom 21.0.4, so a product fix is justified: the unchanged case failed 2/200 iterations on Bun 1.4.3, and the unchanged focused file failed 1/48. Both new cancellation cases failed before the product or fixture change; the timer cleanup alone made both pass. This is an independent PR from test(server): isolate agent-task-recovery fixtures (#7613) #7649. No shared registration, dependency, timeout, layout, or copy changes.

Verification

  • Pinned Bun 1.4.3: new controlled-timer regressions RED 0 pass / 2 fail on old code (pending timer count expected 0, received 1), GREEN 2 pass / 0 fail after the product cleanup alone, before fixture disposal changed.
  • The original discovery loading, empty setup and rescan retain keyboard-accessible manual entry case: 200 pass / 0 fail after the fix (bun test --isolate tests/remote-link.test.tsx --test-name-pattern 'discovery loading, empty setup and rescan retain keyboard-accessible manual entry' --rerun-each 200 from gui/ with pinned Bun).
  • cd gui && OCX_TEST_RUNNER_BUN="$PWD/../.tmp/l2/bun-darwin-aarch64/bun" bun run test: exit 0; 3,495 pass / 0 fail across 355 files. bun run lint and bun run build from gui/: exit 0.
  • Root bun run typecheck, bun run privacy:scan, and bun run structure:check: exit 0.
  • Root bun run test:changed: exit 1, 0 pass / 0 fail / 0 selected. The root parsed import graph does not discover this GUI-only change and its selection guard reports that gap. The focused GUI regressions, repeated original case, and entire GUI suite provide direct coverage; the selector is unchanged. Source-bound GUI verification at head 132f2fc2b275a70028dc0dedfdc2ab8b3d936040 completed with exit 0 and 3,495 pass / 0 fail (the bun --cwd gui test ... command routed through the package test script and ran the entire GUI suite).
  • Isolated real Chrome 155: PASS for Escape focus restore, held opening timer cancellation on close, exact Add child trigger focus, held timer cancellation on unmount, and zero page errors. The production component was rendered with synthetic local status/candidate/fallback data; no real account or remote mutations. The shared preview reported unavailable, so this used an isolated headless browser.
  • NOT RUN: full root suite on this GUI head. The lane's earlier full root run took several minutes on a shared host and reported 52,138 pass / 162 skip / 1 unrelated Desktop cold-restart failure; it does not certify this head. Full GUI coverage is available above; Ubuntu CI supplies the remaining integration coverage. Fresh independent gpt-6.1-sol high review at 132f2fc2b275a70028dc0dedfdc2ab8b3d936040: PASS, no findings. Exact-head Ubuntu CI remains queued; PR stays draft.

No visual change. This screenshot records the existing sheet appearance during the browser focus check; it lives only on pr-assets, linked by commit SHA.

Add child focus verification

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed (existing focus contract restored; no setup, copy, or visual contract change).
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults (no auth, credential, dependency, workflow, or release changes).

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • 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.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Oct 24, 2026
@lidge-jun

Copy link
Copy Markdown
Owner Author

Local CI-equivalent (Linux) at a74d789

Final verdict: PASS (temporary rule; raw base-identical test failures retained). This includes every primary batch selected by all four Linux shards.

Host lidge-AI-AI, Ubuntu 24.04.4 LTS x86_64, kernel 7.0.0-30-generic. Workflow authority: origin/dev at 8066099651f8ed356bb73a67d9c99978ea65447c. Bun runner/gates 1.4.3; runtime pin 1.4.4. Detached exact head a74d789efffbabdf640d60eee1a016b75e39fd18; brief head a74d789efffbabdf640d60eee1a016b75e39fd18; moved from brief False. Base 47316142fe06171a94de02d63f1727dbed4c0382; observed merge-base with origin/dev 47316142fe06171a94de02d63f1727dbed4c0382.

All new suite/base invocations use documented OPENCODEX_TEST_TRUSTED_FIXTURE_DIR=/home/lidgeai/ocx-linux-ci.p2R3NT/trusted-fixtures (new private directory, mode 0700 under trusted ownership). Original results remain unchanged; no completed head batch was retried. GIT_DIR, GIT_INDEX_FILE, and GIT_WORK_TREE are explicitly absent. CI=true; shard scope general, batch size at most 12, no parallel override, per-test timeout 60000 ms, batch process deadline 120 s, TERM/KILL grace 15 s.

Batch file lists are generated by the exact head’s original planner. Only its script-directory anchors point back to the original location; its test command/deadlines are unchanged. Every previously executed batch file list was checked against the reconstructed manifest. Remaining batches ran serially; any new failure stayed failed and did not suppress later missing batches.

Shard Original batches executed Remaining batches executed Required total Coverage
1/4 63 0 63 COMPLETE
2/4 58 0 58 COMPLETE
3/4 14 50 64 COMPLETE
4/4 10 56 66 COMPLETE

Original CI commands (no reruns):

Command Exit Pass / fail / skip
bun install --frozen-lockfile 0 N/A
cd gui && bun install --frozen-lockfile 0 N/A
cd gui && bun run build 0 N/A
bash scripts/ci/run-bun-test-batches.sh 1/4 0 13577/0/35
bash scripts/ci/run-bun-test-batches.sh 2/4 0 12304/0/50
bash scripts/ci/run-bun-test-batches.sh 3/4 1 2566/0/3
bash scripts/ci/run-bun-test-batches.sh 4/4 1 1887/1/0
cd gui && bun run lint 0 N/A
bun x tsc --noEmit 0 N/A
bun x tsc --noEmit -p tests/tsconfig.doctor-service-memory-contract.json 0 N/A
bun x tsc --ignoreConfig --noEmit --strict --target ESNext --module ESNext --moduleResolution bundler --types bun-types --skipLibCheck scripts/ci/docker-smoke.ts 0 N/A
cd gui && bun test --isolate tests 0 3495/0/0
bun run privacy:scan 0 N/A
bun run skill:surface:check 0 N/A
bun build scripts/release.ts --target=bun --outdir=/home/lidgeai/ocx-linux-ci.p2R3NT/evidence-7650/release-build 0 N/A
bun run src/cli/index.ts help 0 N/A
bun run structure:check 0 N/A
bun test --isolate ./tests/storage/api-storage-policy-already-running.test.ts ./tests/storage/api-storage-policy-mutation-busy.test.ts ./tests/storage/api-storage-policy-put-race.test.ts ./tests/storage/api-storage-policy-run.test.ts ./tests/storage/api-storage-policy.test.ts ./tests/storage/api-storage.test.ts 0 9/0/0
bun test --isolate ./tests/server/api-usage.test.ts 0 34/0/0

Remaining primary batches — each command is timeout --signal=TERM --kill-after=15s 120s bun test --isolate --timeout 60000 <exact manifest files>:

Shard / batch Exit Pass Fail Skip
3/4, 15/64 0 302 0 0
3/4, 16/64 0 183 0 30
3/4, 17/64 0 163 0 2
3/4, 18/64 0 127 0 2
3/4, 19/64 0 133 0 0
3/4, 20/64 0 151 0 1
3/4, 21/64 0 302 0 1
3/4, 22/64 0 384 0 0
3/4, 23/64 0 436 0 0
3/4, 24/64 0 81 0 0
3/4, 25/64 0 81 0 23
3/4, 26/64 0 278 0 1
3/4, 27/64 0 356 0 0
3/4, 28/64 0 300 0 1
3/4, 29/64 0 190 0 0
3/4, 30/64 0 188 0 1
3/4, 31/64 0 135 0 0
3/4, 32/64 0 158 0 0
3/4, 33/64 0 186 0 0
3/4, 34/64 0 188 0 0
3/4, 35/64 0 186 0 0
3/4, 36/64 0 49 0 0
3/4, 37/64 0 18 0 0
3/4, 38/64 0 170 0 0
3/4, 39/64 0 202 0 0
3/4, 40/64 0 157 0 0
3/4, 41/64 0 226 0 0
3/4, 42/64 0 292 0 0
3/4, 43/64 0 104 0 0
3/4, 44/64 0 311 0 0
3/4, 45/64 0 324 0 0
3/4, 46/64 0 497 0 0
3/4, 47/64 0 245 0 0
3/4, 48/64 0 266 0 0
3/4, 49/64 0 522 0 1
3/4, 50/64 0 193 0 0
3/4, 51/64 0 328 0 2
3/4, 52/64 0 236 0 0
3/4, 53/64 0 118 0 0
3/4, 54/64 0 275 0 0
3/4, 55/64 0 158 0 0
3/4, 56/64 0 7 0 0
3/4, 57/64 0 55 0 0
3/4, 58/64 0 130 0 0
3/4, 59/64 0 102 0 0
3/4, 60/64 0 46 0 0
3/4, 61/64 0 217 0 0
3/4, 62/64 0 339 0 0
3/4, 63/64 0 200 0 0
3/4, 64/64 0 209 0 1
4/4, 11/66 0 275 0 0
4/4, 12/66 0 344 0 0
4/4, 13/66 0 291 0 0
4/4, 14/66 0 484 0 0
4/4, 15/66 0 347 0 0
4/4, 16/66 0 177 0 0
4/4, 17/66 0 237 0 2
4/4, 18/66 0 223 0 0
4/4, 19/66 0 231 0 1
4/4, 20/66 0 216 0 0
4/4, 21/66 0 321 0 1
4/4, 22/66 0 180 0 2
4/4, 23/66 0 299 0 1
4/4, 24/66 0 213 0 0
4/4, 25/66 0 39 0 0
4/4, 26/66 0 17 0 0
4/4, 27/66 0 299 0 0
4/4, 28/66 0 221 0 1
4/4, 29/66 0 149 0 0
4/4, 30/66 0 113 0 0
4/4, 31/66 0 152 0 0
4/4, 32/66 0 251 0 0
4/4, 33/66 0 155 0 0
4/4, 34/66 0 141 0 0
4/4, 35/66 0 281 0 0
4/4, 36/66 0 300 0 0
4/4, 37/66 0 403 0 0
4/4, 38/66 0 214 0 0
4/4, 39/66 0 209 0 0
4/4, 40/66 0 160 0 0
4/4, 41/66 0 275 0 0
4/4, 42/66 0 187 0 0
4/4, 43/66 0 138 0 0
4/4, 44/66 0 330 0 0
4/4, 45/66 0 246 0 0
4/4, 46/66 0 172 0 0
4/4, 47/66 0 83 0 0
4/4, 48/66 0 506 0 1
4/4, 49/66 0 301 0 0
4/4, 50/66 0 10 0 0
4/4, 51/66 0 26 0 0
4/4, 52/66 0 175 0 0
4/4, 53/66 0 157 0 0
4/4, 54/66 0 294 0 0
4/4, 55/66 0 218 0 1
4/4, 56/66 0 332 0 1
4/4, 57/66 0 337 0 0
4/4, 58/66 0 10 0 0
4/4, 59/66 0 8 0 0
4/4, 60/66 0 166 0 0
4/4, 61/66 0 4 0 0
4/4, 62/66 0 86 0 0
4/4, 63/66 0 26 0 0
4/4, 64/66 0 142 0 2
4/4, 65/66 0 79 0 0
4/4, 66/66 0 9 0 0

Remainder totals: 21763 pass / 0 fail / 79 skip. Combined original + remainder command counts: 55635 pass / 1 fail / 167 skip. Failed checks remain failed; final disposition uses only the explicit BASE-IDENTICAL exception.

Failure classification across original and remainder evidence:

  • BASE-IDENTICAL — test-3-of-4 shard 3/4 batch 14/64 (12 files): process exit 1 with batch counts {'pass': 336, 'fail': 0, 'skip': 0}. Exact 12-file base batch exit 1, counts {'pass': 336, 'fail': 0, 'skip': 0, 'todo': 0}. Root cause unattributed; failed process status retained.
  • BASE-IDENTICAL — tests/claude-integration/claude-desktop-remote-hub.test.ts:249 — connected Desktop uses hub IDs across a cold restart (stored profile=false). Base exit 1, 1/1/0 pass/fail/skip; same failing label reproduced.

Base comparisons (cached once per distinct file/exact failed batch):

  • bun test --isolate --timeout 60000 tests/cli/cli-link-enrollment.test.ts tests/cli/cli-link-force.test.ts tests/cli/cli-logs-request-id.test.ts tests/cli/cli-models-display-name.test.ts tests/cli/cli-models-local-result.test.ts tests/cli/cli-models-order.test.ts tests/cli/cli-models-prompt-length-pricing.test.ts tests/cli/cli-models-reasoning.test.ts tests/cli/cli-native-profile.test.ts tests/cli/cli-observe-snapshot.test.ts tests/cli/cli-provider-sync-result.test.ts tests/cli/cli-resolve.test.ts (cwd /home/lidgeai/ocx-linux-ci.p2R3NT/base-47316142fe, Bun 1.4.3): exit 1; 336 pass / 0 fail / 0 skip. Log /home/lidgeai/ocx-linux-ci.p2R3NT/base-evidence/batch-a122bb89d34e55.log; cached once per distinct file/batch.
  • bun test --isolate --timeout 60000 ./tests/claude-integration/claude-desktop-remote-hub.test.ts (cwd /tmp/ocx-linux-ci.MlWNCd/base-47316142fe, Bun 1.4.3): exit 1; 1 pass / 1 fail / 0 skip. Log /tmp/ocx-linux-ci.MlWNCd/base-evidence/tests__claude-integration__claude-desktop-remote-hub.test.ts.log; cached once per distinct file/batch.
  • bun install --frozen-lockfile (cwd /home/lidgeai/ocx-linux-ci.p2R3NT/base-47316142fe, Bun 1.4.3): exit 0; 0 pass / 0 fail / 0 skip. Log /home/lidgeai/ocx-linux-ci.p2R3NT/base-evidence/install-root.log; cached once per distinct file/batch.
  • bun install --frozen-lockfile (cwd /home/lidgeai/ocx-linux-ci.p2R3NT/base-47316142fe/gui, Bun 1.4.3): exit 0; 0 pass / 0 fail / 0 skip. Log /home/lidgeai/ocx-linux-ci.p2R3NT/base-evidence/install-gui.log; cached once per distinct file/batch.
  • bun run build (cwd /home/lidgeai/ocx-linux-ci.p2R3NT/base-47316142fe/gui, Bun 1.4.3): exit 0; 0 pass / 0 fail / 0 skip. Log /home/lidgeai/ocx-linux-ci.p2R3NT/base-evidence/build-gui.log; cached once per distinct file/batch.

Every original non-test gate result is retained in the original-command table above. No source edits, pushes, approvals or merges were performed. Source status: clean (git status --short empty); HEAD unchanged. Final fetched head a74d789efffbabdf640d60eee1a016b75e39fd18.

NOT RUN: Hosted CI and platforms/jobs outside the requested Linux scope

Exact manifests and raw logs (retained on the named Linux host):

  • Shard 3: /home/lidgeai/ocx-linux-ci.p2R3NT/evidence-7650/remainder-3-manifest.tsv, SHA-256 67a06d3eaf96faede124c4129dde93eaa4abef726f1e50bc7c92bf0b5237f811; planner validation True.
  • Shard 4: /home/lidgeai/ocx-linux-ci.p2R3NT/evidence-7650/remainder-4-manifest.tsv, SHA-256 eef290af4ed4e4c2b68ec95d4d3e49ba19aa1f3d59d9421503863221e37fb1a1; planner validation True.
  • Per-batch argv/exits/counts: /home/lidgeai/ocx-linux-ci.p2R3NT/evidence-7650/remainder-results.json; all original commands: /home/lidgeai/ocx-linux-ci.p2R3NT/evidence-7650/results.json; final evidence: /home/lidgeai/ocx-linux-ci.p2R3NT/evidence-7650/coverage-analysis.json.

UTC: 2026-10-24T12:15:45.728780+00:00

@lidge-jun
lidge-jun marked this pull request as ready for review October 24, 2026 12:45
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner October 24, 2026 12:45
@lidge-jun

Copy link
Copy Markdown
Owner Author

Integration evidence for exact head a74d789 (lane L2):

  • Independent review: fresh gpt-6.1-sol PASS, 0 findings.
  • Lane verification: unchanged 200-run baseline 198 pass / 2 fail; new close/unmount regressions red (0/2) before and green after the product timer cleanup; existing focus case 200/200; full GUI suite 3495 pass / 0 fail (355 files); GUI lint/build exit 0; real Chrome focus/close/unmount check passed; screenshot on pr-assets 73b2e08 (no visual change).
  • Local CI-equivalent: Linux (lidge-ts) 251/251 primary batches, 55635 pass / 1 base-identical fail / 167 skip, all gates exit 0. macOS (macmini-ts) shard 2 17595/0 before the owner stopped the remaining runs (NOT RUN).
  • Closes test(gui): remote-link Add child focus-restore case is flaky on macOS #7611.

Static merge simulation on current dev c5ba1e1 (this Mac): dev=c5ba1e105f3bd7aa517a62a646384d90a8e33b8e base=47316142fe06171a94de02d63f1727dbed4c0382 pr_files= 2 overlap=[]; merge clean; install exit=0; gui install exit=0; tsc exit=0; tsc doctor exit=0; gui tsc -b exit=0; gui lint exit=0; structure:check exit=0; privacy:scan exit=0; layout+ratchet guards exit=0 52 pass 0 fail ;

Merged by the triage manager as maintainer integration (MAINTAINERS.md, dev only) under the owner's static-judgment rule while GitHub Actions is degraded; dev push CI will be checked when Actions recovers.

@lidge-jun
lidge-jun merged commit a033a1a into dev Oct 24, 2026
28 of 31 checks passed
@lidge-jun
lidge-jun deleted the lane/l2-remote-link-focus branch October 24, 2026 12:45
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T12:47:07.575143Z a74d789 Draft marked ready
ℹ️ 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.

@lidge-jun

Copy link
Copy Markdown
Owner Author

Final stopped run (macOS) at a74d789

Stopped at the owner's request; INCOMPLETE — no PASS claim.

  • bun install --frozen-lockfile at root and gui/, cd gui && bun run build, and bounded-utilities setup: each exit 0.
  • bash scripts/ci/run-bun-test-batches.sh 1/3: exit 1; 2,046 pass / 1 fail / 0 skip. The Desktop stored-profile=false assertion at tests/claude-integration/claude-desktop-remote-hub.test.ts:249 is BASE-IDENTICAL against base 4731614 (same test/assertion reproduced once).
  • Same command for 2/3: exit 0; 17,595 pass / 0 fail / 22 skip. For 3/3: exit 0; 17,603 pass / 0 fail / 35 skip.
  • bun run src/cli/index.ts help after each shard: exit 0.
  • Control (1/1) was terminated with its process group at the owner's request during batch 11/253. Its completed batch summaries total 2,579 pass / 0 fail / 0 skip; no completed control-job exit is claimed.

NOT RUN: shard 1 batches 12–88; control batch 11 unfinished and batches 12–253 unrun; remaining control help, gates, structure, storage-policy, api-usage, and all planned coverage remainders. Original failures are preserved. No push, approval, or merge was performed.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant