Repository navigation
fix: native worker turns fail to load WebSocket transport - #140071
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
|
Codex review: blocked before merge. Reviewed September 6, 2026, 7:36 AM ET / 11:36 UTC. ClawSweeper reviewWhat this changesBundle WebSocket transports into portable workers so native turns and lazy transcription can connect without an adjacent ws installation. Regression provenanceRegression provenance — verified: source commit Merge readiness⛔ Blocked before merge - 1 item remains This remains a useful, focused repair: current main lacks the worker transport transforms, and no introduced correctness defect was found. The captured paired-Mac verification supports the fix; the protected maintainer PR remains open for normal landing. Priority: P1 Review scores
Verification
How this fits togetherOpenClaw transfers a portable worker bundle to cloud or paired machines to run native agent turns. Its build must include the WebSocket code used to connect to the Gateway and transcription providers. flowchart TD
A[Installed transport loaders] --> B[Worker build transforms]
B --> C[Portable worker bundle]
C --> D[Gateway client]
C --> E[Lazy transcription client]
D --> F[Gateway connection]
E --> G[Transcription provider]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +136, Other +27. Total +163 across 2 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep standalone dependency resolution in the worker build owner while preserving installed-runtime transport options and lazy transcription initialization. Do we have a high-confidence way to reproduce the issue? Yes: importing the Gateway client from a relocated worker without ws installed reaches the unresolved package lookup on current main; the supplied regression and native-run observations corroborate it. This review did not execute that path. Is this the best way to solve the issue? Yes: extending the existing worker-only dependency transform addresses the packaging owner without changing installed runtime behavior or adding another transport implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against eea0b64eff16. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* commit '3ed964c8ca6206d26ecc0b6567ccd1389d9948fc': (36 commits) refactor(plugins): unify install config snapshot preparation (openclaw#140081) fix: cloud provisioning stays failed after temporary storage recovers (openclaw#140021) fix(ci): preflight job outputs exceed 1 MiB on full-plan pull requests (openclaw#140018) refactor: consolidate command and provider helpers (openclaw#140072) fix(doctor): replace unavailable TUI cleanup advice (openclaw#140074) fix(plugins): avoid scoped pack failures and missing runtime entries (openclaw#140016) fix: clarify background command timeouts (openclaw#140022) fix(workboard): refresh board navigation while retaining drafts (openclaw#139952) fix: preserve newer chat drafts when rewind completes (openclaw#140066) feat(transcripts): browse and export saved meeting archives (openclaw#139875) fix(cron): complete timeout test observation phase (openclaw#140076) fix(macos): show the full automation count (openclaw#139692) fix: native worker turns fail to load WebSocket transport (openclaw#140071) fix(cli): complete quoted Bash option values (openclaw#140034) fix(chat): show command instructions while pending (openclaw#140041) refactor(cli): use canonical resume result schema (openclaw#140056) fix: restore package acceptance across install runtimes (openclaw#140062) refactor(auto-reply): keep model-selection fixtures in tests (openclaw#140069) fix(plugins): remove owned aliases before uninstalling files (openclaw#140065) fix: completed replies hang when context-engine cleanup stalls (openclaw#140023) ...
…40071) * fix: bundle WebSocket transports in portable workers * test: include worker transports in declaration fixtures
What Problem This Solves
Fixes an issue where starting a native OpenClaw turn on a cloud or paired worker fails before its first reply because the transferred worker cannot find
ws/package.json.Related: #138724, #138900. Found during the requested post-merge main live validation.
Why This Change Was Made
The installed WebSocket loaders deliberately select the real
wsimplementation to preserve options and receiver behavior under Bun. The portable worker build must bundle that same transport instead of resolving an installed package at runtime. Its existing dependency transform now covers the Gateway client, Gateway server, and lazy realtime-transcription loaders; ordinary installed runtime paths are unchanged.The eager failure was introduced by #139919 (
56924648b69b97ee0d9eca5dcac9d3aa58fce3f4), after the earlier cloud-session candidate proof. The deferred loaders share the same standalone-bundle requirement. No dependency, configuration, protocol, or SQLite schema changes.User Impact
Native worker turns can initialize their Gateway connection from the transferred bundle. Realtime transcription also retains its lazy transport without requiring a
wsinstallation beside that bundle.Evidence
b72a36a77d1b9fe5b7acb4e94042fddf827d7e40: repository-only creation and dispatch succeeded; the native turn failed in 907ms with the exact missing-package error. The session was reclaimed, pairing removed, processes joined, and preexisting state preserved.wsinstallation, and verifies client headers, echo, normal close, and lazy transcription headers/audio exchange/close. It failed before the fix with the samews/package.jsonerror and passes afterward. All 10 focused tests pass.pnpm buildpassed on exact candidate01371e3fa0ade67a995b6b93471aeaecd8fa1349in 3m35.8s. The emitted worker has no remainingws/package.jsonlookups.Tooling/production: +27 lines in the existing build owner. Tests/support: +139 lines. The growth replaces three worker package lookups with bundled transport imports while retaining the installed-runtime contract. npm audit is non-blocking at the maintainer's request.
CI follow-through: the first ready-state run 34030297710 passed 71 jobs but failed 37 declaration cases across four shards because the existing minimal declaration fixture omitted the new build inputs. Commit
707d1e9e4f5221463dab47dedf022f28b3c97c6eadds those three paths to its canonical placeholder list. All four affected suites now pass locally (61 tests, two platform-specific skips), and scoped independent review is clean. This child changes only that test fixture; production and the full-build/live candidate above remain byte-identical. Required CI 34030846467 passed on the new head: 76 jobs passed, 17 skipped, no failures or reruns.ClawSweeper’s 11:36 UTC review found no actionable correctness/security findings and accepted the real native-flow proof. Its “Add data-model compatibility proof” item is not applicable: this diff changes the build plugin and two test files only; it changes no SQLite DDL, schema version, stored representation, migration, retention, projection, or runtime storage reader/writer. The worker archive remains the existing content-addressed JavaScript artifact with the same manifest and transfer protocol. No migration proof or schema approval is needed for this build-only repair. The intervening commit only corrects declaration fixtures.
Landed and verified on main: merged as
8319778f3eb5601bbde4486c645051be0e5c4d7a. A fresh full build of that main commit passed in 3m7.9s. The real paired-native lifecycle then passed again: creation 52ms, initial dispatch 7.867s, write/read turn 9.203s, accepted editor save, Stop and stopped readback, new-environment restore 1.402s, exact read 8.470s, and final Stop. Root independently read both canonical destroyed environment rows with empty attachments, matched the stopped editor bytes, and verified all owned processes absent and the test port closed. The Gateway exited naturally with code 0 in 14.406s. No additional Gateway checkout was created.