Skip to content

fix(plugins): stop ambient source startup for external plugins - #116759

Merged
vincentkoc merged 1 commit into
mainfrom
fix/source-external-plugin-startup-20260731
Jul 31, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/source-external-plugin-startup-20260731

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where source-checkout gateways implicitly started externalized plugins as core-bundled startup plugins, forcing live TypeScript transforms and adding roughly 1.3-1.5 seconds to startup.

Why This Change Was Made

Source discovery still exposes externalized plugin packages, but bundledDist: false packages now follow the external explicit-startup policy. Explicit plugin entries, allowlists, configured channels, and selected providers still activate them. Core-bundled plugins keep their existing default startup behavior.

Packaged users were not affected because these plugin trees are excluded from the core package and separately installed packages use compiled runtimes.

User Impact

Developers running OpenClaw from a source checkout no longer pay ambient startup cost for externalized plugins they did not configure.

Evidence

@vincentkoc vincentkoc self-assigned this Jul 31, 2026
@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Jul 31, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 31, 2026
@clawsweeper

clawsweeper Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 31, 2026, 6:10 AM ET / 10:10 UTC.

ClawSweeper review

What this changes

The PR prevents source-checkout gateway startup from implicitly launching externalized plugins solely because their manifests request onStartup, while retaining activation through explicit plugin selection, configured channels, and selected providers.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open for explicit maintainer review. This focused draft changes the startup policy for source-discovered packages marked bundledDist: false; the supplied diff is internally consistent, but the intentional compatibility change should be confirmed against current plugin-discovery behavior before landing.

Priority: P2
Reviewed head: ebd192f2fbbf014c613a578b3899d0129d761d44
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is small and targeted with relevant test additions, while independent confirmation of the changed source-checkout startup behavior and compatibility contract remains needed.
Proof confidence 🌊 off-meta tidepool Not applicable: The PR author is a repository MEMBER, so the external-contributor proof gate does not apply; the merge review should still examine the claimed after-fix source-checkout run before landing.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The PR author is a repository MEMBER, so the external-contributor proof gate does not apply; the merge review should still examine the claimed after-fix source-checkout run before landing.
Evidence reviewed 4 items Focused policy change: The proposed startup planner treats a plugin discovered from the bundled source root with packageBuild.bundledDist === false as externally owned for activation-policy purposes, preserving ambient startup only for core-bundled packages.
Explicit activation coverage: The added tests cover the no-configuration case and explicit enablement through plugins.entries and plugins.allow, which matches the stated distinction between ambient and intentional startup.
Repository policy fit: The repository policy assigns externally owned plugin behavior to the plugin boundary and treats startup/default changes as compatibility-sensitive, so this needs maintainer confirmation rather than automatic cleanup.
Findings None None.
Security None None.

How this fits together

The gateway builds a startup plan from discovered plugin records and the operator configuration. That plan decides which channel and provider plugins are loaded during gateway boot, affecting source-checkout startup cost and whether an unconfigured plugin becomes active.

flowchart LR
  A[Plugin manifests] --> B[Plugin discovery registry]
  C[OpenClaw configuration] --> D[Startup activation policy]
  B --> D
  D --> E[Gateway startup plan]
  E --> F[Loaded channel and provider plugins]
  F --> G[Gateway boot time and capabilities]
Loading

Decision needed

Question Recommendation
Should source-discovered packages marked bundledDist: false permanently follow the external explicit-startup policy even when their manifest sets onStartup? Adopt explicit startup: Confirm that externalized source packages must be activated by configuration, channel setup, provider selection, or an allowlist, then refresh the branch against current main and land with focused after-fix evidence.

Why: The patch changes an existing startup default for a class of source-checkout installations; the correct balance between startup cost and implicit plugin availability is an intentional product and compatibility policy choice.

Before merge

  • Resolve merge risk (P1) - An existing source-checkout workflow that relied on an externalized package's manifest onStartup without any explicit entry, allowlist, configured channel, or selected provider will stop loading that plugin at gateway boot; this is an intentional compatibility change that needs owner confirmation and upgrade-oriented proof.
