Commit Graph

163 Commits

Author SHA1 Message Date
9047d3ad8f Merge pull request 'fix: bypass DM sessions without metadata and make tool globally visible' (#4) from fix/dm-bypass-and-tool-visibility into feat/whispergate-mvp
Reviewed-on: orion/WhisperGate#4
2026-02-27 15:30:11 +00:00
zhi
75f358001b fix(rules): handle multi-byte emoji in getLastChar via Array.from
getLastChar used t[t.length-1] which only gets the trailing surrogate
of emoji like 🔚 (U+1F51A, a surrogate pair in UTF-16). This meant
end symbol matching ALWAYS failed for emoji symbols, causing every
non-humanList message to hit rule_match_no_end_symbol -> no-reply.

Fix: use Array.from(t) to correctly split by Unicode code points.
2026-02-27 15:20:05 +00:00
zhi
3749de981f fix: use configured endSymbols in injected prompt and exempt gateway keywords
- buildEndMarkerInstruction() replaces hardcoded END_MARKER_INSTRUCTION,
  dynamically using the resolved policy's endSymbols
- Instruction now explicitly exempts gateway keywords (NO_REPLY, HEARTBEAT_OK)
  from requiring end symbols
- Export resolvePolicy from rules.ts for reuse in before_prompt_build hook
2026-02-27 15:16:06 +00:00
zhi
75d659787c fix(rules): strip trailing metadata blocks before checking end symbol
getLastChar was checking the last character of the full event.prompt,
which includes Conversation/Sender metadata blocks appended by OpenClaw
after the actual message. This meant end symbols like 🔚 at the end of
the message body were invisible — the last char was always backtick or
whitespace from the metadata JSON block.

Fix: strip trailing '(untrusted metadata)' blocks before extracting
the last character. This only affects non-humanList senders (humanList
senders bypass end symbol check via human_list_sender reason).
2026-02-27 14:37:59 +00:00
zhi
f74b3978e7 fix(installer): resolve plugin path relative to repo instead of hardcoded operator path
PLUGIN_PATH defaulted to /root/.openclaw/workspace-operator/... regardless
of which workspace the installer was run from. Now resolves relative to
the script location (../dist/whispergate).
2026-02-27 14:25:12 +00:00
zhi
f23d9049a7 fix: bypass DM sessions without metadata and make tool globally visible
1. DM bypass: when neither senderId nor channelId can be extracted from
   the prompt (DM sessions lack untrusted conversation info), skip the
   no-reply gate and allow the message through with end-marker injection.

2. Tool visibility: change whispergateway_tools registration from
   optional=true to optional=false so all agents can see the tool
   without needing explicit tools.allow entries.
2026-02-27 14:14:39 +00:00
a4836097e4 fix: add default values for optional config fields
- Add default values for enableDiscordControlTool, enableWhispergatePolicyTool,
  discordControlApiBaseUrl, enableDebugLogs, debugLogChannelIds
- Merge defaults in both baseConfig and getLivePluginConfig
- Fixes issue where whispergateway_tools tool was not exposed due to missing
  config fields in openclaw.json
2026-02-26 22:16:23 +00:00
4622173787 fix: restore model after no-reply executes (needsRestore flag) 2026-02-26 13:39:43 +00:00
211a94233f chore(debug): log parsed sender/channel fields in hook decision recompute 2026-02-26 11:47:23 +00:00
6b3d89634a Merge pull request 'fix: wait for gateway ready before post-install model validation' (#2) from zhi/WhisperGate:feat/whispergate-mvp into feat/whispergate-mvp
Reviewed-on: orion/WhisperGate#2
2026-02-26 11:15:13 +00:00
zhi
f33dc13af4 fix: extract senderId from event.prompt instead of ctx in hooks
Root cause: PluginHookAgentContext in before_model_resolve only has
agentId, sessionKey, sessionId, workspaceDir, messageProvider.
senderId, channelId, input are NOT available in this hook phase.

The plugin was reading ctx.senderId (undefined) -> inHumanList=false
for ALL Discord sessions -> shouldUseNoReply=true -> all silenced.

Fix: use event.prompt which contains the full user message including
the 'Conversation info (untrusted metadata)' JSON block, and extract
sender_id from there. Same fix applied to before_prompt_build.
2026-02-26 08:56:24 +00:00
zhi
fd6c4dd3a2 fix: remove gateway restart from installer, let user restart manually
Root cause: installer called 'openclaw gateway restart' (async via systemd)
then immediately validated model visibility — race condition caused validation
to fail and rollback the correct config.

Fix: remove restart + validation from script entirely. Script only writes config.
User restarts gateway manually after install completes.

Also fix CONFIG.example.json: contextWindow 4096->200000, maxTokens 64->8192
(OpenClaw requires minimum 16000 contextWindow).
2026-02-26 08:47:43 +00:00
15975e3970 fix(installer): raise no-reply model contextWindow/maxTokens to satisfy OpenClaw minimums 2026-02-26 06:30:56 +00:00
8d34bf257b fix(installer): write providers map by object key to avoid quoted provider id and restore providers atomically on uninstall 2026-02-26 06:26:52 +00:00
875cd66d34 feat(installer): restart gateway and validate custom no-reply model visibility after install 2026-02-26 06:14:06 +00:00
1746fb33ad fix(installer): uninstall now selects latest install record instead of latest pointer 2026-02-26 06:04:17 +00:00
8eade446b3 fix(hooks): move first-pass decision to before_model_resolve and keep message_received for debug only 2026-02-26 02:33:15 +00:00
51149dd6a0 feat(debug): add whispergate hook diagnostics with channel-scoped debug logs 2026-02-26 01:58:01 +00:00
46ea43b3fe fix(rules): inject end-marker prompt for every non-no-reply discord turn 2026-02-26 01:47:27 +00:00
ca96779159 refactor(tooling): merge discord_control and whispergate_policy into whispergateway_tools 2026-02-26 01:31:31 +00:00
46e56c6760 refactor(installer): replace bash installer logic with node-only implementation 2026-02-26 00:41:56 +00:00
714168e4bf fix(installer): pass CHANNEL_POLICIES_FILE env when resolving policy path 2026-02-26 00:38:32 +00:00
e5999743fe feat(policy-runtime): in-memory policy state with whispergate_policy tool and atomic persist 2026-02-26 00:35:17 +00:00
682d9a336e feat(policy-file): move channel overrides to standalone channelPoliciesFile with hot reload 2026-02-26 00:28:34 +00:00
d6f908b813 feat(policy): add per-channel channelPolicies with hot-reload list mode/lists 2026-02-26 00:23:47 +00:00
6d463a4572 feat(config): add hot-reload config + listMode (human-list/agent-list) 2026-02-26 00:18:05 +00:00
0f526346f4 feat(tool): register optional discord_control tool in whispergate plugin and align defaults 2026-02-25 23:37:15 +00:00
7f1d6bb3f7 fix(plugin-path): align packaged dir with plugin id to remove mismatch warning 2026-02-25 23:27:16 +00:00
f5ec6f9b15 chore(installer): change default no-reply provider/model ids 2026-02-25 23:21:42 +00:00
c119697f7f fix(installer): make uninstall atomic for plugins and pass rollback test 2026-02-25 23:19:58 +00:00
6ff9858b18 fix(installer): atomic plugins write and valid json defaults for install flags 2026-02-25 23:18:07 +00:00
9d752ca090 feat(installer): add --install/--uninstall with recorded full rollback 2026-02-25 23:08:02 +00:00
2f269c25b4 feat(installer): add openclaw config-set installer with automatic rollback 2026-02-25 23:04:14 +00:00
c912ceed79 docs(test): add phase test report with pending e2e checklist 2026-02-25 22:19:29 +00:00
882f62eae7 Merge pull request 'WhisperGate MVP: no-reply API + plugin rule gate' (#1) from feat/whispergate-mvp into main
Reviewed-on: orion/WhisperGate#1
2026-02-25 22:07:07 +00:00
a2f88cfe0f chore(security): add guardrails and PR merge summary docs 2026-02-25 22:05:22 +00:00
8097ab7484 docs(discord-control): add runnable examples and smoke script 2026-02-25 22:02:00 +00:00
f20728b02d feat(discord-control): add channel-private-update and member-list field projection 2026-02-25 21:59:51 +00:00
4bec5982a5 feat(discord-control): align auth with token/allowlist/action-gate and add dryRun 2026-02-25 21:57:39 +00:00
867285309b feat(discord-control): add private-channel and member-list admin API 2026-02-25 16:09:14 +00:00
0c6d8bb2c5 feat(release): add plugin packaging script and release notes 2026-02-25 14:09:14 +00:00
6792249a0b docs: add no-docker-first run modes and quick start 2026-02-25 14:08:15 +00:00
0a224983fd docs: add changelog and expose test-api command in readme 2026-02-25 13:47:19 +00:00
1acaebf73f feat(dev): add no-touch OpenClaw config renderer and integration guide 2026-02-25 13:47:00 +00:00
b99ec7c281 test(api): add isolated no-reply API integration test script 2026-02-25 13:45:57 +00:00
16fdb6600a chore(dev): add Makefile shortcuts for check/smoke lifecycle 2026-02-25 12:54:05 +00:00
d2fc8c89dd test: add rule-case validator for no-reply and 🔚 injection paths 2026-02-25 12:53:45 +00:00
32405fa3e2 feat(plugin): inject 🔚 ending instruction for bypass/end-symbol discord turns 2026-02-25 11:04:01 +00:00
798c402ab0 docs: update progress tracker and repository map 2026-02-25 10:45:45 +00:00
2379d0f521 docs: add staged rollout and rollback checklist 2026-02-25 10:45:18 +00:00