Repository navigation
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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fcd00a843f
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const pending = (entry.pending ?? Promise.resolve()).then(async () => { | ||
| try { | ||
| const { bindBrowserRequestClient, captureBrowserScreenshot, fetchBrowserScreenshotDataUrl } = | ||
| await import("../../components/browser/browser-client.ts"); |
There was a problem hiding this comment.
Route lazy browser chunk failures through recovery
When the first thumbnail is requested after a deployment replaces the hashed assets, or when this chunk request fails transiently, the new dynamic import rejects inside the broad catch; the revision remains recorded as attempted, the memo resolves to undefined, and the same card never retries or invokes the existing stale-chunk recovery flow. Handle import failures separately with retryControlUiImport (while retaining the current capture/fetch failure policy) so browser previews recover rather than disappearing silently.
AGENTS.md reference: AGENTS.md:L76-L77
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The existing global stale-chunk owner handles this caught lazy-surface failure. main.ts:52 synchronously installs installStaleChunkReloadListener, before the queued thumbnail callback can attempt its import, and this production build transforms the browser import through Vite's preload helper, which dispatches vite:preloadError before rejecting. The listener schedules guarded document recovery even when the thumbnail catch returns undefined (stale-chunk-reload.ts:413–428).
I verified the generated browser-client import and reran the existing recovers caught lazy-surface failures when the document is reachable, not evaluation errors test successfully. Adding retryControlUiImport here would put the error in routeImportErrors, suppressing that global recovery; the thumbnail catch would then consume a persistent retry failure instead of the route error surface handling it. Keeping the existing lazy-surface recovery owner avoids that regression, so I am not applying this suggestion.
|
Codex review: needs changes before merge. What this changesThis PR separates lightweight image and annotation helpers from heavier modules and loads browser screenshot operations on demand. Example: Cold-loading signed-in Chat in the reported production-build comparison.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep this PR open: the maintainer-directed optimization is focused and preserves existing behavior, with no actionable code defect found. Priority: P3 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI renders chat media and browser previews using shared image helpers, synchronous annotation events, and a serialized screenshot queue backed by Gateway requests. flowchart TD
A[Chat boot] --> B[Lightweight image helpers]
A --> C[Annotation event contract]
A --> D[Thumbnail queue]
D --> E[Lazy browser client]
E --> F[Gateway screenshot and media]
C --> G[Composer admission]
Technical reviewBest possible solution: Retain the lightweight extraction and existing recovery owners, then complete the declared timing acceptance before landing. Do we have a high-confidence way to reproduce the issue? Current-main static imports establish the eager-loading path; the reported byte reduction was not rerun during this read-only review. Is this the best way to solve the issue? The smallest complete change is to separate the existing synchronous helpers and event contract, migrate their callers, and defer screenshot imports inside the existing queue; this diff follows that approach without adding state or parallel implementations. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c64eaf54ad0b. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
PR surfaceSource -3, Tests +4. Total +1 across 21 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 22, 2026, 7:56 PM ET / 23:56 UTC. |
What Problem This Solves
Chat boot loads image retrieval and browser operation code before either feature is used.
User Impact
Chat boot downloads 9,324 fewer gzip JavaScript bytes, with unchanged image opening, media rendering, and browser annotation behavior. No migration or user action is required.
Why This Change Was Made
Move the existing synchronous image-open helpers and browser annotation event contract into lightweight modules. Load browser screenshot operations inside the existing serialized thumbnail capture operation. The existing owners still publish pending work and admit annotations synchronously; no new cache, loading state, renderer, or compatibility path is introduced.
Evidence
Production builds compared against
722ad802bc2801eadd83c8b484cd9715480b1f97: Chat JavaScript gzip 1,417,590 → 1,408,266 bytes (−9,324); Shell 315,959 → 315,985 (+26); New Session 953,504 → 953,516 (+12). Shell/New differences meet the campaign's ≤64-byte build-variance allowance. JavaScript request counts remain 7/24/18. Chat CSS gzip increases 204 bytes without a new first-paint request.130 focused test cases passed across thumbnail serialization, image gallery/custody/handoff, annotation admission/lifecycle, browser panel suites, and caught lazy-chunk recovery. UI typecheck, scoped lint, production build, and generated boot manifest checks passed. Independent review found no actionable defects. Production Knip reports the same out-of-scope cron/gateway, approval presentation, X OAuth, and session cleanup findings already confirmed on the campaign baseline; no finding involves these changes.
Timing acceptance, recorded before the run: compare this exact candidate and the pinned base on one focused Blacksmith Testbox, recording observed CPU/RAM and load. Run ten alternating samples per variant for signed-in Chat reload and New Session first load, with cold HTTP cache. Chat first nonempty transcript and enabled composer, and New Session enabled composer, must each have median ≤ base × 1.05 and p95 ≤ base. Four allocations entered capacity queues and were stopped without running samples; all four are reconciled. The second reached hydration while its stop was in flight. Timing remains a required, unproven gate before landing; results will be added when capacity is available.
Exact-head CI run 39869744663 completed with one inherited native-plugin UI failure (plus its aggregate CI gate): all 48 footer assertion signatures match scheduled main run 39865398397. The obsolete pseudo-element expectations are repaired on main by a68d0eb2525; none of those assertions or production paths is changed here.