Skip to content

fix: explain why installed plugin tools are missing from sessions - #199068

Open
roboclaw-bot wants to merge 4 commits into
mainfrom
openclaw/plugin-tool-guidance
Open

roboclaw-bot wants to merge 4 commits into
mainfrom
openclaw/plugin-tool-guidance

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes missing or misleading guidance when a plugin validates and registers successfully but its tools are absent from a session.

User Impact

Plugin authors and operators can distinguish registration, profile selection, explicit policy, and runtime availability instead of repeatedly rebuilding or reloading a valid plugin. Tool selection, permission defaults, and existing allow/deny behavior are unchanged; no migration is required.

Why This Change Was Made

Connect the quickstart and missing-tool checklist to the existing session diagnostics, manifest profile grants, the two callback signatures, and reload handoff behavior. Complete diagnostic inventories with manifest-declared candidates using the existing policy explainer, and project owner-scoped manifest profiles in the tool catalog. New scaffolds test their own declarative callback through public package imports, without depending on internal SDK test helpers.

The diagnostic addition does not import skipped plugin runtimes or execute their factories merely to explain policy. A policy-allowed tool absent from the preview remains unavailable with construction and health explicitly unconfirmed. The existing full preview retains its normal construction behavior.

Evidence

Runtime proof — attached redacted CLI capture · head d9734e4b6ce3df30bc41f85c235037db744d5484 · captured November 14, 2026 at 19:57 UTC. The inspectable text attachment is below; prior verification details are preserved.

  • 65 focused repository tests passed across catalog, inventory, SDK, authoring, and availability explanation suites; all 32 authoring tests were rerun after the public-export repair. Two generated-consumer tests also passed against the extracted, integrity-checked package with no repository SDK aliases.
  • Production and touched-test typechecks, targeted type-aware lint, formatting, docs MDX/config checks, and git diff --check passed. pnpm build:runtime exited 0; the canonical runtime-package integrity check passed.
  • Reproduced the original empty catalog profile projection and missing diagnostic row. A native Node consumer also reproduced ERR_PACKAGE_PATH_NOT_EXPORTED for the initially used internal test helper; the repair removes that import rather than expanding SDK exports, and the regression checks generated imports against the actual package export map.
  • Actual built-CLI Gateway proof passed on disposable application home/state/config/workspace, a named profile, loopback port, token auth, and a synthetic echo plugin: loaded plugin → actionable coding-profile exclusion → owner-scoped catalog profiles → hot-applied narrow grant → session availability → real plugin callback output.
  • No live LLM or external provider inference was used: fixture/echo supplied synthetic model metadata only. This proves the Gateway diagnostic/config/plugin-execution paths, not live model selection. No operator Gateway, live configuration, or source plugin instance was changed. The owned Gateway exited cleanly and its port returned ECONNREFUSED afterward.
  • Fresh independent autoreview (Codex), P0–P2, covered the repair from e3e825aa9d44ffc02f906f03475eb30eceaa4315 to the snapshot committed as e89c389139a92b5da4579595c89ea201189f6cca: scoped-clean; no actionable findings. It assessed the supplied runtime/consumer evidence without executing project code. The published d9734e4b6ce3df30bc41f85c235037db744d5484 tree is identical to that reviewed repair commit.
  • The completed hosted ClawSweeper review on earlier head e3e825aa9d44ffc02f906f03475eb30eceaa4315 had zero findings and identified the shipped-entrypoint proof gap addressed below. That historical hosted verdict has not been rerun or claimed for the repaired head.
  • docs:check-links:anchors reports two existing failures in untouched files: duplicate agent-process-environment in docs/tools/acp-agents-setup.md and the agents-api-mvp release-note link in docs/releases/2026.10.1.md; no new broken links were reported.

Runtime proof

Inline text attachment: pr-199068-runtime-proof-d9734e4.txt (4,733 bytes; not a separate CDN/file upload).
SHA256: 6fd6b4bc6d33016dccc8c7805c95cf633217be11d5212fc72b9d7d95786fc812.

Open the attached redacted actual CLI capture
PR #199068 - Runtime proof (redacted actual CLI capture)
Head: d9734e4b6ce3df30bc41f85c235037db744d5484
Capture completed: 2026-11-14T19:57:46.662Z
CLI: public node openclaw.mjs; profile plugin-guidance-attachment; loopback port 39815; token auth.
Scope: actual Gateway/WebSocket/config reload/plugin execution; synthetic model metadata only; no LLM/provider inference.
Format: selected response subtrees copied from fresh raw CLI stdout; unrelated tool entries and local paths omitted. This is not reconstructed from prior prose.
Runtime reuse: five owning source-file hashes matched the published tree; the complete 24,115-file JavaScript closure matched the earlier built proof.
Built entry.js SHA256: e45c42bc99313f84fabbc74f192257a47db4160855d6783c14bab9d182117652
Built index.js SHA256: 7c93ca9aa9769210e3e08eb808a220a4334e140e8d1e311fa3f76a719ff68e3e
Runtime JS closure SHA256: 03862075d939a7583a1d6d9cdaa4bc2ab93458738d7629daf030afbd364695de
Build provenance: retained stamp names e3e825a with the reviewed repair applied; that repaired tree was committed as e89c389 and is tree-identical to head d9734e4.