Agent review details

Security

None.

PR surface

Source +5, Tests +77. Total +82 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 7 2 +5
Tests 1 77 0 +77
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 84 2 +82

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Confirm and prove the startup contract (recommended)
    Before merge, confirm the intended external-plugin activation contract and add or attach an after-fix source-checkout run showing an unconfigured externalized plugin stays unloaded while each supported explicit path still loads it.
  2. Keep the previous source behavior
    If ambient onStartup remains a supported source-checkout contract, do not merge this policy rewrite and address the startup cost through a non-breaking path.

Technical review

Best possible solution:

Keep core-bundled plugins on ambient startup, require explicit activation for externalized source packages, and document or diagnose any supported workflow that previously depended on implicit startup.

Do we have a high-confidence way to reproduce the issue?

Unclear for a live current-main run: the supplied diff and PR description identify the source-checkout decision path, but the review context does not include an independently inspectable after-fix runtime trace for the affected externalized package.

Is this the best way to solve the issue?

Unclear: mapping source-discovered bundledDist: false packages to the existing external explicit-startup policy is a narrow maintainable solution if that policy is intentional, but maintainers must first confirm that it does not retire a supported ambient-startup contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 44ce19821fbc.

Labels

Label changes:

  • add P2: This is a bounded source-checkout startup-performance and plugin-activation correction, with a compatibility decision but no evidence of a release-blocking outage.
  • add merge-risk: 🚨 compatibility: The patch changes whether previously ambient source-discovered external plugins load at boot, which can affect existing developer configurations that relied on that behavior.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The PR author is a repository MEMBER, so the external-contributor proof gate does not apply; the merge review should still examine the claimed after-fix source-checkout run before landing.

Label justifications:

  • P2: This is a bounded source-checkout startup-performance and plugin-activation correction, with a compatibility decision but no evidence of a release-blocking outage.
  • merge-risk: 🚨 compatibility: The patch changes whether previously ambient source-discovered external plugins load at boot, which can affect existing developer configurations that relied on that behavior.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The PR author is a repository MEMBER, so the external-contributor proof gate does not apply; the merge review should still examine the claimed after-fix source-checkout run before landing.

Evidence

What I checked:

  • Focused policy change: The proposed startup planner treats a plugin discovered from the bundled source root with packageBuild.bundledDist === false as externally owned for activation-policy purposes, preserving ambient startup only for core-bundled packages. (src/plugins/gateway-startup-plugin-plan.ts:421, ebd192f2fbbf)
  • Explicit activation coverage: The added tests cover the no-configuration case and explicit enablement through plugins.entries and plugins.allow, which matches the stated distinction between ambient and intentional startup. (src/plugins/channel-plugin-ids.test.ts:1443, ebd192f2fbbf)
  • Repository policy fit: The repository policy assigns externally owned plugin behavior to the plugin boundary and treats startup/default changes as compatibility-sensitive, so this needs maintainer confirmation rather than automatic cleanup. (AGENTS.md:1, 44ce19821fbc)
  • Current review state: The PR is a draft, is assigned to its MEMBER author, carries the protected maintainer label, and GitHub reports it as cleanly mergeable but behind current main; protected maintainer items remain open for explicit handling. (44ce19821fbc)

