Repository navigation
fix(qa): run Telegram plugin source in --source-gateway userbot runs - #163718
Conversation
The Telegram userbot runner's --source-gateway mode claimed to run the exact TypeScript checkout, but in any built checkout the Gateway executed dist/extensions/telegram. Gateway startup passes preferBuiltPluginArtifacts, which swaps bundled source entries for their canonical root build, so Telegram proofs silently exercised stale built code. Source mode now selects the bundled Telegram source entry through plugins.load.paths, the documented intentional source-entry selection. The alias merges into the bundled candidate, keeping bundled trust, and the loader executes the checkout's Telegram source. The inert Vitest-only OPENCLAW_TEST_TRUST_BUNDLED_PLUGINS_DIR is dropped; OPENCLAW_BUNDLED_PLUGINS_DIR stays so dist core copies resolve the same bundled root. The source-mode readiness default grows from 300 s to 900 s because compiling the Telegram source pushed /readyz to 537 s on a loaded host. Help and skill docs now say core and Telegram run from source while other plugins use built output.
|
🦞👀 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 October 2, 2026, 2:56 PM ET / 18:56 UTC. ClawSweeper reviewWhat this changesThe Telegram QA runner selects the checkout’s Telegram plugin in source mode, increases its default startup wait, and clarifies which other plugins still use built output. Merge readiness✅ Ready for maintainer review The fix remains useful: fetched main still permits source-mode Telegram proofs to execute built plugin code. The pinned patch uses the existing loader contract correctly, and no actionable introduced defect was found. Priority: P2 Review scores
Verification
How this fits togetherThe Telegram QA runner creates an isolated Gateway configuration and drives test conversations. Gateway plugin discovery and loading determine whether those conversations exercise checkout source or compiled artifacts. flowchart TD
A[QA run options] --> B[Isolated Gateway configuration]
B --> C{Source mode selected?}
C -->|Yes| D[Explicit Telegram source path]
C -->|No| E[Normal built plugin selection]
D --> F[Gateway plugin loader]
E --> F
F --> G[Telegram scenario evidence]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +22, Docs +3, Other +9. Total +34 across 4 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep Telegram source selection explicit in source-mode QA runs and document the remaining built-plugin behavior accurately. Do we have a high-confidence way to reproduce the issue? Yes, source inspection establishes the mechanism: main supplies a discovery root without explicit source selection, allowing the loader’s built-artifact preference to win. The author reports a confirming Gateway probe; this review did not execute it. Is this the best way to solve the issue? Yes. Using the documented configured-source selection repairs the runner at its configuration boundary without changing shared loader policy or forcing every plugin through source compilation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against fecba819ef2e. 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 '79be075e5aa46be9e42dbd53ed6e30e81469210a': (33 commits) fix(ui): keep selected-text comment input readable while scrolling (#163772) test(memory): open corpus database explicitly fix: bound Doctor migration capture to plugin data (#163780) fix(ui): gate system information at the shared reader (#160982) chore(db): reclassify worker inventory sites with caller evidence (#163754) refactor(channels): deslop Slack and Matrix (#163740) fix(agents): reject empty sessions_search queries in the tool schema (#129120) perf(nodes): load only what a worker turn needs (#160442) test(cli): assert concise Gateway failure copy in CLI process tests (#163649) refactor(discord): deslop discord (#163728) fix(workboard): make Sessions boards work on multi-agent Gateways (#163761) test(gateway): add sustained heap retention diagnostics (#163764) test(ui): disambiguate session filter controls refactor(plugins): deslop imessage, mattermost, and voice-call (#163767) fix(qa): run Telegram plugin source in --source-gateway userbot runs (#163718) feat(macos): add a --no-activate launch flag for background automation (#163758) fix(agents): preserve host authority across module reloads (#163725) perf(gateway): serve the listener before multi-gigabyte store validation and honor clean-close receipts at startup (#163690) fix: keep video widgets scrollable and preload initial frames (#163762) feat(memory): add a provider-neutral memory provider runtime (#162175) ...
…penclaw#163718) The Telegram userbot runner's --source-gateway mode claimed to run the exact TypeScript checkout, but in any built checkout the Gateway executed dist/extensions/telegram. Gateway startup passes preferBuiltPluginArtifacts, which swaps bundled source entries for their canonical root build, so Telegram proofs silently exercised stale built code. Source mode now selects the bundled Telegram source entry through plugins.load.paths, the documented intentional source-entry selection. The alias merges into the bundled candidate, keeping bundled trust, and the loader executes the checkout's Telegram source. The inert Vitest-only OPENCLAW_TEST_TRUST_BUNDLED_PLUGINS_DIR is dropped; OPENCLAW_BUNDLED_PLUGINS_DIR stays so dist core copies resolve the same bundled root. The source-mode readiness default grows from 300 s to 900 s because compiling the Telegram source pushed /readyz to 537 s on a loaded host. Help and skill docs now say core and Telegram run from source while other plugins use built output.
* commit '1fda703fb4d3630e4633461967b2a2186e8f15fd': (33 commits) fix(ui): keep selected-text comment input readable while scrolling (openclaw#163772) test(memory): open corpus database explicitly fix: bound Doctor migration capture to plugin data (openclaw#163780) fix(ui): gate system information at the shared reader (openclaw#160982) chore(db): reclassify worker inventory sites with caller evidence (openclaw#163754) refactor(channels): deslop Slack and Matrix (openclaw#163740) fix(agents): reject empty sessions_search queries in the tool schema (openclaw#129120) perf(nodes): load only what a worker turn needs (openclaw#160442) test(cli): assert concise Gateway failure copy in CLI process tests (openclaw#163649) refactor(discord): deslop discord (openclaw#163728) fix(workboard): make Sessions boards work on multi-agent Gateways (openclaw#163761) test(gateway): add sustained heap retention diagnostics (openclaw#163764) test(ui): disambiguate session filter controls refactor(plugins): deslop imessage, mattermost, and voice-call (openclaw#163767) fix(qa): run Telegram plugin source in --source-gateway userbot runs (openclaw#163718) feat(macos): add a --no-activate launch flag for background automation (openclaw#163758) fix(agents): preserve host authority across module reloads (openclaw#163725) perf(gateway): serve the listener before multi-gigabyte store validation and honor clean-close receipts at startup (openclaw#163690) fix: keep video widgets scrollable and preload initial frames (openclaw#163762) feat(memory): add a provider-neutral memory provider runtime (openclaw#162175) ...
What Problem This Solves
Fixes: Telegram userbot proofs run with
--source-gatewaysilently executed the builtdist/extensions/telegramplugin instead of the checkout's Telegram source whenever a build existed. That happens in any worktree prepared withnode scripts/worktree-setup.mjs gateway.User Impact
User impact: maintainers proving Telegram changes with
--source-gatewaynow exercise the editedextensions/telegramsource, so a proof can no longer pass against stale built code. Other plugins, including the model provider and memory-core, still use built output when present; the help text and skill docs now say so. Source-mode Gateway startup is slower because it compiles the Telegram plugin, and its default readiness wait grows from 300 s to 900 s.--gateway-ready-timeout-msstill overrides it.Why This Change Was Made
Gateway startup intentionally passes
preferBuiltPluginArtifacts: true, which swaps bundled source entries for their canonical root build. That is the documented behavior indocs/help/debugging.md. The runner's existingOPENCLAW_BUNDLED_PLUGINS_DIRoverride only chose the discovery root, so the swap still happened.Source mode now uses the documented exception, an intentional source-entry selection. It adds
plugins.load.paths: [<repo>/extensions/telegram]. Discovery merges that alias into the independently discovered bundled candidate, which keepsorigin: "bundled"and its trust, and the loader then runs the source entry. No loader or bundled-dir trust rule changes.The Vitest-only
OPENCLAW_TEST_TRUST_BUNDLED_PLUGINS_DIRwas inert in the runner, so it is removed.OPENCLAW_BUNDLED_PLUGINS_DIRstays so the dist core copies that built plugins load also resolveextensions/as the trusted bundled root.I also tried aliasing the whole
extensions/root, so every loaded plugin would run from source. The HTTP listener alone took 358 s before channels started, so this change scopes source execution to Telegram.Evidence
loadGatewayPlugins → loadOpenClawPlugins → loadRuntimePluginCandidaterequiringdist/extensions/telegram/index.jsfrom the TypeScript loader.handleInboundMessageLikeinextensions/telegram/src/bot-handlers.inbound-pipeline.tsfired on the delivered DM. 0 of 1,228 resolved Telegram modules came from dist; onlymemory-coreandopenailoaded from built output. Discovery reports a single Telegram candidate withorigin: "bundled"andconfigSelected: true./readyzarrived after 537 s on a host at load average ~60–85. Event-loop stalls showedcpuCoreRatioaround 0.12, so the host starved the process of CPU and I/O. The previous 300 s default would have failed that run.run-mock-sut-user-e2e.test.mjsasserts source mode selects the checkout's Telegram plugin directory and built mode adds no load path. It fails on the previous runner (actual: undefined). The loader side of the contract is already covered bysrc/plugins/loader.hooks-and-runtime.test-utils.ts.node --testonrun-mock-sut-user-e2e.test.mjsandtelegram-run-composition.test.mjs: 31/31 pass..test.mjsfiles do not run in PR CI, so the change adds 0 CI seconds.curlyerrors in the runner, 0 in the test.