[2026-11-14T19:57:39.808Z] $ node openclaw.mjs --profile plugin-guidance-attachment gateway health --port 39815 --json
exit: 0
stdout (bounded actual response):
{
  "ok": true,
  "coreReady": true,
  "plugins": {
    "loaded": [
      "guidance-echo"
    ],
    "errors": [],
    "unavailable": []
  },
  "defaultAgentId": "main",
  "modelRuntime": {
    "degraded": false,
    "pendingAgents": []
  }
}

[2026-11-14T19:57:40.653Z] $ node openclaw.mjs --profile plugin-guidance-attachment gateway call sessions.create --port 39815 --params '{"key":"agent:main:attached-plugin-guidance-proof","label":"Attached proof fixture"}' --json
exit: 0
stdout (bounded actual response):
{
  "ok": true,
  "key": "agent:main:attached-plugin-guidance-proof",
  "runStarted": false,
  "resolved": {
    "modelProvider": "fixture",
    "model": "echo"
  }
}

[2026-11-14T19:57:42.393Z] $ node openclaw.mjs --profile plugin-guidance-attachment gateway call tools.effective --port 39815 --params '{"sessionKey":"agent:main:attached-plugin-guidance-proof"}' --json
exit: 0
stdout (bounded actual response):
[
  {
    "id": "guidance_echo",
    "status": "excluded",
    "reasons": [
      {
        "kind": "profile",
        "label": "tools.profile: \"coding\" does not include \"guidance_echo\". Add tools.alsoAllow: [\"guidance_echo\"].",
        "source": "tools.profile"
      }
    ]
  }
]

[2026-11-14T19:57:43.246Z] $ node openclaw.mjs --profile plugin-guidance-attachment gateway call tools.catalog --port 39815 --params '{"includePlugins":true}' --json
exit: 0
stdout (bounded actual response):
[
  {
    "id": "guidance_echo",
    "label": "Guidance Echo",
    "description": "Echo an innocuous fixture string.",
    "fullDescription": "Echo an innocuous fixture string.",
    "parameters": [
      {
        "name": "input",
        "required": true,
        "type": "string"
      }
    ],
    "optional": false,
    "source": "plugin",
    "pluginId": "guidance-echo",
    "defaultProfiles": [
      "messaging"
    ]
  }
]

[2026-11-14T19:57:43.890Z] $ node openclaw.mjs --profile plugin-guidance-attachment config set tools.alsoAllow '["guidance_echo"]' --strict-json
exit: 0
stdout (bounded actual response):
Updated tools.alsoAllow. Change will apply without restarting the gateway.

[2026-11-14T19:57:45.360Z] $ node openclaw.mjs --profile plugin-guidance-attachment gateway call tools.effective --port 39815 --params '{"sessionKey":"agent:main:attached-plugin-guidance-proof"}' --json
exit: 0
stdout (bounded actual response):
[
  {
    "id": "guidance_echo",
    "status": "available",
    "reasons": []
  }
]

[2026-11-14T19:57:45.994Z] $ node openclaw.mjs --profile plugin-guidance-attachment gateway call tools.invoke --port 39815 --params '{"name":"guidance_echo","sessionKey":"agent:main:attached-plugin-guidance-proof","args":{"input":"attached-proof-199068"}}' --json
exit: 0
stdout (bounded actual response):
{
  "ok": true,
  "toolName": "guidance_echo",
  "output": {
    "content": [
      {
        "type": "text",
        "text": "attached-proof-199068"
      }
    ],
    "details": {
      "echo": "attached-proof-199068",
      "toolCallIdType": "string"
    }
  },
  "source": "plugin"
}

Cleanup (actual Gateway log and socket check):
2026-11-14T19:57:58.344+00:00 [shutdown] completed cleanly in 65ms
{"checkedAt":"2026-11-14T19:58:03.663Z","host":"127.0.0.1","port":39815,"result":"ECONNREFUSED"}

Interpretation boundary: tools.effective proves session exclusion/availability. Direct operator tools.invoke explicitly requests the named plugin tool and is not used as a pre-grant denial oracle.
Built Gateway and packaged-consumer commands and observations

The fixture config selected tools.profile: "coding". Its plugin declared contracts.tools: ["guidance_echo"] and toolMetadata.guidance_echo.profiles: ["messaging"]. All commands used the same disposable OPENCLAW_HOME, OPENCLAW_STATE_DIR, OPENCLAW_CONFIG_PATH, OPENCLAW_PROFILE, OPENCLAW_GATEWAY_PORT, and synthetic token. The actual Gateway selected Node 26.12.1.