Likely related people:

  • vincentkoc: The available PR context identifies this MEMBER as the assignee and author of the focused startup-policy change; no broader local history attribution was established in this review. (role: current plugin-startup policy contributor; confidence: low; commits: ebd192f2fbbf; files: src/plugins/gateway-startup-plugin-plan.ts, src/plugins/channel-plugin-ids.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Refresh against current main and confirm the owner-approved activation policy.
  • Attach or link a redacted after-fix source-checkout result that shows both the unloaded ambient case and the supported explicit activation cases.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@vincentkoc

Copy link
Copy Markdown
Member Author

Maintainer decision: adopt explicit startup for source-discovered packages with packageBuild.bundledDist === false.

Ambient onStartup is a core-bundled default, not a supported activation contract for externalized packages. Source users retain every intentional activation path: plugins.entries, plugins.allow, configured channels, and selected providers. Packaged installs are unaffected because these externalized source trees are not shipped in the core package.

After-fix proof: https://github.com/openclaw/openclaw/actions/runs/30622479155

  • Source probes completed successfully on exact head ebd192f2fbbf014c613a578b3899d0129d761d44.
  • Default and skipChannels startup dropped from 14 plugins to 12; teams-meetings and zoom-meetings are absent.
  • Gateway plugin-load p50 dropped from 1823.1ms to 385.7ms for default startup and from 1924.5ms to 367.3ms for skipChannels.
  • HTTP-listen p50 dropped from 4726.2ms to 3178.4ms for default startup and from 5120.1ms to 3260.2ms for skipChannels.
  • Kova repeated the five selected scenarios three times: 15/15 functional PASS. Its PARTIAL report came only from the retired runtimeDeps.stage expectation in Kova 8c5b9ff6; that stale contract is now removed by fix: stop requiring retired runtime dependency spans Kova#81 and the coordinated workflow cleanup is merged in fix(ci): stop scheduling retired Kova runtime dependency coverage #116760.

Rank-up moves:

  • Current main was checked after the review. No commit since this branch base touches src/plugins/gateway-startup-plugin-plan.ts or src/plugins/channel-plugin-ids.test.ts; GitHub reports the PR cleanly mergeable. I am intentionally not rebasing because that would discard exact-head proof without changing the reviewed surface.
  • The after-fix source result above proves the ambient unloaded case. The focused startup-planner suite passed 171/171 and covers all four supported explicit paths: entry, allowlist, configured channel, and selected provider.

@vincentkoc
vincentkoc marked this pull request as ready for review July 31, 2026 10:18
@vincentkoc
vincentkoc merged commit 58580ff into main Jul 31, 2026
76 of 83 checks passed
@vincentkoc
vincentkoc deleted the fix/source-external-plugin-startup-20260731 branch July 31, 2026 10:18
@vincentkoc

Copy link
Copy Markdown
Member Author

Post-merge exact-state proof: https://github.com/openclaw/openclaw/actions/runs/30623132812

  • OpenClaw: 58580fff2f9c5e23ac1a217286365530657ea599
  • Kova: e2ff1b66e5597a0df2ddb50276257e36069513dd
  • Landed source startup: 12 plugins, with teams-meetings and zoom-meetings absent; plugin load was 347.8ms for default and 335.7ms for skipChannels.
  • Current Kova contract: four selected scenarios, 62/62 proof obligations, no missing required spans, and no findings on the successful retry.
  • The first attempt had one 1005.3MB bundled-startup RSS sample against the 1000MB ceiling. The failed-job retry passed at 971.8MB, consistent with the earlier repeat-3 samples. This is measurement noise, not evidence for raising the threshold.
  • Final retry: 4/4 PASS. Agent cold/warm was 3658/3897ms, with 3424ms of cold pre-provider time still unattributed.

vincentkoc added a commit that referenced this pull request Jul 31, 2026
* commit 'refs/frozen/talk-pcm-output-main-refresh':
  fix(skills): allow autonomous sweep sync (#116755)
  fix(irc): recognize punctuation in nickname mentions (#116758)
  fix(plugins): require explicit source external startup (#116759)
  fix(whatsapp): keep sends running when typing presence fails (#116739)
  fix(cli): reject dangling config path escapes (#116738)
  fix(qa): authenticate summaries and bound native scenario commands (#116748)
  fix(bedrock): reject truncated streams and preserve audio results (#116743)
  docs(skill): isolate autonomous issue sweep worktrees
  fix(ci): retire Kova runtime deps coverage (#116760)
  chore(i18n): refresh native locales (#116640)
  fix(ollama): resolve web search secret refs (#104829)
  fix(ollama): honor stop sequences and async payload hooks (#116737)
  fix(ollama): stop oversized stream records from growing memory (#107473)
  fix(agents): preserve thinking for runtime-selected Ollama models (#116584)
vincentkoc added a commit that referenced this pull request Jul 31, 2026
* origin/main: (23 commits)
  fix(agents): preserve resumed turns after stale terminal events (#116777)
  fix(browser): preserve tab-bound browser authorization (#116778)
  fix(doctor): correct SQLite-backed automation warnings (#116769)
  fix(release): skip unavailable Buzz QA runner (#116753)
  feat(plugins): externalize DuckDuckGo search (#116740)
  refactor(reply): simplify task-owned typing refresh (#116770)
  fix(chat): explain chat-only model limits
  feat(models): expose tool support to clients
  docs(skill): require independent proof before issue closure
  fix(skills): allow autonomous sweep sync (#116755)
  fix(irc): recognize punctuation in nickname mentions (#116758)
  fix(plugins): require explicit source external startup (#116759)
  fix(whatsapp): keep sends running when typing presence fails (#116739)
  fix(cli): reject dangling config path escapes (#116738)
  fix(qa): authenticate summaries and bound native scenario commands (#116748)
  fix(bedrock): reject truncated streams and preserve audio results (#116743)
  docs(skill): isolate autonomous issue sweep worktrees
  fix(ci): retire Kova runtime deps coverage (#116760)
  chore(i18n): refresh native locales (#116640)
  fix(ollama): resolve web search secret refs (#104829)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 1, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 1, 2026
* commit 'refs/frozen/talk-pcm-output-main-refresh':
  fix(skills): allow autonomous sweep sync (openclaw#116755)
  fix(irc): recognize punctuation in nickname mentions (openclaw#116758)
  fix(plugins): require explicit source external startup (openclaw#116759)
  fix(whatsapp): keep sends running when typing presence fails (openclaw#116739)
  fix(cli): reject dangling config path escapes (openclaw#116738)
  fix(qa): authenticate summaries and bound native scenario commands (openclaw#116748)
  fix(bedrock): reject truncated streams and preserve audio results (openclaw#116743)
  docs(skill): isolate autonomous issue sweep worktrees
  fix(ci): retire Kova runtime deps coverage (openclaw#116760)
  chore(i18n): refresh native locales (openclaw#116640)
  fix(ollama): resolve web search secret refs (openclaw#104829)
  fix(ollama): honor stop sequences and async payload hooks (openclaw#116737)
  fix(ollama): stop oversized stream records from growing memory (openclaw#107473)
  fix(agents): preserve thinking for runtime-selected Ollama models (openclaw#116584)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 1, 2026
* origin/main: (23 commits)
  fix(agents): preserve resumed turns after stale terminal events (openclaw#116777)
  fix(browser): preserve tab-bound browser authorization (openclaw#116778)
  fix(doctor): correct SQLite-backed automation warnings (openclaw#116769)
  fix(release): skip unavailable Buzz QA runner (openclaw#116753)
  feat(plugins): externalize DuckDuckGo search (openclaw#116740)
  refactor(reply): simplify task-owned typing refresh (openclaw#116770)
  fix(chat): explain chat-only model limits
  feat(models): expose tool support to clients
  docs(skill): require independent proof before issue closure
  fix(skills): allow autonomous sweep sync (openclaw#116755)
  fix(irc): recognize punctuation in nickname mentions (openclaw#116758)
  fix(plugins): require explicit source external startup (openclaw#116759)
  fix(whatsapp): keep sends running when typing presence fails (openclaw#116739)
  fix(cli): reject dangling config path escapes (openclaw#116738)
  fix(qa): authenticate summaries and bound native scenario commands (openclaw#116748)
  fix(bedrock): reject truncated streams and preserve audio results (openclaw#116743)
  docs(skill): isolate autonomous issue sweep worktrees
  fix(ci): retire Kova runtime deps coverage (openclaw#116760)
  chore(i18n): refresh native locales (openclaw#116640)
  fix(ollama): resolve web search secret refs (openclaw#104829)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant