Skip to content

feat: OpenClaw 2026.6.11 compatibility — typed SDK, hook migration, hard blocking#6

Merged
sidmohan0 merged 2 commits into
mainfrom
feat/openclaw-2026.6-compat
Jul 2, 2026
Merged

feat: OpenClaw 2026.6.11 compatibility — typed SDK, hook migration, hard blocking#6
sidmohan0 merged 2 commits into
mainfrom
feat/openclaw-2026.6-compat

Conversation

@sidmohan0

Copy link
Copy Markdown
Contributor

Summary

Makes FogClaw verifiably work against current OpenClaw (v2026.6.11), building on #5.

Compile against the real contract. openclaw 2026.6.11 is now a devDependency and the plugin typechecks against the actual SDK: definePluginEntry entry point, OpenClawPluginApi, TypeBox tool schemas (typebox pinned to OpenClaw's vendored 1.1.39), required label on tools, details on results. register(api: any) is gone — future API drift now fails tsc, not production.

Hook migration (verified against the SDK's PluginHookHandlerMap):

  • before_agent_start (deprecated upstream) → before_prompt_build
  • before_agent_run gate when block actions are configured — block mode now actually stops the run instead of only injecting a prompt instruction. Requires hooks.allowConversationAccess: true; degrades to the prompt-level instruction otherwise.
  • reply_payload_sending added — media captions and normalized payload text bypass message_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, format openclaw, v0.4.0
  • openclaw plugins info fogclaw: loaded, "Legacy before_agent_start: no"
  • openclaw doctor: [fogclaw] Plugin registered — guardrail: redact... — register() executed, all hooks attached, no errors

Test plan

  • 230 unit tests pass (8 new: block gate, reply payload, tool-result allowlist regressions written red-first)
  • tsc --noEmit clean against real SDK types
  • Plugin loads + registers in live openclaw 2026.6.11 (isolated profile)
  • Full agent-turn E2E with a real provider (gateway run) before publishing 0.4.0

sidmohan0 added 2 commits July 2, 2026 16:05
…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.
@sidmohan0 sidmohan0 merged commit 1faca4b into main Jul 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant