Repository navigation
fix: keep HTML preview section links inside the document - #154393
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
|
Codex review: needs maintainer review before merge. Reviewed September 21, 2026, 6:18 AM ET / 10:18 UTC (Revision 6). ClawSweeper reviewWhat this changesThe PR keeps authored HTML section links inside sandboxed previews, adds browser coverage and documentation, and incorporates a Codex cleanup-test timing repair. Merge readiness✅ Ready for maintainer review The repair remains necessary on fetched main, and no blocking defect was found. The previous review’s fixture-qualification request is satisfied by the updated evidence. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI displays HTML files and attachments through a separate-origin sandbox. This change prepares link attributes in displayed HTML before transfer, preserving the original file and editor contents. flowchart LR
A[HTML file or attachment] --> B[Preview owner]
B --> C[Identify eligible section links]
C --> D[Prepare display bytes]
D --> E[Isolated sandbox]
E --> F[Scroll within retained document]
A --> G[Original source and editor]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +72, Tests +209, Docs +4, Config +1, Other +3. Total +289 across 8 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep fragment preparation in the existing preview owner, preserving authored source, explicit navigation semantics, and sandbox isolation. Do we have a high-confidence way to reproduce the issue? Yes: clicking an authored fragment link in a strict HTML preview is a concrete path supported by baseline browser evidence and fetched-main source; this read-only review did not rerun it. Is this the best way to solve the issue? Yes: preparing eligible display attributes at the existing preview owner fixes navigation without changing persisted files, adding configuration, or relaxing sandbox policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2d9cc4058941. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
The sparse workflow-owner fixture inherited the new bun-compatible host policy and attempted to import runtime discovery that its five-file Node adapter intentionally excludes. Own both the fixture's Node policy and its empty job environment overlay before running the real boundary. Reproduced all three failures from CI35560122489 on main. The unchanged six cases pass after this repair; 102 owner and runner sibling tests pass with conflicting inherited policy. All selected checks and independent review pass. No production code, timeout, retry, or assertions changed.
The previous merge-ref preflight failed on the duplicate database-worker registration fixed on main by f76d38a. Refresh the merge-ref checks with that known producer repair; the reviewed and live-tested candidate tree is unchanged.
|
Matched before/after captures of the first “Jump to discrepancies” link in strict-mode HTML preview. Both use the existing synthetic production-UI/sandbox test flow at 1440×1000. The baseline is main Before: the frame becomes These images are automated browser boundary evidence. They do not replace the PR's explicitly limited shared-profile attempt. Before After |
The prior merge-ref CI failed the worker cancel/reconnect lifetime fixture because persisted running state preceded the launch response handoff. Incorporate main's owning synchronization repair (5beff9c) before renewing completed CI. The HTML fragment implementation and test bytes remain unchanged. The original accepted auto request was reconciled and its cancellation confirmed through the retained native outcome before this head replacement.
Control the completed/cancelled fixture clock and await turn acceptance so cold startup cannot exhaust the unrelated attempt deadline before cleanup assertions run. Production deadlines and cleanup assertions stay unchanged.
|
Merged via squash.
|
…4393) * fix: keep HTML preview section links inside the document * fix: normalize fragment prefixes without a lint suppression * test: isolate historical Node runner policy from CI The sparse workflow-owner fixture inherited the new bun-compatible host policy and attempted to import runtime discovery that its five-file Node adapter intentionally excludes. Own both the fixture's Node policy and its empty job environment overlay before running the real boundary. Reproduced all three failures from CI35560122489 on main. The unchanged six cases pass after this repair; 102 owner and runner sibling tests pass with conflicting inherited policy. All selected checks and independent review pass. No production code, timeout, retry, or assertions changed. * ci: validate against repaired main test registry The previous merge-ref preflight failed on the duplicate database-worker registration fixed on main by 25ca4cf. Refresh the merge-ref checks with that known producer repair; the reviewed and live-tested candidate tree is unchanged. * test(codex): stabilize one-shot cleanup fixture timing Control the completed/cancelled fixture clock and await turn acceptance so cold startup cannot exhaust the unrelated attempt deadline before cleanup assertions run. Production deadlines and cleanup assertions stay unchanged.


What Problem This Solves
In-page section links in an HTML preview could leave the preview blank instead of scrolling to their target because the sandbox's
srcdocdocument inherited another base URL.User Impact
Authored section links scroll within ordinary HTML previews, including strict mode, while preserving form values and the original file. Authored base URLs, other-window targets, downloads, and foreign-namespace links retain their behavior. Links generated later by page scripts remain outside this repair. No configuration or migration is required.
Why This Change Was Made
The preview owner prepares only displayed document bytes, using the frame's actual script mode. A standards-based parser locates eligible link attributes; source offsets preserve the rest of the authored document. The Gateway response, source editor, sandbox transport, and content security policy retain their contracts.
The already-resolved parse5 8.0.1 becomes a direct UI dependency. The lockfile differs from current main only by the three UI importer lines. The deferred preview chunk grows approximately 26 KiB gzip; parser sources stay out of the startup bundle. Very large or pathological documents beyond the tested 1.7 MiB case remain a performance uncertainty.
Evidence
Inspected before/after screenshots show the same strict-mode section-link click on baseline
103115fand the same HTML implementation retained by this candidate. The baseline reproduces a blocked, blank frame (37.37 seconds); the candidate retains the document and scrolls to Discrepancies (25.05 seconds). This uses synthetic data in the production-UI isolated browser harness; source hashes bind both runs. The images were also delivered in the originating chat.The original strict-mode sandbox browser flow fails before the repair. Existing passing browser assertions cover ordinary, C0/space-prefixed, Unicode, percent-encoded, named and empty fragments in scripts and strict modes; retained document identity and form values; unchanged outer-frame URL and source; exactly one preview RPC; and no file writes. The 1.7 MiB attachment and policy-isolation siblings also pass. The previous focused browser invocation passed three cases in 29.913 seconds wall, including production build. Mounted owner/transport siblings previously passed 53 cases in 5.37 seconds.
An earlier refresh incorporated the worker-launch fixture synchronization fix after the previous CI merge failed
keeps a claimed worker alive across invoke cancel and reconnect until runtime close. That fixture now waits for the completed launch response handoff before testing cancellation; the persisted running state alone did not establish that boundary. On the refreshed tree, the worker lifetime case and all 32 mounted HTML owner cases pass in 40.577 seconds wall, including worker compilation. All four HTML implementation/test files are byte-identical to the previously reviewed candidate.The earlier hosted regex-suppression finding was fixed with a linear C0-prefix scan. Upstream Node-fixture policy and database-worker registry repairs are already incorporated. These passing local checks do not substitute for completed CI on the replacement head.
The real shared Chrome profile reproduced the original blocked navigation using an OpenAI-generated synthetic HTML file. The prior candidate reached
about:srcdoc#caf%C3%A9-%E9%9B%AA, after which Chromium's extension debugger refused frame access. That real-profile attempt does not establish post-click scroll or input retention; the deterministic production-UI browser assertions provide that boundary proof. No browser permissions or sandbox policy were changed.Managed reviews of the HTML repair and the fixture repair report no actionable P0–P2 findings. This integration introduces no substantive merge resolution: the HTML patch and fixture bytes exactly match those reviewed changes.
Previously completed UI, chat-test and E2E-test typechecks pass (57.242, 72.186 and 67.841 seconds), as do scoped typed lint (50.668 seconds), formatting and
git diff --check. Broad core/extension checks remain in completed hosted CI.CI run
35580561560on the previous head failed two Codex fixtures in bundle 20: the native-process fixture lost its relay before its first hook lookup, and the completed one-shot fixture timed out before cleanup assertions. This integration includes main’s native-process admission clock repair and the exact one-shot cleanup fixture repair. Both keep production deadlines and cleanup assertions unchanged while controlling the fixture clock and waiting for the actual admission boundary. The one-shot owner’s required qualification is complete: 20/20 standalone runs (9/9 cases each) and 3/3 original-shard runs (390/390 each), comprising two local runs and hosted run 35584290125, job 106284238408. The hosted run matches the ordered 12-file selection, Vitest config and two-worker setting; it passed on its first observed attempt in 122.77 seconds Vitest / 124.75 seconds wrapper time. The reviewed fixture bytes remained unchanged. This does not claim statistical elimination of flakes. The exact-head ClawSweeper review completed without correctness findings; its sole qualification item is now satisfied by the evidence above. Completed exact-head CI remains required before replacement recovery.On the integration tree committed as
14caf6944f6, all 32 mounted HTML owner cases pass in 3.290 seconds wall. The strict-mode production-UI browser flow passes in 16.127 seconds, including an 8.82-second production build; the scripts-enabled case was intentionally filtered from this integration invocation and retains its earlier proof. The source tree remained unchanged throughout.