feat: OpenClaw 2026.6.11 compatibility — typed SDK, hook migration, hard blocking#6
Merged
Merged
Conversation
…king gaps Compile against the real plugin SDK (openclaw 2026.6.11 devDependency) instead of api: any — definePluginEntry typed entry, TypeBox tool schemas (required label field, details on results, params validated by the runtime before execute). Hook changes verified against the SDK's PluginHookHandlerMap: - before_agent_start (deprecated upstream) -> before_prompt_build - before_agent_run gate registered when block actions are configured: actually stops the run instead of only injecting a block instruction. Requires hooks.allowConversationAccess; falls back to the prompt-level instruction when unavailable. - reply_payload_sending added: media captions and normalized payload text do not always flow through message_sending. Extract shared allowlist matcher (src/allowlist.ts): tool-result-handler had a duplicate of the pre-4.7.0 allowlist logic, so the partial-match suppression hole fixed in the Scanner was still live on the tool-result path. Both paths now share fullmatch anchoring and the 512-char fail-safe subject cap, with red-first regression tests.
This was referenced Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes FogClaw verifiably work against current OpenClaw (v2026.6.11), building on #5.
Compile against the real contract.
openclaw2026.6.11 is now a devDependency and the plugin typechecks against the actual SDK:definePluginEntryentry point,OpenClawPluginApi, TypeBox tool schemas (typeboxpinned to OpenClaw's vendored 1.1.39), requiredlabelon tools,detailson results.register(api: any)is gone — future API drift now failstsc, not production.Hook migration (verified against the SDK's
PluginHookHandlerMap):before_agent_start(deprecated upstream) →before_prompt_buildbefore_agent_rungate when block actions are configured — block mode now actually stops the run instead of only injecting a prompt instruction. Requireshooks.allowConversationAccess: true; degrades to the prompt-level instruction otherwise.reply_payload_sendingadded — media captions and normalized payload text bypassmessage_sending.Security: shared allowlist matcher. The tool-result handler carried a duplicate of the pre-#5 allowlist logic, so the partial-match suppression hole fixed in #5 was still live on the tool-result path. Extracted
src/allowlist.ts; both paths now share fullmatch anchoring and the 512-char fail-safe caps. Note: prefix patterns like^internal-must become^internal-.*(documented in CHANGELOG).Live verification (isolated
--profile fogclaw-smoke, real 2026.6.11 runtime):openclaw plugins list: FogClaw enabled, formatopenclaw, v0.4.0openclaw plugins info fogclaw: loaded, "Legacy before_agent_start: no"openclaw doctor:[fogclaw] Plugin registered — guardrail: redact...— register() executed, all hooks attached, no errorsTest plan
tsc --noEmitclean against real SDK types