Repository navigation
fix(ui): prevent duplicate Skills preload requests - #123705
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 14, 2026, 3:17 PM ET / 19:17 UTC. ClawSweeper reviewWhat this changesThe PR relaxes same-connection Gateway route-data freshness and defers Skills fallback loading to prevent duplicate initial status requests. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep open: the final head still removes the entire Skills view while route preload is pending, leaving a slow but healthy initial load visibly blank. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI router preloads Skills data from the connected Gateway before handing it to the Skills page. The page consumes that preload or performs a fallback Gateway request, then renders the selected agent’s Skills status. flowchart LR
A[Skills navigation] --> B[Route preload]
B --> C[Gateway snapshot check]
C --> D{Route data current?}
D -->|yes| E[Skills page]
D -->|no| F[Fallback status load]
E --> G[Skills status display]
F --> G
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +12, Tests +45. Total +57 across 6 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep Do we have a high-confidence way to reproduce the issue? Yes—current source and the supplied exact-head CI evidence establish a high-confidence path: open Skills while its route preload is delayed across a metadata-only Gateway snapshot update. I did not execute the browser scenario locally. Is this the best way to solve the issue? No. The freshness comparison and deferred fallback are plausible, but unmounting the page during the same pending state regresses visible navigation; retaining the page is the narrower owner-boundary repair. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3289e08c3005. 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 (9 earlier review cycles; latest 8 shown)
|
|
Exact-head CI still reproduces the duplicate initial Skills request this PR intends to fix.
The same failure also appeared in an unrelated UI PR's exact-head shard: https://github.com/openclaw/openclaw/actions/runs/31817539407/job/94823120933. That confirms the current owner repair has not closed the browser lifecycle path yet; please keep #123705 as the canonical fix and refresh its implementation/proof before landing. |
|
The combined route-unmount + first-update head still reproduces the same duplicate request on exact-head CI:
I reproduced the head locally. The focused test passes alone, and the exact There is also a current contract that explains why a second request can be correct: That means the E2E's exact-one assertion conflicts with the stale-epoch safety contract. The test name is “scopes every initial Skills status request to the displayed default agent”; the stable invariant is one-or-more requests, all with |
|
Merged via squash.
|
* fix(ui): wait for Skills route preload * fix(ui): defer Skills fallback until first update * fix(ui): keep Skills unmounted during preload * fix(ui): retain route data through gateway metadata updates * test(ui): make Skills preload race deterministic * fix(ci): round boundary artifact refresh mtimes * fix(ci): repair merged main checks * chore: keep Skills repair diff focused
What Problem This Solves
Fixes an issue where opening Skills could send two identical initial
skills.statusrequests for the displayed default agent. The duplicate made the exact-cardinality Control UI browser contract fail onmainand blocked unrelated pull requests that exercised the full UI E2E shard.Why This Change Was Made
The route loader and the mounted page were both allowed to own the first status load. A connected Gateway can publish a new snapshot object when recovery-scope or shell metadata changes without starting a new transport epoch; exact snapshot-object comparison incorrectly rejected the route loader's completed result, so the page issued a fallback request.
Route data now remains current across metadata-only snapshot clones when the Gateway source, client, connected phase, and hello identity are unchanged. A reconnect still carries a new hello and invalidates stale route work. The Skills component waits for route ownership to initialize before fallback loading, while the route keeps the page unmounted during preload. The browser proof separately checks that every request owns the displayed agent and that exactly one request is sent.
Production delta: +21/-9 lines (net +12), justified by the shared route-data epoch boundary. Tests: +56/-11 lines (net +45).
User Impact
The Skills page loads once for the selected default agent instead of issuing duplicate Gateway work. Other routed pages also retain valid preload results across same-connection Gateway metadata updates without accepting data from a reconnect epoch.
Evidence
mainrun 31813032305 observed two identicalskills.statusrequests; the earlier PR heads reproduced the same exact-count failure.SkillsPage.ensureInitialData; the rejected route data had the same live client but a metadata-cloned Gateway snapshot.a8fba23509e0fc4d3c4f08163a52781ba7271fb0: all UI E2E shards passed, including the previously failing Skills shard; the aggregate run failed only on the unrelated current-main max-lines defect incommands-compact.test.ts(31821117620).main, the final PR diff is Skills-only with no mtime delta.dd9134ca43fac5c2e6b0cc249eeabf60ef36f344autoreview: no accepted/actionable findings.