Repository navigation
refactor(ui): reuse protocol file response types - #130789
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 5:34 AM ET / 09:34 UTC. ClawSweeper reviewWhat this changesThe PR reuses Gateway protocol file-response types in the Control UI and replaces wall-clock waits with virtual-clock assertions in the session hovercard E2E test. Merge readinessKeep open: this is a coherent, maintainer-owned cleanup that removes current-main type duplication and makes a real browser timing regression deterministic. No patch defect was found; await the in-progress exact-head checks and ordinary maintainer review. Likely related people: steipete and vyctorbrzezowski. Priority: P3 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — step 1 Assertions:
How this fits togetherGateway protocol schemas define the file payloads consumed by Control UI agent editors and session workspace views. The sidebar’s session hovercard has a browser test that checks its open, bridge, sweep, and menu-suppression timing. flowchart LR
Protocol[Gateway protocol schemas] --> Types[Control UI type exports]
Types --> AgentFiles[Agent file editor]
Types --> Workspace[Session workspace]
Sidebar[Session sidebar] --> Hovercard[Progress hovercard]
Hovercard --> E2E[Browser timing test]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -73, Tests +20. Total -53 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the protocol-owned type consolidation and exact timing assertions after the pending exact-head checks and ordinary maintainer review complete. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the prior flaky mechanism: current main used wall-clock waits inside assertions for production timers with fixed 450/220/80/100 ms boundaries. The PR’s supplied CI failure is consistent with that path, although this review did not execute it. Is this the best way to solve the issue? Yes. The Gateway protocol already owns the exact shared payload types, while the UI correctly preserves only its artifact-specific intersection; the virtual-clock test directly checks the production timer boundaries. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1cbcf141ed1e. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Ready for native preparation at commit The production cleanup removes 73 lines of duplicated file-response declarations while preserving all 100 UI exports and the UI-owned artifact join. The adjacent test-only correction keeps all eight hovercard scenarios and real interactions, uses the existing browser-clock helper, and handles native CSS cleanup without changing production timing, CSS, or timeouts. Tests are +33/-13; production is +9/-82. Fresh independent published-head Codex review covered the complete two-file diff in two explicit owner partitions and found no actionable defects. The ordinary exact-head CI run completed successfully on its first attempt. Its actual merge checkout included this head with main The final pinned proof passed all 19 canonical changed checks, 41 retained file/workspace tests, all eight browser scenarios, and four deliberate timing mutations rejected at their intended boundaries. The compiler proof retained the exact public types, and same-path baseline/repeated-baseline/candidate builds matched all 1,827 output files byte-for-byte. The original CI failure, accepted-and-fixed CSS review finding, different-path comparison failure, and provider-cancelled gate are preserved in the PR evidence. All task-owned proof machines are stopped. Commands exercised include ClawSweeper disposition: the latest completed review, updated at 09:48 UTC for this exact head, has no source or security findings. Its explicit rank-up move and remaining requirements—complete exact-head CI and ordinary maintainer review—are satisfied. Its separate live probe did not observe the named test output within 30 seconds and reported only a running-suite heartbeat; that failed observation is not relabeled successful. The completed hosted browser job actually reports all eight hovercard tests passing, including the named timing scenario (2.084 seconds), and all 387 tests in the shard passing. The independent pinned run also completed all eight cases. Native prepare/merge still needs to finish. |
|
Merged via squash.
|
* refactor(ui): reuse protocol file response types * test(ui): make session hovercard timing deterministic
What Problem This Solves
The Control UI duplicates agent-file and session-workspace response shapes already owned by the gateway protocol. Maintaining both copies creates unnecessary drift risk when file metadata evolves. This is a maintainer-requested cleanup, not a claimed user-facing bug fix.
Why This Change Was Made
Reuse the existing protocol types for seven UI exports and remove their copied declarations. The UI keeps its existing exported names and its separate artifact metadata: the workspace view combines
sessions.files.listwith separately fetchedartifacts.listresults. No new helper, module, runtime import, protocol version, schema, dependency, or public field is introduced.Ordinary CI exposed a flaky existing hovercard assertion: a 40 ms sleep after a real hover did not mean the browser was still before its 80 ms timer. The test now reuses the existing virtual-clock helper, preserves all eight scenarios and real pointer/keyboard/menu interactions, and checks the exact cold-open and sweep boundaries. Native CSS transitions remain enabled; one close-deadline browser evaluation accepts a closed card or a card already removed by its normal opacity transition.
Production LOC: +9/-82 (net -73). Tests: +33/-13 (net +20). The only production change is
ui/src/api/types.ts; an adjacent correction keeps the existing hovercard timing test deterministic.User Impact
No user-visible behavior or layout change. File editing, expected-absent files, nested workspace browsing, image metadata, CAS hashes, and artifact joins retain their existing contracts. This change was AI-assisted with Codex; the source, callers, dependency types, and actual proof were inspected directly.
Evidence
exactOptionalPropertyTypesboth enabled and disabled. Runtime type erasure was byte-identical.The pinned environment was Linux Node 24.19.0, Vitest 4.1.11 and Vite 8.2.1, with the frozen dependency fingerprint and all package/build source inputs verified before dependency reuse. The owned Testbox run was stopped after its commands completed; delegated command exit codes, not the lease workflow's cleanup status, are the execution proof.
Commands exercised:
An initial comparison built baseline and candidate in different directories: both builds passed, but their output comparison failed. Investigation localized the executable difference to redundant memoized TypeBox initialization calls; the original logs and generated code were retained. The controlled same-path repeat above then proved literal full-output equality. This PR neither changes the bundler nor claims path-independent build determinism. No live external API or screenshot-based behavior claim is made for this type-only change.
Adjacent CI timing repair
The original ordinary CI run failed the existing cold/bridge/sweep/menu test: it observed the second row where its wall-clock assertion still expected the first. No blind CI retry was used. Bounded browser observations measured the RPC overhead and confirmed the unchanged 80 ms timer, but did not reproduce that chance failure; the hosted failure remains the pre-fix reproduction.
The revised test passed all eight scenarios in the pinned browser proof environment. Four deliberate timing mutations were rejected: sweep 80→0 and 80→160, and cold-open 450→0 and 450→900. Each failed at its intended pre-/at-deadline assertion, and the original runtime bytes were restored. No production timer, CSS rule, timeout, or test-only production seam changes.
That machine's backing workflow was later cancelled by the provider during the changed gate; the interrupted attempt is retained as a failure. A single recovery environment, hydrated from this PR's published branch to preserve its dependency cohort, completed all 19 checks and final source fences. No memory/concurrency override or CI retry was used to obtain that result.
The recovery machine was stopped after the final gate and review completed; no proof lease remains active.
Review caught a second clock-domain issue in the first correction: pausing JavaScript does not pause CSS. A real Chromium trace showed the card marked closed at virtual 100 ms, then removed by a native opacity transition without further virtual-clock advance. The final close assertion performs one browser evaluation accepting either valid state; the 99 ms mounted assertion and later removal assertion remain. The original review finding and diagnostic records are retained rather than relabeled clean.
Provenance: the wall-clock assertion is carried from commit
434fd0c106902(2026-08-23, code author Vyctor H. Brzezowski, #125068). No merger or automation-trigger attribution is inferred from blame. This is a test-only repair; no new operator-visible behavior is claimed.ClawSweeper disposition
The latest available ClawSweeper review found no source defects and requested ordinary review and exact-head CI completion; it contains no separate rank-up moves. The local integrated review and final checks above are complete. A fresh independent published-head review and ordinary CI on the updated head remain required before landing; the old failed run is not being treated as green.