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: blocked before merge. What this changesThis PR runs Retry-After failover tests against compiled runtime entries and prepares their declarations before typechecking, alongside release-derived changes. Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 4 items remain The prior config-reader finding is repaired, and the compiled-runtime transport coverage remains a useful distinct contribution. The security label prevents cleanup closure; this review does not clear the broader release-derived branch for merge. Priority: P2 Before merge
FindingsNone. Provenance
Tests
Agent review detailsHow this fits togetherOpenClaw’s agent tests exercise provider retries and model fallback. The changed build preparation supplies compiled runtime modules and type declarations to the test and typechecking runners. flowchart TD
A[Selected typechecking shards] --> B{Compiled runtime needed?}
B -->|Yes| C[Build runtime entries]
C --> D[Restore owned runtime artifacts]
D --> E[Publish type declarations]
E --> F[Run typechecking]
B -->|No| F
C --> G[Report preparation failure]
D --> G
E --> G
Technical reviewBest possible solution: Carry the focused transport-test optimization onto current main’s build owners while keeping unrelated release changes in their own reviewed scope. Do we have a high-confidence way to reproduce the issue? Not applicable to a user bug: contributor measurements establish the test-loading performance problem, and source inspection confirms the latest config-reader repair without executing it. Is this the best way to solve the issue? Yes for the focused optimization: compiled runtime entries avoid repeated source transpilation and reuse existing artifact owners. The broader branch needs integration with current main before that assessment extends to the merge candidate. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 33c4e4d822f7. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfacePR surface statistics unavailable: the file list is incomplete. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 HistoryReview history (43 earlier review cycles; latest 8 shown)
Reviewed October 8, 2026, 6:04 PM ET / 22:04 UTC (Revision 44). |
54ad034 to
8447348
Compare
|
Used this branch to make our own test iteration faster, and the measurement is worth recording here. Running
On the source-loaded path the same file needs roughly 328s for its first case, and on that box its first attempt does not finish preparing inside the default 300s The other half of the cost is preparation: Nothing from our local iteration setup is in this branch. The attempt logging and the raised publication timeout used while diagnosing the parent PR stay local, and the compiled-runtime imports here are this PR's own change. |
8447348 to
56c1025
Compare
|
Rebased onto the current parent head and the declaration finding is repaired. Re-verified end to end on a 4-core Linux box, in the order the review named. SHA mapping, since the rebase replays every commit under a new SHA:
The previous head stays reachable at The finding The preparation built the runtime and the base declaration partition through the build wrapper with declarations unprotected, so the output clean removed Two changes address it. The runtime entries are built with the declaration skip flag set, which arms the cleaner's protection of declared outputs it does not regenerate. The declarations the shard needs are then published through the canonical staged writer ( Acceptance evidence
The synthetic-fixture guard from |
e3d71e7 to
9505fa6
Compare
Fixes #150231.
What Problem This Solves
The retry-after failover e2e spends ~340s on its first case per worker because a source-mode run transpiles every bundled plugin through Jiti, even though the compiled artifacts already exist under
dist/. Profile and details in #150231. Related: #148580 (merged), whose e2e test file this edits.Change
Evidence
Measured on a 4-core Linux box, Node 24.20.0:
pnpm tsgo:core:testgreen, andscripts/check-plugin-sdk-exports.mtsgreen both after a full build and again after that preparation, reportingOK: All 154 public plugin-sdk subpaths verified. The earlier form of the preparation reported 309 failed artifact checks withMISSING PUBLIC DTS DEPENDENCY: dist/plugin-sdk/*.d.ts.Preparation validation: cold, full build, restoration failure, and a Windows path containing spaces
Added because the review asked for the cold and full-build preparation sequences to be verified end to end, for the artifact set to be asserted rather than inferred from an exit code, and for a Windows run from a checkout path containing spaces.
Every run below drives the same entry the shard launcher calls,
buildTsgoCoreTestTypedRuntimeDist, inside the samewithDistArtifactOwnershipcontext the launcher uses, from a separate physical checkout withpnpm install --frozen-lockfile. The driver is a short script that prints each child it launches and forwards torunManagedCommandunchanged; it edits no preparation code. Hosts are described generically and the checkout prefix is trimmed from the paths below.1. Cold preparation, no prior dist output
Command, after removing
distanddist-runtimefrom the checkout:The preparation reported the owners it restores and then ran them in order:
plugins:assets:build,tsdown-ai,external-plugins:local-dist,plugins:assets:copy,runtime-postbuild, followed by the staged base declaration publish. Exit code 0.The resulting artifact set is 26362 paths: the unified runtime entries and
dist/agentsoutput, 4073 paths underdist/extensions, 3201 underdist-runtime, the five export HTML template files,dist/build-info.jsonat 188 bytes anddist/channel-catalog.jsonat 37910 bytes. No plugin-SDK declarations and nodist/control-uiexist, which is correct for a run with no preceding full build.2. Full build, then preparation, then an artifact assertion rather than an exit code
scripts/build-all.mtscompleted with exit 0 in 14m 33.6s on a 4-core Linux host. The preparation then ran on that same tree and returned exit 0.The assertion compared the full path list of
dist,dist-runtimeand the per-extension outputs before and after the preparation:dist/.buildstampanddist/.runtime-postbuildstampdist/plugin-sdk/**/*.d.tsdeclarations, 4119dist/extensionspaths, 3247dist-runtimepaths, the five export HTML template files,dist/build-info.json,dist/channel-catalog.json,dist/cli-startup-metadata.jsonat 32783 bytes, anddist/control-uiThe two removed files are local build-metadata markers.
scripts/lib/local-build-metadata-paths.mtslists them asLOCAL_BUILD_METADATA_DIST_PATHS, documented there as paths that should not be packaged as source. Their only readers are local entry points that use them to decide whether a localdiststill matches the source:scripts/run-node.mts,scripts/check-gateway-watch-regression.mtsandscripts/test-live-shard.mts. Nothing in the type-check shard reads them, and no step in that shard rewrites them, so the effect is limited to that staleness signal, where a later localrun-noderebuilds instead of reusing. Every other artifact the full build produced is still present afterwards.3. A restoration failure, and what it leaves behind
The same driver was run from the state a full build leaves, with one restored owner forced to return non-zero. The first restored owner,
plugins:assets:build, was the one failed, since that is the worst case: the compile has already cleaned the output roots and nothing has been restored yet.if (buildCode !== 0) { return buildCode; }), so no type-check reads the partial tree and the job fails rather than passingdist/extensionspaths, which is where the isolated plugin dists are staged, 3168dist-runtime/extensionspaths, the export HTML templates,dist/build-info.jsonanddist/channel-catalog.jsondist/cli-startup-metadata.jsonanddist/control-uiSo a restoration failure is a reported failure with a bounded partial tree. The clean does not reach the declarations the staged writer owns, nor the Vite-owned control UI output, and the failure cannot be mistaken for success because the shard launcher stops on the non-zero code.
4. Windows, from a checkout path containing spaces
On a Windows host, a fresh clone under a directory whose name contains a space, then
pnpm install --frozen-lockfile, then the same preparation. Exit code 0.The children launched, all through the shell-free path this PR adds, with paths shown relative to the checkout root:
The artifact check on that tree: all four runtime entries present with their declarations, meaning
dist/agents/admitted-run-context.jsand.d.ts,dist/agents/embedded-agent-runner.jsand.d.ts,dist/agents/model-fallback-runner.jsand.d.ts, anddist/state/openclaw-agent-db.jsand.d.ts; 10662 files underdist, 2737 underdist-runtime, 3087 underdist/extensions, the five export HTML template files,dist/build-info.jsonat 188 bytes anddist/channel-catalog.jsonat 37910 bytes. No child failed on the percent-encoded file URLs, which is the case the shell-free launch exists for.Regression coverage for the preparation path, with matched measurements
The preparation path had no tests of its own, so this adds focused coverage at the script owners that already test those modules.
test/scripts/tsgo-core-test-shards.test.ts: the launcher's preparation guard is now the namedneedsTypedRuntimeDistPreparation, covered for every case it can take (an owner shard selected with its file present, an owner selected without the file, a selection with no owner, and an empty selection), plus an assertion in the existing synthetic-fixture driver test that a fixture which selects the owner shard while carrying no dist-dependent test starts no build.test/scripts/tsgo-core-test-dist-build.test.ts: the seven preparation children in order, each launched through the dist-artifact entry so a checkout path containing spaces stays a percent-encoded file URL; the env each phase depends on (the declaration skip and CLI-metadata preservation on the compile, the node fallback on every restored owner, the caller env on the declaration publish); and the three exit codes that stop the run (a failing compile, a failing owner, a failing declaration publish).Measured on a 4-core Linux host, Node 24.19.0, on the paths those tests cover:
dist/, so the owning shard checks instead of reporting unresolved modules.d.tsThe child costs of those same seven children on the recorded runs are in the sections above, where the declaration publish is child 7 at 129.7 s and the full build before it took 14 m 33.6 s on the Linux run.
CI on this head
The merged head
77206144b6cis green (run 36050779043): 75 checks pass and none fail, with the platform-specific ones skipped. The type-check stripe that owns the built-runtime e2e prepared the artifacts before it ran its shards:Measured hosted cost of the preparation on this run: about 190 s, from the preparation start to the base declaration publish finishing, paid once on
check-test-types-core-1only. That is about half the 380 s cold figure measured on a four-core host above. The stripe finished in 492 s at 20:01:19Z, whilecheck-lint-core-5(513 s, 20:01:40Z) andcheck-lint-core-2(598 s, 20:02:15Z) finished later andci-gatewaited on them, so on this run the preparation added runner time to one job and did not lengthen the run's wall time.Per-case CI seconds for the two changed files, summed from the job log of the tooling shard that ran them (
core-tooling-11-hosted-2, run 35928208348):test/scripts/tsgo-core-test-shards.test.tsran 26 cases in 17.83 s, of which the fixture driver case is 17.19 s and every other case is at most 564 ms, andtest/scripts/tsgo-core-test-dist-build.test.tsran 10 cases in 3 ms. That run predates the five cases added here, so the merged head's own single-worker figures are:tsgo-core-test-shards.test.ts33 cases in 28.6 s of wall time, the fixture driver case being 27.2 s of it, andtsgo-core-test-dist-build.test.ts13 cases in 18 ms of test time inside a 9.2 s run. The push-compact CI plan omits the tooling shards, which is why those per-case CI figures come from the run that still included them.