Skip to content

fix(openclaw-bridge): seed "hook:" prefix + require explicit delivery prompt (alpha.2)#11

Open
daibor wants to merge 4 commits intomainfrom
fix/openclaw-bridge-hook-prefix-and-delivery-ux
Open

fix(openclaw-bridge): seed "hook:" prefix + require explicit delivery prompt (alpha.2)#11
daibor wants to merge 4 commits intomainfrom
fix/openclaw-bridge-hook-prefix-and-delivery-ux

Conversation

@daibor
Copy link
Copy Markdown
Collaborator

@daibor daibor commented May 2, 2026

Summary

Two production bugs surfaced when a Windows tester ran the openclaw-bridge SKILL on a fresh OpenClaw install. Both are independent of platform but the clean-environment + no-prior-OpenClaw combo made them visible:

  • Gateway refused to start with hooks.allowedSessionKeyPrefixes must include 'hook:' when hooks.defaultSessionKey is unset. Our ensure_openclaw_hooks only seeded "w2a:" into the allowlist; on a clean machine that left ["w2a:"] and tripped OpenClaw's startup validator. Hosts with prior OpenClaw setup masked the bug because they already had ["hook:"] from OpenClaw's own default.
  • Sensors installed silently as dashboard-only. With no ~/.openclaw/.env containing <PLATFORM>_HOME_CHANNEL, install-sensor.sh fell back to dashboard-only and emitted the same success JSON as a fully-wired push sensor. The SKILL explicitly told the agent "don't ask the user about delivery unless they raise it" — combined with the silent fallback, users got "Installed!" and never learned no IM target was configured.

Changes

fix(openclaw-bridge): seed "hook:" alongside "w2a:" in allowedSessionKeyPrefixes

  • _lib.sh: jq merge now seeds both hook: and w2a: idempotently; new has_hook probe makes legacy victims (["w2a:"] only) self-heal on the next bootstrap run
  • bootstrap.sh: manual fallback hint updated
  • README.md: quick-start example updated

Verified across five inputs (empty, legacy ["w2a:"], default ["hook:"], already-healed, user-extended ["hook:", "hook:gmail:"]) — idempotent and preserves user-supplied prefixes.

fix(openclaw-bridge): require explicit delivery prompt at install, surface mode in script output

  • install-sensor.sh: success JSON now includes delivery: {mode, channel, to} so the agent has ground truth on what was wired up
  • SKILL.md Step 3: agent MUST ask three questions in the user's language (push vs dashboard / which platform / target ID) before installing. .env auto-fill stays as a power-user shortcut but the SKILL no longer reads or recommends it
  • SKILL.md Step 6: branch on delivery.mode — push mode tells where replies go; dashboard-only mode explicitly warns the user no IM target is configured

chore(openclaw-bridge): bump to 0.1.0-alpha.2

Post-merge release notes (action required)

When publishing 0.1.0-alpha.2 to npm, also move the latest dist-tag:

npm publish --tag alpha
npm dist-tag add @world2agent/openclaw-sensor-bridge@0.1.0-alpha.2 latest

Currently latest still points to 0.1.0-alpha.0, which is why fresh npm install -g @world2agent/openclaw-sensor-bridge (no tag) pulls the old world2agent-sensor-runner binary that doesn't match the post-rename SKILL scripts.

Test plan

  • CI passes (`pnpm run build`, e2e)
  • On a clean Windows machine: bootstrap completes, gateway starts cleanly, install-sensor prompts for delivery, dashboard-only path warns user explicitly
  • On a host with `~/.openclaw/.env` containing `FEISHU_HOME_CHANNEL=...`: SKILL still asks (per new contract), but if user confirms push the auto-fill kicks in correctly
  • Legacy victim (config has `["w2a:"]` from prior alpha.1 bootstrap): re-running bootstrap heals to `["hook:", "w2a:"]` with backup file written

🤖 Generated with Claude Code

daibo@machinepulse.ai and others added 4 commits May 3, 2026 00:32
…KeyPrefixes

OpenClaw's gateway refuses to start with `hooks.allowedSessionKeyPrefixes
must include 'hook:' when hooks.defaultSessionKey is unset` whenever the
config doesn't list `hook:` as an allowed prefix and `defaultSessionKey`
is also blank — `hook:` is OpenClaw's own default sessionKey namespace.

The previous `ensure_openclaw_hooks` only merged `"w2a:"` into the
allowlist, so on a clean machine where the array starts empty the result
was `["w2a:"]` and the gateway refused to come up. Hosts that already had
OpenClaw running picked up the implicit `["hook:"]` default and silently
stayed healthy, masking the bug.

- merge both "hook:" and "w2a:" idempotently in _lib.sh's jq rewrite
- add has_hook probe so legacy victims (allowlist already pruned to
  ["w2a:"]) self-heal on the next bootstrap run
- update bootstrap.sh's manual fallback hint and README quick-start to
  show ["hook:", "w2a:"]

Verified across five inputs: empty config, legacy ["w2a:"], default
["hook:"], already-healed, and user-extended ["hook:", "hook:gmail:"]
— jq stays idempotent and preserves user-supplied prefixes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…rface mode in script output

Sensors installed without a notify target silently fell back to
dashboard-only — install-sensor.sh's stdout looked identical to a
fully-wired push sensor, so the agent reported "installed!" and the user
never realized signals weren't being pushed anywhere. The default flow
relied on `~/.openclaw/.env` containing `<PLATFORM>_HOME_CHANNEL=<handle>`,
but that file rarely exists on a fresh OpenClaw install and the SKILL
explicitly told the agent "don't ask the user about delivery unless they
raise it" — combined, that produced a silent-failure UX.

- install-sensor.sh: emit `delivery: {mode, channel, to}` in the success
  JSON so the agent has ground truth on what was wired up
- SKILL.md Step 3: drop the "don't ask" guidance; agent MUST ask three
  short questions (push vs dashboard / which platform / target ID) in the
  user's conversation language before installing. The .env auto-fill
  stays as a power-user shortcut but the SKILL no longer reads or
  recommends it.
- SKILL.md Step 6: branch report on `delivery.mode` — push mode says
  where replies go; dashboard-only mode explicitly warns the user that
  no IM target is configured and tells them how to enable push later.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The SKILL.md "Conversation language" section already directs the agent
to translate Q&A into the user's language at runtime. Embedding Chinese
example questions in the SKILL itself (added in 5289781) contradicts
that contract — it suggests the examples are literal scripts to recite
rather than templates the agent translates per user.

Switch the three delivery prompts back to English; the agent will
translate them on the fly per the existing language directive.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@Nova-machinepulse Nova-machinepulse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved by Nova-machinepulse via Lark

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.

2 participants