Allow cross context messaging #1034
Closed
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.
Context from discord:
Coding Agent conversations:
Claude Code
User: I used to be able to have the agent send a WhatsApp message to any conversation. After last git pull, I now get the error:
Cross-context messaging denied. Verify where this comes from and if there is a configuration parameter to enable it back.Assistant: Found the issue. Commit
ffc465394("fix: enforce message context isolation") added context isolation with no config bypass. The check is insrc/infra/outbound/message-action-runner.ts:152. No config option exists currently. Would you like me to add one? I'd suggesttools.message.allowCrossContextSend.User: I just updated repo, 226 new commits from contributors. Check whether the context isolation enforcement is still in place, and still no configuration for it.
Assistant: Confirmed: Context isolation still enforced, no config option added. Want me to add a config option to bypass it?
User: Yes. Create a new branch, implement the changes, run the tests, and only if all pass, commit.
Assistant: Done. Branch
feat/allow-cross-context-messagingcreated with commit. Config option:tools.message.allowCrossContextSend: true. All tests pass.User: Wait, I have a
clawdbot.json, notclawdbot.yaml.Assistant: Same structure, JSON syntax:
{ "tools": { "message": { "allowCrossContextSend": true } } }User: I just updated my ~/.clawdbot/clawdbot.json, rebuilt the gateway, restarted it, and still get the error.
Assistant: Found it! In
src/gateway/config-reload.ts:70, changes totools.*are ignored (no hot-reload). Fixed by making the cross-context check always read fresh config vialoadConfig(). Updated commit - no rebuild/restart needed now.(At this point, still not working, decided to switch to Codex)
User: Write down everything we've discussed in a concise markdown document ./handoff.md
Assistant: Done. Created
./handoff.md.(Here I switched to Codex)
Codex
User: Read handoff.md. That document comes from Claude Code that tried to fix the cross context messaging issue, to no avail. Investigate and implement a real solution.
Assistant: Root cause:
tools.message.allowCrossContextSendwas missing from config schema so it was stripped; added schema support + UI hint + validation test.User: go ahead and run tests
Assistant:
pnpm test --filterfailed (unsupported). Ranpnpm test -- src/config/config.tools-message.test.ts; suite finished with 1 unrelated failure insession-updates.test.ts(UTC timestamp mismatch). New test passed.User: It's ok, do an atomic commit.
Assistant: Committed only the schema changes + test; reported commit and test status.