Repository navigation
fix(plugins): keep Gateway responsive during initial plugin loading - #198302
Conversation
Bind retained plugin sources locally and reconstruct initial captures cooperatively without synchronous preparation-worker calls. Preserve frozen recovery and await failed reconstruction cleanup. Co-authored-by: Krzysztof Kisiel <[email protected]> Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]>
Worked on by: - @vincentkoc Co-authored-by: vincentkoc <[email protected]> OpenClaw-Publication: 9a492d90-c371-4517-8294-a206174abd17
|
🦞👀 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. What this changesThis PR reconstructs executable plugin bindings locally and yields during initial capture instead of synchronously calling the preparation worker. Example: Load initial-probe and execute its initial_probe tool, which imports initial-dependency.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: the initial-binding stall remains on main, all four earlier findings are addressed, and no new actionable defect was found. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe plugin loader prepares source and dependency custody in a worker, then binds executable modules to plugin instances that register Gateway capabilities. flowchart LR
A[Plugin loader] --> B[Preparation worker]
B --> C[Retained source and inspection facts]
C --> D[Cooperative local reconstruction]
D --> E[Plugin instance bindings]
E --> F[Gateway tools and callbacks]
Technical reviewBest possible solution: Keep source inspection and custody with the existing worker while using the shared capture steps for cooperative initial binding and synchronous lazy consumers. Do we have a high-confidence way to reproduce the issue? Current-main source exposes the synchronous worker-call path, and the supplied base/head regression reports 78 waits versus zero with dependency execution preserved; this read-only review ran no target code. Is this the best way to solve the issue? The repair addresses executable binding at its existing owner, removes remote mapping callbacks, and shares acquisition logic across synchronous and cooperative consumers without introducing a competing capture implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5a1c9b58767f. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +279, Tests +542, Other +5. Total +826 across 27 files. Added test files: 1. 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. 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 HistoryReview history (1 earlier review cycle)
Reviewed November 13, 2026, 10:21 AM ET / 15:21 UTC (Revision 2). |
Keep worker-inspected module facts when reconstructing local executable bindings; include the new runtime owners in the extracted PR wrapper inventory and reconcile exact capture lifecycle proofs. Remove the unused async recovery API from this initial-binding repair. Co-authored-by: Krzysztof Kisiel <[email protected]> Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]>
Worked on by: - @vincentkoc Co-authored-by: vincentkoc <[email protected]> OpenClaw-Publication: 70724870-17ea-47f5-9efd-1e35a58e0ab1
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Preserve cooperative local binding and async cleanup while integrating current main snapshot admission, native source validation, and shared-worker regressions. Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]>
…penclaw#198302) * fix(plugins): keep Gateway responsive during initial plugin loading Bind retained plugin sources locally and reconstruct initial captures cooperatively without synchronous preparation-worker calls. Preserve frozen recovery and await failed reconstruction cleanup. Co-authored-by: Krzysztof Kisiel <[email protected]> Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]> * fix(plugins): keep Gateway responsive during initial plugin loading Worked on by: - @vincentkoc Co-authored-by: vincentkoc <[email protected]> OpenClaw-Publication: 9a492d90-c371-4517-8294-a206174abd17 * fix(plugins): preserve off-thread source inspection during local binding Keep worker-inspected module facts when reconstructing local executable bindings; include the new runtime owners in the extracted PR wrapper inventory and reconcile exact capture lifecycle proofs. Remove the unused async recovery API from this initial-binding repair. Co-authored-by: Krzysztof Kisiel <[email protected]> Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]> * Publish openclaw/rri508-initial-binding Worked on by: - @vincentkoc Co-authored-by: vincentkoc <[email protected]> OpenClaw-Publication: 70724870-17ea-47f5-9efd-1e35a58e0ab1 --------- Co-authored-by: Krzysztof Kisiel <[email protected]> Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Fixes Gateway stalls when dependency-heavy plugins are initially loaded: executable binding calls back into the preparation worker synchronously while the plugin loader is running.
User Impact
Initial plugin loading keeps the foreground event loop moving while preserving plugin execution, retained-source ownership, and recovery. No configuration or public SDK change is required. This removes the measured synchronous worker-wait path; it is not a universal startup-latency guarantee.
Why This Change Was Made
The worker retains source custody and plain inspection facts. The existing capture owner reconstructs local executable bindings, replaying ordered acquisitions without repeating covered source inspection or retaining a host Jiti compiler. Initial file reconstruction and receipt validation yield cooperatively; synchronous CLI and lazy callbacks drain the same steps synchronously. Frozen recovery, native admission, and worker-exit cleanup remain attached to their existing owners. Obsolete remote source-mapping callbacks are removed.
Related: #176192. Thanks to @ExoHumann (Krzysztof Kisiel) for the original cooperative-capture/local-binding design and investigation. This is a separately implemented, initial-binding-only repair against current source, not a copy of that contributor branch.
Scope excludes the separate failed-reload transaction repair in #198262, broader startup optimization, and the original PR's Windows installed-package claims. The unused asynchronous recovery API and test-only callers were removed; existing synchronous recovery remains. The complete #198262 patch was not composed or retested here. No merge is requested.
Evidence
November 15 conflict reconciliation
Merged main
a4cc2adb5d1a746296803f73955e089df98a68dfinto the existing PR lineage. Tested local commit:864eecaa97934addc51268b18e8958f3310a16ae; tree:266a9295626f4a05ed61cd49c99e4057eb322ef8. Published to the existing PR through the explicitly approved standard Git push route, without force. New-head CI is pending; the previous green run is historical evidence only.003dccb34635d6d42d8df7607f5d2b4bd6c63ff65bae89873aacd6affb50f1d2. This is the authorized substitute, not local ClawSweeper or autoreview; the reviewer did not execute tests. Simplification added no new production machinery.Historical repair evidence
Tested repair commit:
d3b1a14b0f7d118e9e599a714763410f56a7fdc9; published head:2dce362c929017c06959d0a25829b83fefd8330b; base:60aead2d9454cbd26c4101ecf8613599c540d6b2. The publisher's final metadata commit has no tree change: both tested and published trees areaa66e7b493443e176c25ddfb08178c57a62e4876.pnpm test:ci-failed 198302 --runreplay: 66 passed / 3 skipped across 6 files, 210.88s wrapper. All baseline ratchets passed. Separate host-inspection validation: 68 passed across 5 files, with core/plugins-platform test typechecks. Consumer validation: 10 passed across 3 files. Combined repair lint, format, and whitespace checks passed. These runs overlap.initial_probetool call, fresh dependency sentinel in its result, and exact final sentinel in chat history. Both provider requests returned HTTP 200 SSE. The existing call-through transport hook selects the native tool on request one and no tool on request two; responses and plugin execution are not mocked. Earlier auto-choice text-only attempts are not counted as tool-flow proof. Final runtime rebuild: 2m 7s; test: 22.16s; full build/test wrapper: 185.35s. Synthetic real-Gateway E2E also passed.4d02b3eb91c69eb1e55dc10fead0c561d4547ca7c547ea1d029672e345bc24c1. This is the explicitly approved independent-review substitute, not an autoreview or local ClawSweeper result. Reviewers did not independently execute tests. New exact-head CI and hosted re-review remain separate.Test growth is 542 net lines for the real Gateway tool-flow fixture and distinct custody, cleanup, off-thread inspection, and accounting regressions. A focused allocation records exactly 142 lines beyond the unchanged 400-line allowance. The repair removes unused asynchronous recovery machinery rather than retaining parallel APIs.
Coverage limits: one Linux host; no new Windows installed-package, universal responsiveness, upgrade, or combined #198262 verification is claimed. No credentials, live configuration, provider request bodies, or generated proof files are included.
Worked on by