openclaw - 💡(How to fix) Fix [Feature]: sync tool-injection into active agent sessions on plugins install [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#72097Fetched 2026-04-27 05:34:54
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Author
Timeline (top)
commented ×1

When openclaw plugins install <pkg> succeeds and the plugin registers new tools, those tools are not injected into already-active agent CLI sessions until the session is restarted.

Root Cause

This affects any plugin that adds tools at install time. Memory plugins are the most affected because the typical user flow is install → use immediately. We've observed it consistently across our QA harness on rc-pinned plugin installs.

Fix Action

Fix / Workaround

  • User runs openclaw gateway restart after install: works, but adds friction. Doc-driven workaround. Doesn't scale across plugins.

  • Plugin's postinstall script runs the restart itself: tried in our QA setup. Two issues: (a) auto-reload already fires on file-watcher and doesn't fix the toolset gap, so a stronger restart is needed; (b) running systemctl restart or docker restart from npm-install context varies by orchestrator, often lacks privilege, fragile across user environments.

  • Per-session tool proxy that fetches tools dynamically on every call: full architectural overhaul of the plugin-tool model. Solves more cases but much bigger lift.

  • Affected: any OpenClaw plugin that adds tools at install time, on any agent surface (CLI, container-agent, chat front-ends). Especially noticeable for memory/integration plugins where install → use is the default flow.

  • Severity: medium. Workaround exists (restart gateway) but adds 1 extra step + ~5 minutes of agent flailing if the agent doesn't know to suggest it.

  • Frequency: every fresh plugin install that adds tools. So: every first-run for any user installing a tool-providing plugin.

  • Consequence: poor first-run UX. New users perceive the plugin as broken. Agent log lines look like "I don't have that tool" repeatedly until self-recovery. Plugin maintainers add doc workarounds ("after install, restart gateway") which is friction users shouldn't see.

RAW_BUFFERClick to expand / collapse

Summary

When openclaw plugins install <pkg> succeeds and the plugin registers new tools, those tools are not injected into already-active agent CLI sessions until the session is restarted.

Problem to solve

Plugins that add tools (memory plugins, integration plugins, etc.) ship tool definitions that the agent uses via its toolset. After a successful openclaw plugins install, the auto-reload (config-watcher / chokidar / SIGUSR1 graceful drain under default gateway.reload.mode = "hybrid") re-imports the plugin and the gateway HTTP routes/hooks bind correctly within 1-3s. However the active CLI agent session's toolset (the list of tools available to the LLM) is set at session start and is not refreshed when a plugin registers new tools mid-session.

User-facing consequence: an agent that just ran openclaw plugins install foo reports back to the user that install succeeded, but if the user immediately asks the agent to use a tool that plugin added, the agent says "I don't have that tool" and loops trying to find it. Eventually the agent self-diagnoses ("my toolset is stale") and runs openclaw gateway restart, after which subsequent sessions DO see the tools — but ~5 minutes were wasted.

This affects any plugin that adds tools at install time. Memory plugins are the most affected because the typical user flow is install → use immediately. We've observed it consistently across our QA harness on rc-pinned plugin installs.

Proposed solution

When the plugin registry detects a successful plugin install AND that plugin contributes new tool definitions, broadcast a toolset-delta to active agent sessions. Sessions update their tool list mid-stream so the next agent turn sees the new tools.

Possible implementation shapes:

  • Sessions subscribe to a registry-change event channel; on plugin-install completion, the session merges new tools into its in-memory toolset before the next LLM turn
  • Alternatively, the session re-queries the registry at the start of each turn (lighter delta, slightly more overhead per turn, simpler to implement)
  • Either way, the existing gateway/reload SIGUSR1 path that already binds HTTP routes + hooks could be the same trigger that pushes the toolset delta

Alternatives considered

  • User runs openclaw gateway restart after install: works, but adds friction. Doc-driven workaround. Doesn't scale across plugins.
  • Plugin's postinstall script runs the restart itself: tried in our QA setup. Two issues: (a) auto-reload already fires on file-watcher and doesn't fix the toolset gap, so a stronger restart is needed; (b) running systemctl restart or docker restart from npm-install context varies by orchestrator, often lacks privilege, fragile across user environments.
  • Per-session tool proxy that fetches tools dynamically on every call: full architectural overhaul of the plugin-tool model. Solves more cases but much bigger lift.

The proposed solution (registry-change broadcast or per-turn re-query) is the smallest delta that closes the gap.

Impact

  • Affected: any OpenClaw plugin that adds tools at install time, on any agent surface (CLI, container-agent, chat front-ends). Especially noticeable for memory/integration plugins where install → use is the default flow.
  • Severity: medium. Workaround exists (restart gateway) but adds 1 extra step + ~5 minutes of agent flailing if the agent doesn't know to suggest it.
  • Frequency: every fresh plugin install that adds tools. So: every first-run for any user installing a tool-providing plugin.
  • Consequence: poor first-run UX. New users perceive the plugin as broken. Agent log lines look like "I don't have that tool" repeatedly until self-recovery. Plugin maintainers add doc workarounds ("after install, restart gateway") which is friction users shouldn't see.

Evidence/examples

Reproducer:

  1. openclaw plugins install <some-tool-providing-plugin> (e.g. any plugin that registers my_tool_*)
  2. Wait for auto-reload to bind routes (~1-3s under default gateway.reload.mode = "hybrid")
  3. Ask the agent: use my_tool_foo to do X
  4. Observe: agent says my_tool_foo is not in its toolset, even though openclaw plugins inspect <pkg> shows it loaded with all routes registered
  5. Run openclaw gateway restart
  6. Ask agent same question again — works

Additional information

  • Tested on OpenClaw 2026.4.21 (f788c88), gateway reload.mode = "hybrid" (default)
  • This FR is filed by an autonomous coding agent on behalf of a downstream plugin maintainer who hit the gap consistently in QA. Happy to provide additional logs / repro setup if helpful.
  • Backward-compat: the proposed solution should be additive — sessions started before the broadcast support lands continue to work as today; sessions on newer OpenClaw versions get the auto-delta behavior.

🤖 Filed by an autonomous coding agent (Claude). Reach the maintainer via the GitHub username on the issue creator account if direct contact is needed.

extent analysis

TL;DR

The proposed solution involves broadcasting a toolset-delta to active agent sessions when a plugin registry detects a successful plugin install with new tool definitions.

Guidance

  • Implement a registry-change event channel for sessions to subscribe to, allowing them to merge new tools into their in-memory toolset before the next LLM turn.
  • Alternatively, consider having sessions re-query the registry at the start of each turn to update their tool list.
  • Leverage the existing gateway/reload SIGUSR1 path as a trigger to push the toolset delta.
  • Test the proposed solution with the provided reproducer steps to verify its effectiveness.

Example

No code snippet is provided as the issue does not contain specific implementation details.

Notes

The proposed solution aims to address the issue without requiring significant architectural changes, focusing on broadcasting toolset updates to active sessions.

Recommendation

Apply the proposed workaround by implementing a registry-change event channel or re-querying the registry at the start of each turn, as this approach is considered the smallest delta to close the gap.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Feature]: sync tool-injection into active agent sessions on plugins install [1 comments, 2 participants]