Repository navigation
improve: avoid model-context worker startup delays in tests - #145708
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 maintainer review before merge. Reviewed September 12, 2026, 2:43 AM ET / 06:43 UTC (Revision 2). ClawSweeper reviewWhat this changesCompile the session model-context worker through the shared build and test preparation registry so functional tests avoid repeated TypeScript startup delays. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix absent from the inspected main and latest release. No actionable correctness or security defect was found; the previous review also recorded no findings. Priority: P2 Review scores
Verification
How this fits togetherSession model-context reads select transcript history for an agent turn using a serial worker pool. The shared entrypoint registry lets package builds and prepared test runs launch compiled workers while standalone source runs retain their existing resolution. flowchart TD
A[Session context request] --> B[Serial worker pool]
C[Shared entrypoint registry] --> D[Package and test preparation]
C --> E[Worker URL resolution]
D --> E
E --> B
B --> F[Transcript context worker]
F --> G[Selected conversation history]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +2, Tests +1, Other -2. Total +1 across 4 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one shared descriptor for package and test compilation while preserving source-mode resolution, installed paths, and serial transcript-read semantics. Do we have a high-confidence way to reproduce the issue? The source establishes why this worker misses compiled test preparation, and the body reports a controlled cold-cache reproduction. The timing failure was not independently reproduced in this read-only review. Is this the best way to solve the issue? Yes: reusing the existing registry fixes the preparation boundary and removes duplicate build metadata without introducing another compilation path or changing test budgets. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9e44dba516e8. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
Main independently landed the same worker registry consolidation in #145708. Keep its canonical registration and remove the duplicate introduced by Git integration; all three worker registration/build files now match main exactly.
…145541) * fix: avoid full agent copies during schema version preflight Read agent schema metadata through the existing bounded read-only child while retaining source admission and native close ownership. Keep full validation and required private snapshot paths unchanged. Accepted storage scope: #145412. * fix: preserve source inspection lock tolerance Keep the existing 30-second source-reader wait, prove an exclusive rollback writer can release after eight seconds without refusing an update, and reuse Kysely and the existing schema-version/transaction owners. No timeout or SQL guard exceptions are added. * fix: keep schema inspection out of lightweight version imports Keep the version reader byte-identical to its prior lightweight contract. Header inspection retains Kysely and the deferred transaction owner, with read-only PRAGMAs owned by the existing SQLite configuration boundary. Full neutral Linux package build, native lock tests, and large-store proof pass without changing budgets or allowlists. * test: preserve ownership admission during header preflight Cover config-only ownership admission for all six agent roles after integrating the current startup isolation owner. Header-only inspection must not skip copied-owner refusal or alter source bytes. * fix: share the model context worker entrypoint Let runtime launch, packaged output, and precompiled test workers consume one declaration. This removes measured cold TypeScript loading from functional worker proof without increasing deadlines or changing the worker's source or installed path. * fix: retain only the upstream context worker registration Main independently landed the same worker registry consolidation in #145708. Keep its canonical registration and remove the duplicate introduced by Git integration; all three worker registration/build files now match main exactly.
…penclaw#145541) * fix: avoid full agent copies during schema version preflight Read agent schema metadata through the existing bounded read-only child while retaining source admission and native close ownership. Keep full validation and required private snapshot paths unchanged. Accepted storage scope: openclaw#145412. * fix: preserve source inspection lock tolerance Keep the existing 30-second source-reader wait, prove an exclusive rollback writer can release after eight seconds without refusing an update, and reuse Kysely and the existing schema-version/transaction owners. No timeout or SQL guard exceptions are added. * fix: keep schema inspection out of lightweight version imports Keep the version reader byte-identical to its prior lightweight contract. Header inspection retains Kysely and the deferred transaction owner, with read-only PRAGMAs owned by the existing SQLite configuration boundary. Full neutral Linux package build, native lock tests, and large-store proof pass without changing budgets or allowlists. * test: preserve ownership admission during header preflight Cover config-only ownership admission for all six agent roles after integrating the current startup isolation owner. Header-only inspection must not skip copied-owner refusal or alter source bytes. * fix: share the model context worker entrypoint Let runtime launch, packaged output, and precompiled test workers consume one declaration. This removes measured cold TypeScript loading from functional worker proof without increasing deadlines or changing the worker's source or installed path. * fix: retain only the upstream context worker registration Main independently landed the same worker registry consolidation in openclaw#145708. Keep its canonical registration and remove the duplicate introduced by Git integration; all three worker registration/build files now match main exactly.
What Problem This Solves
Resolves a problem where source-backed functional tests time out while starting the first model-context worker. This reproduced the cold-worker failure in #145665: six async cases exceeded their existing five-second launch deadline on unchanged main source.
Why This Change Was Made
Register the model-context worker with the existing runtime process entrypoint owner and consume that descriptor from its launcher. The shared build and test preparation now compile this worker with the other declared workers. Remove the duplicate explicit build entry and document the ownership, following the existing model-catalog worker pattern.
User Impact
Local and CI tests avoid repeated source-loader startup for model-context reads. The worker keeps its serial pool, cancellation behavior, read contract, and existing packaged output path. Installed Gateways already use compiled workers; this PR does not claim an installed-Gateway latency improvement.
Evidence
The diagnostic benchmark is a local artifact. No new test mocks, prewarming hooks, retry policy, or timeout exceptions were introduced.