Repository navigation
fix: Template details take too long to load - #193124
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 changes before merge. What this changesThis PR fetches independent Template registry data concurrently and reuses exact-release artifact metadata. Example: Open details for @openclaw/[email protected].
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep this PR: it delivers a measured Template-detail speedup while preserving verification, but its added tests exceed the existing test-line budget and fail CI. Priority: P2 Before merge
Findings
Agent review detailsHow this fits togetherThe Control UI requests Template details through Gateway RPC; the Template source reads ClawHub metadata and archive bytes, verifies the selected release, and returns workspace files and resource descriptions. flowchart LR
A[Control UI] --> B[Gateway detail RPC]
B --> C[Template source]
C --> D[Package and release metadata]
C --> E[Archive download]
D --> F[Identity and integrity verification]
E --> F
F --> G[Verified detail response]
Technical reviewBest possible solution: Retain the existing-owner concurrency and verification design, and fund its justified regression growth with a separate 71-line allocation. Do we have a high-confidence way to reproduce the issue? Current-main source exposes the serial request chain, and the PR supplies paired real-Gateway measurements; this read-only review executed no target code. Is this the best way to solve the issue? The change removes a redundant registry lookup and overlaps independent I/O using existing owners while preserving exact-release validation and archive cleanup. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e531410a397e. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource +81, Tests +71, Other +91. Total +243 across 5 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel 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 November 4, 2026, 9:20 PM ET / November 5, 2026, 02:20 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
* fix: Template details load without serial registry waits * test(templates): use canonical manifest in authority fixture * test(templates): allocate owned detail regression coverage
#193124 added scripts/bench-template-detail.mts as a standalone measurement command documented by its source header, so the full-tree unused-file scan reports it. Register it beside the other standalone benchmarks.
openclaw#193124 added scripts/bench-template-detail.mts as a standalone measurement command documented by its source header, so the full-tree unused-file scan reports it. Register it beside the other standalone benchmarks.
What Problem This Solves
Fixes: opening a Template’s details leaves its workspace-file and content rows loading while independent registry requests run one after another.
User Impact
Template details load faster without changing their contents, exact-release selection, visibility checks, artifact integrity, or preview/apply behavior. No configuration changes or migration are required.
Why This Change Was Made
Read package metadata, exact-release metadata, and the archive concurrently, then reuse the release’s artifact metadata instead of making a redundant artifact-resolution request. Archive content is not consumed before the existing identity and integrity checks pass. A request-owned abort cancels unfinished speculative downloads on metadata failure, and staged downloads are always cleaned up.
The parser and integrity helpers move unchanged to the existing artifact owner to keep the source module within its line limit. No cache, endpoint, dependency, or configuration surface is added.
Evidence
scripts/bench-template-detail.mts(at least five samples, response parity, per-run host load, no credential output). It measures authenticated connection plus full verified detail response, not CLI startup or browser INP.mcp.app.discoveraccess refusal; all Template RPCs succeed. Before/after screenshots are attached below.git diff --checkpass.7e0d2c402e6f182402e8c027d9315fb42721d7d8confirms both cancellation and benchmark-token typing findings resolved, with no remaining blockers in the four-file scope. The reviewer did not rerun checks. Local ClawSweeper completed the entire committed rangec8094c112b45a3b7ab378af7668be0f60cafd0cd..7e0d2c402e6f182402e8c027d9315fb42721d7d8(high reasoning, read-only source correctness/security scope): no actionable findings; no tests or runtime benchmarks were run by that review.No production OpenClaw Gateway was rebuilt or restarted. This is an OpenClaw-side optimization; it does not itself deploy new Gateway code.
Current-production final-code benchmark
Final commit
7e0d2c402e6f182402e8c027d9315fb42721d7d8versus unchanged baselinec8094c112b45a3b7ab378af7668be0f60cafd0cd, using already-running isolated real Gateways on ports 19561/19562. Both processes were verified bound toOPENCLAW_CLAWHUB_URL=https://clawhub.ai. Workload: exact published@openclaw/[email protected]; five serial ABAB pairs, each over a fresh authenticated Gateway connection through the full verified archive/extraction/detail path. Process/module startup is excluded. The >=2x average speedup target passes; full JSON deep equality passes for all ten responses.Average 3.45x faster / 71.02% lower. Per-sample 1/5/15-minute host load was recorded; observed 1-minute load 9.62-10.55. Initial slower baseline sample is retained, not discarded. Source-owned primary registry reads fall from four to three, with the three remaining independent reads concurrent; archive-internal HTTP work is not included in that count. No cache is added.
This measures current production ClawHub, not a new shared backend deployment. Shared backend PR openclaw/clawhub#4443 merged as
923099b7bb4fa9de01fe157722403434af139ab6; its exact-SHA Deploy Test passed, but production Deploy 41951554456 refused unrelated large-index deletion. That guard was not bypassed. Post-shared-deployment validation remains blocked. This PR remains an OpenClaw-only proposal and does not update or restart the user's production Gateway.All four attached before/after PNGs were subsequently loaded and decoded from the rendered PR (1440x1050 each).
CI fixture repair
The original exact-head CI checks-node-changed job failed in
server-templates-add-authority.e2e.test.tswithDownloaded Template package manifest is invalid.The CI classifier marked attribution unknown (no matching main job and annotation-only discovery); the completed job log was subsequently inspected directly.The fixture and manifest reader were both byte-identical to baseline
c8094c112b45a3b7ab378af7668be0f60cafd0cd: the fixture declared the retiredopenclaw.template: template.json, while the reader accepts only package-relativeCLAW.mdwith frontmatter. A bounded owning-reader reproduction on baseline and candidate, for both allowed/revoked fixture shapes, rejects the old selector withinvalid_package_metadataand admits the canonical manifest with package dependencies and cron declarations intact. This establishes the inherited fixture defect, not a passing full Gateway replay.The follow-up changes only that existing E2E fixture: point the package selector at
CLAW.md, move the unchanged manifest JSON into its frontmatter, retain the original heading, and remove the obsolete JSON artifact. All authorization, revoked-admin, persistence, and effect assertions remain unchanged. Production source is unchanged from measured/reviewed7e0d2c402e6f182402e8c027d9315fb42721d7d8, so the benchmark and screenshots above remain applicable.Changed-file lint, formatting, and
git diff --checkpass. Local full E2E preparation refused because managed-Gateway artifact separation could not be verified; no artifacts were rebuilt and that guard was not bypassed. The supported isolated runner requires Linux and is unavailable on this Mac. Full real-Gateway confirmation subsequently passed on fixture commit665fab132433ca7563f14c1b19669dd86ae0a54a: checks-node-changed job 127001030795. The original authority test passed in 14.77 seconds (53.15 seconds for its full isolated invocation), and the trusted-plugin sibling passed in that job. This supersedes the local E2E verification gap; overall CI is not yet claimed green.Published fixture-only follow-up:
665fab132433ca7563f14c1b19669dd86ae0a54a. Independent read-only review reports no findings or boundary weakening: manifest declarations are preserved and all authentication, consent, revocation, before-effect gating, settlement, and installed-state assertions remain unchanged. The reviewer did not execute tests.Scoped test-line allocation
CI on
665fab132433ca7563f14c1b19669dd86ae0a54athen failed only the completed baseline-ratchet job's test-line check: 6,477,280 lines versus ceiling 6,477,260; this change has +71 net test LF lines. Preserve the regression tests rather than deleting unrelated coverage or weakening assertions. Per the repository's comparison-aware test-budget policy, commit5316e2f03939a1fc72f2a11f3dd3dc3c7ec3633eadds the separateconfig/test-lines-allocations/templates-detail-parallel-artifact.txtrecord for exactly those 71 net lines (+72 source regression lines and -1 canonical authority-fixture line). It covers concurrent-read admission without early extraction, elimination of the redundant artifact lookup, completed-download cleanup on metadata/integrity failure, and genuinely pending-download cancellation. The shared scalar is unchanged.The staged checker passes against both original base
c8094c112b45a3b7ab378af7668be0f60cafd0cdand CI's observed comparison base8526701724c109fd911837ba0fe4585b42fa50a5: local tree 6,473,470; effective ceiling 6,473,499; slack 29. The new record is bounded to actual owned growth; no inherited debt or blanket allowance is added.git diff --checkpasses. No production or test behavior changed after the passing real-Gateway replay. Replacement exact-head CI remains the final broad verification gate.Exact-head CI: attributed inherited test-budget debt
At head
5316e2f03939a1fc72f2a11f3dd3dc3c7ec3633e, checks-node-changed passed again, including the real-Gateway authorization tests. checks-fast-baseline-ratchets failed only the test-line ceiling on CI's newer merged snapshot: 6,477,752 lines versus 6,477,701 ceiling, 51 over. Independent index-only reproduction of exact comparison base83a74589d30bbab769dd7c14d164619fd960404emeasures 6,477,681 lines versus 6,477,630 ceiling: already 51 over, delta zero. This PR's +71 LF lines and separate +71 allocation leave inherited debt unchanged. No shared scalar, inherited-debt allowance, or unrelated tests were altered. The CI run is now terminal: all three PostgreSQL conformance jobs passed, with no checks still pending in this run. The final aggregate gate propagates the inherited test-line failure; overall CI remains red.Post-deployment production-backed detail validation
The former shared-deployment blocker is resolved: independently verified Deploy Test 41952356152 and production Deploy 41952769498 both completed successfully at exact backend SHA
7d4aa932ed113fc289bcd2e936d8f667d3cd2958. The backend compatibility repair preserves the existing index rather than bypassing its deletion guard.After those receipts, reran the committed
scripts/bench-template-detail.mtsworkload againsthttps://clawhub.ai: five serial ABAB pairs, fresh authenticated connections, exact@openclaw/[email protected], full verified archive/extraction/detail path. Isolated baselinec8094c112b45a3b7ab378af7668be0f60cafd0cdand candidate5316e2f03939a1fc72f2a11f3dd3dc3c7ec3633eGateways used ports 19562/19561. Candidate production-source blobs are unchanged from reviewed/measured7e0d2c402e6f182402e8c027d9315fb42721d7d8. Process/module startup is excluded; every sample, including the slower first baseline, is retained.Average 3.55x faster / 71.79% lower, passing the predeclared >=2x rule. Full JSON equality passes for all ten responses and against the saved pre-deployment response. Recorded 1-minute host load: 10.05–10.77. No cache was added. This is now shared-post-deployment, production-backed detail-read proof; it does not claim this OpenClaw PR has merged or been deployed. Both task-owned isolated processes were closed after measurement. Production work Gateway port 19455 was never restarted and remained HTTP 200. Prior screenshots and pre-deployment measurements above are preserved as separate evidence.
Terminal CI follow-up
Run 41954663511 completed at exact head
5316e2f03939a1fc72f2a11f3dd3dc3c7ec3633e. All PostgreSQL conformance jobs passed: 1/3, 2/3, and 3/3. No jobs remain pending. The final aggregate CI gate reportschecks-baseline-ratchets finished with failure (selected=true), propagating the already-proven 51-line inherited test-budget debt above. No additional independent scoped failure appeared. The classifier's sampled-main comparison is informational; direct measurement of the exact CI comparison base establishes the inherited debt. No guard was bypassed and no CI rerun was dispatched. This closes the pending PostgreSQL observation; the PR remains open and unmerged.