pnpm build:runtime
node openclaw.mjs --profile plugin-guidance-smoke config validate
node openclaw.mjs --profile plugin-guidance-smoke gateway run --bind loopback --port "$PORT"
# Separate matching-profile CLI clients, authenticated over the real Gateway WebSocket:
node openclaw.mjs --profile plugin-guidance-smoke gateway health --port "$PORT" --json
node openclaw.mjs --profile plugin-guidance-smoke gateway call sessions.create --port "$PORT" --params '{"key":"agent:main:plugin-guidance-proof","label":"Plugin guidance runtime proof"}' --json
node openclaw.mjs --profile plugin-guidance-smoke gateway call tools.effective --port "$PORT" --params '{"sessionKey":"agent:main:plugin-guidance-proof"}' --json
node openclaw.mjs --profile plugin-guidance-smoke gateway call tools.catalog --port "$PORT" --params '{"includePlugins":true}' --json
node openclaw.mjs --profile plugin-guidance-smoke config set tools.alsoAllow '["guidance_echo"]' --strict-json
node openclaw.mjs --profile plugin-guidance-smoke gateway call tools.effective --port "$PORT" --params '{"sessionKey":"agent:main:plugin-guidance-proof"}' --json
node openclaw.mjs --profile plugin-guidance-smoke gateway call tools.invoke --port "$PORT" --params '{"name":"guidance_echo","sessionKey":"agent:main:plugin-guidance-proof","args":{"input":"known-runtime-echo"}}' --json

Observed results, asserted independently:

health: coreReady=true; plugins.loaded=["guidance-echo"]; plugins.errors=[]
sessions.create: runStarted=false; resolved model=fixture/echo
before: id=guidance_echo; status=excluded; kind=profile; source=tools.profile
reason: tools.profile: "coding" does not include "guidance_echo". Add tools.alsoAllow: ["guidance_echo"].
catalog: pluginId=guidance-echo; defaultProfiles=["messaging"]
config set: Updated tools.alsoAllow. Change will apply without restarting the gateway.
after: id=guidance_echo; status=available; reasons=[]
invoke: ok=true; source=plugin; output.details={"echo":"known-runtime-echo","toolCallIdType":"string"}
cleanup: clean Gateway shutdown; owned loopback port ECONNREFUSED

The grant transition is asserted on tools.effective. Direct operator tools.invoke explicitly requests a named plugin tool, so its pre-grant behavior is not used as an agent-selection denial oracle.

Consumer proof used the real built CLI's plugins init, then the supported self-contained package owner (node scripts/package-openclaw-for-docker.mjs --skip-build --runtime-only --allow-unreleased-changelog --output-dir <fixture-package-dir> --output-name openclaw-consumer.tgz). The owner restored all temporary package-source changes, and tarball integrity passed. Generated npm test -- --maxWorkers=1 ran 2 passing tests against the extracted package's public dist/plugin-sdk/tool-plugin.js; existing test/dependency installations were reused, with no source SDK aliases. Native resolution still rejected openclaw/plugin-sdk/plugin-test-runtime with ERR_PACKAGE_PATH_NOT_EXPORTED.

Source binding: the runtime was built from e3e825aa9d44ffc02f906f03475eb30eceaa4315 plus the reviewed two-file repair later committed as e89c389139a92b5da4579595c89ea201189f6cca; all five owning source-file SHA256 values were checked against that commit. Publication added only a tree-identical attribution commit.

built dist/entry.js SHA256: e45c42bc99313f84fabbc74f192257a47db4160855d6783c14bab9d182117652
built dist/index.js SHA256: 7c93ca9aa9769210e3e08eb808a220a4334e140e8d1e311fa3f76a719ff68e3e
runtime package SHA256: 22496b317b556c238409b90d7e85e7236acb6356694d43b82d34479b4d2f8eb5

Simplification: reuse the policy/explanation and manifest-eligibility owners rather than adding another evaluator, SDK API, configuration option, or standing prompt. The consumer repair removes the internal-helper dependency; no SDK exports or selection machinery are added.

Contributor credit

Requested and co-authored with @jacobtomlinson.

Work sessions

Linked for team reference; these sessions aren’t public.

Worked on by

roboclaw-bot and others added 2 commits November 14, 2026 17:53
Worked on by:
- @jacobtomlinson

Co-authored-by: jacobtomlinson <[email protected]>
OpenClaw-Publication: e9f86f9f-fa75-403b-aac2-4c13afd4dc51
@clawsweeper

clawsweeper Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime cli CLI command changes agents Agent runtime and tooling size: M labels Nov 14, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 14, 2026
@clawsweeper

clawsweeper Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head e3e825aa9d44ffc02f906f03475eb30eceaa4315, but the PR head is now d9734e4b6ce3df30bc41f85c235037db744d5484. Its old verdict and PR readiness labels are no longer current.

Next step
Comment @clawsweeper re-review when the current head is ready; pushes after the first review are not reviewed automatically.

Review history (1 earlier review cycle)
  • reviewed 2026-11-14T18:08:45.463Z sha e3e825a :: needs maintainer review before merge. :: none

roboclaw-bot and others added 2 commits November 14, 2026 18:23
Worked on by:
- @jacobtomlinson

Co-authored-by: jacobtomlinson <[email protected]>
OpenClaw-Publication: 013441c2-b2e7-42f4-9893-db254b59fad3
@clawsweeper clawsweeper Bot removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Nov 14, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling cli CLI command changes docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant