Repository navigation
perf(ci): avoid broad runtime imports in UI tests - #184705
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. |
|
Codex review: needs maintainer review before merge. What this changesThis PR exports the existing async auth reader through provider-auth and moves QA staging to that narrower SDK entrypoint. Example: QA stages an isolated openai credential.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored PR open: the import narrowing is focused and preserves existing behavior, with no actionable code defect found. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherQA fixtures stage credentials through public SDK exports backed by the canonical auth-store owner; this change narrows module loading without changing credential reads or writes. flowchart LR
A[QA fixture] --> B[QA auth staging]
B --> C[Provider auth SDK]
C --> D[Canonical auth store]
D --> E[Isolated QA SQLite database]
Technical reviewBest possible solution: Retain this minimal import change and establish its performance benefit while preserving the existing auth owner and public exports. Do we have a high-confidence way to reproduce the issue? Source confirms that main's QA staging imports the deprecated broad agent-runtime barrel solely for the reader and credential type; no runtime performance reproduction was executed during this read-only review. Is this the best way to solve the issue? The smallest complete fix is the proposed direct re-export through the already-used provider-auth owner; it removes an unnecessary dependency without wrappers, state, or duplicate tests. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d777ae123962. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +5, Docs 0. Total +5 across 3 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 26, 2026, 10:32 AM ET / 14:32 UTC. |
|
The link-hover title-hint E2E failure is fixed on Verified on NODE_DISABLE_COMPILE_CACHE=1 node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/link-hover-preview.e2e.test.ts -t 'title hints' --maxWorkers=1All four selected cases passed: settings/about pointer, chat pointer without a reader, chat pointer with a reader, and chat focus with a reader. The existing tooltip-visible and zero-metadata-request assertions remain intact. Four unrelated cases were excluded by the name filter. The successful run took 30.39 seconds; an earlier attempt reached no assertions because another proof build held the shared checkout artifact lock, then passed once run serially. This resolves the hover-test failure associated with this PR. Leaving this PR's disposition to its owner. |
|
|
Merged via squash.
|
* perf(qa): narrow the auth staging SDK import * test(ui): observe optional hover recovery before failure * test(ui): await cold lazy readiness in browser contracts * test(doctor): accept both missing-state diagnostics * test(ui): wait for avatar chooser readiness before focus * test(ui): align attachment menu expectations with current labels
What Problem This Solves
QA fixture auth staging imports an async credential reader through the broad
agent-runtimeSDK, bringing unrelated command, agent and speech runtime modules into real-Gateway test collection. Three other production callers reach small utilities through broad barrels and bring additional unrelated modules into the same test roots.Export the existing reader and credential type through the existing
provider-authentrypoint, use it in QA auth staging, and document that import. The originalagent-runtimeexport remains. Import control UI link resolution, model-catalog lookup/types, and the redaction sentinel directly from their existing owners. These are the same function and constant bindings: no new wrapper, entrypoint, state owner or implementation.The auth contract remains explicit fixture environment,
readOnly: true, external-CLI exclusion, error propagation before locked writes, and existing credential merge/replace behavior. The direct imports preserve credential-free URL probing/TLS error reporting, model-default/donor selection, and private diagnostic redaction. All test cases and assertions remain.Three initial lazy/worker readiness assertions allow five seconds without sleeping: monitoring details, live subagent details, and initial native-worker highlighting. Later identity, dismissal, expansion, source and highlighting assertions are unchanged. The avatar keyboard case also waits for the rendered chooser to become enabled before focusing it. Accessible name was available while the control was still disabled; focusing then did not replay when loading finished. The focus/Enter/file chooser, request identity/MIME, pending disabled/opacity and completion assertions remain. No rendered product change, runner allocation, shard count, fanout, cache key, fixture lifetime or global timeout changes. Screenshots are not applicable.
Work Removed
The auth import alone reduces static local-module reachability from 6,136 to 3,620 for automation and from 5,978 to 2,643 for host-command. Of 93 roots reaching the helper, 25 lose modules and 68 retain another broad import.
The additional direct-owner import cut has the following separately measured source graphs:
These retained counts were measured against each cut's original base, not remeasured after the latest main integration. They follow static local value imports and re-exports, excluding type-only/dynamic edges and external package internals; JSON modules are leaves. No root gained a reachable static local module. Graphs were measured for each cut against its own base, so overlapping reductions are not added together. They describe source reachability, not executed modules, bytes, CPU or runner-minute savings.
Evidence
Published replacement head. Current published head:
9d542b978dbab66c129411a1cd14caa0cf2d3d6f, now pushed. Prior published head:53a6b6466344595ee80cb6eff97d0f28d05da596; its run40396635114 is terminal/failure. Replacement-head CI pending; no completed result claimed. Actual merge base:fae514bf96c4b8295893ebfe293524f5ef9b7edc. The merged branch retains main's complete admission-fixture repair from #184907; the earlier local partial repair is excluded. Main's Doctor and hover fixes remain outside this PR's own diff. No dependency changes.AuthProfileCredentialandloadAuthProfileStoreForRuntimeAsyncadded to existingprovider-auth; retained API digest1138fb3dcontrol-ui-handoff.test.ts,16/16 passed;87.40s Vitest /117.93s wrappersession-utils-model.thinking-default.test.ts,16/16 passed;82.55s Vitest /103.25s wrapperdiagnostic-support-redaction.test.ts,80/80 passed;7.62s Vitest /10.39s wrapperControl UI profile page mocked Gateway E2E > uploads an avatar through the keyboard-accessible chooser: disabled button later enabled while remaining inactive; originaltoBeFocused()failedDirect-owner tests ran once per file, serially, with
--maxWorkers=1, Node26.12.1 and the default pinned Bun runtime. Handoff included60.785s cold worker preparation; model reused the local compiler cache. Local wall times are correctness cost, not base/head speed comparisons. The first original QA selection matched no files and provides no assertion proof; the corrected owner selection provides the16-test result. Broad local type attempts stopped at the retained artifact lock before compilation.The chooser repair adds one produced-state assertion, without a real sleep, retry, timeout increase, new case or removed contract. The simplification leaves imports/re-exports and initial readiness synchronization; callers needing broad barrels keep them. No new abstraction or test-only production seam.
Current label-only replacement
The local9d542b978 commit changes two existing E2E files,+6/−8, to use current
Camera/Mediamenu labels, retaining the camera dialog'sTake phototitle and all16cases/assertions. Read-only verification matched the before/final blobs to the same reviewed patch used by the other CI lanes. On main9890d705 the old selected media case failed, then all16existing cases passed (13attachment/3media;49.13s Vitest/51.69s wrapper). UI types6.73s, final format/whitespace and isolated P0–P2 review passed. These are reused exact-file proofs; no tests were rerun for this package and they are not replacement-head broad CI.Earlier Scheduled-Main Phase Reference
An earlier retained completed scheduled-main reference is 40369493361, head
99f7a303e3ffde6c341bb3b496c77a9056059764, observed October 26 at 18:37 UTC. Eleven UI rows passed; real-Gateway 1 failed during its build and E2E 3 failed during tests; locale was skipped. The entire shared producer is charged. The failed pre-test build omits that shard's contracts, so this is context, not a qualifying clean baseline or evidence of savings.Every value below is an elapsed job/step minute from real GitHub timestamps. Env/deps includes runtime setup, cache restoration and frozen dependency reconciliation. Build restoration/download and fixture/Gateway startup occur within composite steps where separate exclusive timings are unavailable; no zero-cost claim is inferred.
Tests incl.includes imports, collection, nested builds, fixtures, Gateway startup and cleanup.Otherpreserves separately named checks/packaging and timing gaps; teardown is separate. Rows reconcile in unrounded seconds; displayed values are rounded.Fixed/other totals 26.42 minutes, versus 20.52 at the successful checkpoint. Inclusive tests/checks total 111.60 minutes, versus 70.98 at that checkpoint. Most jobs spend substantially more time inside tests than outside; the early-failing real-Gateway row cannot justify merging shards based on truncated execution.
Earlier AUTH CI, Before the Chooser Repair
Run 40380222498, prior head
aac78769ad0536b06e6847c6e4a21eff819efd72, completed/failure:9 selected UI rows passed,3 failed,2 skipped. All rows were terminal. API-span total139.92minutes, occupied139.62minutes, inclusive tests/checks114.72minutes and fixed/other25.20minutes. The selected UI completion path was998s; longest job996s. This is prior-head evidence, not proof for53a6b6466344595ee80cb6eff97d0f28d05da596.Env/deps is composite. Fixture/Gateway startup and cleanup remain inside inclusive tests unless separately named. Other preserves the prior reducer policy; see all step names/categories in JSON. These are whole-second GitHub timestamps, not billed-invoice measurements.
The exact failed tests were
Control UI profile page mocked Gateway E2E > uploads an avatar through the keyboard-accessible chooser,Daybreak through a real built Gateway > persists visible selections and refreshes queued requests on desktop and mobile, andSession file PDFs > previews linked PDFs above and below the inline cap and downloads fresh bytes. The core test-types stripe also failed on the now-main-repaired admission fixture. The chooser repair has matching-source focused proof above; main integration alone does not establish the other original failures fixed or inherited. Later53a CI below reports only label failures; that does not identify the cause of those earlier failures. No admin/inherited admission is justified by these historical observations.Latest terminal prior-head AUTH CI
Run 40396635114 at published53a6b646 is completed/failure:10selected UI jobs passed,2failed,0cancelled,2skipped; all12charged rows are terminal. Full/comparable consumption123.12min, comprising24.63fixed/other and98.48inclusive tests/checks. The selected path is1023s; longest job1021s. Both real-Gateway jobs and all three unit jobs passed. Only14attachment/media-label cases in E2E2/E2E4 and the aggregate gate failed. Performance and locale were skipped. This is prior-head evidence, not local9d542b978 replacement-head CI or a qualified cost win.
Campaign Comparison
3274d5d, run 40366200081aac78769, run 4038022249853a6b6466344, run403966351149d542b978dbaComparable minutes exclude conditional locale/performance rows and charge the entire active producer. Failures are charged, not subtracted. API/occupied job spans are runner-occupancy proxies, not invoices. Queue/dependency waits remain in the completion path, not occupied minutes. Zero standalone install/download/restore cells do not imply zero nested composite work. Setup/cache/install and fixture/Gateway subphases not exposed separately stay composite; no exclusive duration is fabricated.
Target remains≤74.20comparable minutes (30% below106.00), critical path≤593s. Different heads, inventories, skipped work and failed/early-truncated runs are not normalized into savings. No CPU, latency or runner-minute reduction is claimed for this PR; the remaining cost is not shown irreducible. Replacement-head CI must supply its own after phase table; the terminal prior53a table is above.
Scope and Size
Against
fae514bf96c4b8295893ebfe293524f5ef9b7edc, exact local9d542b978 has 11files,4,247→4,255LOC,+32/−24. The original9-file cut was3,863→3,873,+26/−16; the disjoint label repair is384→382,+6/−8. No test case was added/deleted; production scope is unchanged by the label replacement. Exact per-file Git blob/line receipts are inround167-184705-loc.json.The current main integration was clean. Main's complete admission fixture supersedes the old local partial fix and is outside this PR delta. Main Doctor, hover, per-request credential docs and environment-case readiness remain. This replacement head is published; native review/preparation, replacement-head CI and landing remain with the maintainer workflow. Current-head native preparation is in progress; no merge admission or merge is claimed.