Skip to content

fix(openclaw): plugin manifest and configurable exit-3 handling - #2783

Closed
kzzalews wants to merge 1 commit into
rtk-ai:developfrom
kzzalews:fix/openclaw-plugin-manifest-and-auto-apply
Closed

kzzalews wants to merge 1 commit into
rtk-ai:developfrom
kzzalews:fix/openclaw-plugin-manifest-and-auto-apply

Conversation

@kzzalews

@kzzalews kzzalews commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Fixes #1717

Problem

The OpenClaw plugin was discoverable in plugins list but the runtime never loaded, so before_tool_call did not intercept exec commands. Additionally, exit code 3 (ask) always triggered requireApproval, which blocks exec for up to 120s — after timeout the command is denied, making the plugin unusable in practice.

Root causes

  1. package.json missing openclaw.extensions — OpenClaw cannot determine the entry point without it.
  2. openclaw.plugin.json missing activation.onStartup — since OpenClaw 2026.6.x, omitting this field no longer startup-loads the plugin implicitly.
  3. Exit code 3 always triggered requireApproval — 120s timeout makes this path unusable for automated agent workflows.

Changes

package.json

  • Added "type": "module"
  • Added "openclaw": { "extensions": ["./index.ts"] }

openclaw.plugin.json

  • Added "activation": { "onStartup": true }
  • Added approvalMode to configSchema ("auto" | "ask", default "auto")

index.ts

  • Added approvalMode config field (default "auto")
  • Exit 3 + "auto" mode: rewrite applied silently (no approval prompt)
  • Exit 3 + "ask" mode: existing requireApproval behavior preserved
  • Updated JSDoc to reflect configurable exit-3 handling

Testing

Tested on OpenClaw 2026.6.10 with RTK 0.43.0.

  • plugins inspect rtk-rewrite --runtime shows status: loaded, hookCount: 1
  • before_tool_call hook fires and rewrites git status → rtk git status
  • approvalMode: "auto" (default) — no approval prompts, rewrites apply transparently
  • approvalMode: "ask" — approval card appears with allow-once/deny buttons
  • Deny rules (exit 2) block correctly regardless of approvalMode

Fixes rtk-ai#1717

The OpenClaw plugin was discoverable in `plugins list` but the runtime
never loaded, so before_tool_call did not intercept exec commands.

Three root causes:

1. package.json missing `openclaw.extensions` — OpenClaw cannot
   determine the entry point without it. Added `"type": "module"`
   and the `openclaw.extensions` array pointing at `./index.ts`.

2. openclaw.plugin.json missing `activation.onStartup` — since
   OpenClaw 2026.6.x, omitting this field no longer startup-loads
   the plugin implicitly. Set to `true`.

3. Exit code 3 (ask) always triggered `requireApproval`, which
   blocks exec for up to 120s. After timeout the command is denied,
   making the plugin unusable in practice. Added `approvalMode`
   config field ("auto" | "ask", default "auto") so exit-3
   rewrites apply silently unless the operator opts in to approvals.

Tested on OpenClaw 2026.6.10 with RTK 0.43.0.
@rtk-release-bot

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale due to 90 days of inactivity. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. Your contribution is very much appreciated — we're sorry we haven't been able to review it yet.

@rtk-release-bot rtk-release-bot Bot added the stale label Oct 5, 2026
@rtk-release-bot

Copy link
Copy Markdown
Contributor

Closing this pull request after a prolonged period of inactivity. If this is still relevant, please ask for it to be reopened. Thank you!

@rtk-release-bot rtk-release-bot Bot closed this Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[OpenClaw Plugin] before_tool_call hook not intercepting exec commands

1 participant