Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tobalsan
Copy link
Contributor

Context from discord:

9:08 PM]tinscape: @peter Steinberger any reason to have disabled cross context posting (e.g. instructing clawdbot to send a message to another group in WhatsApp)? I liked the fact that it was possible
9:08 PM]Peter Steinberger: it should be. but idk out of hand. pleaes dig in


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 in src/infra/outbound/message-action-runner.ts:152. No config option exists currently. Would you like me to add one? I'd suggest tools.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-messaging created with commit. Config option: tools.message.allowCrossContextSend: true. All tests pass.

User: Wait, I have a clawdbot.json, not clawdbot.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 to tools.* are ignored (no hot-reload). Fixed by making the cross-context check always read fresh config via loadConfig(). 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.allowCrossContextSend was missing from config schema so it was stripped; added schema support + UI hint + validation test.

User: go ahead and run tests

Assistant: pnpm test --filter failed (unsupported). Ran pnpm test -- src/config/config.tools-message.test.ts; suite finished with 1 unrelated failure in session-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.

@steipete
Copy link
Contributor

steipete commented Jan 17, 2026

Findings

  • Major: config source split; allowCrossContextSend reads from loadConfig()
    while rest of message action uses passed cfg, so in-memory config (tests,
    overrides, future reload fixes) won’t control this flag and behavior
    depends on file reads each message. Consider moving the reload fix to
    config reload or plumb the fresh value into cfg instead of disk reads.
    src/infra/outbound/message-action-runner.ts:146
  • Minor: docs/UI config surface updated via labels/help, but no docs entry
    for the new key; users won’t discover it in docs. src/config/
    schema.ts:105 / src/config/schema.ts:250
  • Minor: test doesn’t lock in the intended source of truth; because cfg
    includes allowCrossContextSend, the test still passes even if the
    loadConfig() usage is removed later. If the intent is to require live
    config reads, set cfg without the flag and only loadConfig() returning it.
    src/infra/outbound/message-action-runner.test.ts:177

Questions / assumptions

  • Do we want allowCrossContextSend hot-reloadable without disk reads per
    message? If yes, should the reload pipeline include tools.* instead of
    bypassing with loadConfig()?

typical slopus... doesn't read half the codebase, makes silly mistakes. use codex!

@steipete
Copy link
Contributor

Love this... extending it!

steipete added a commit that referenced this pull request Jan 17, 2026
@steipete
Copy link
Contributor

Merged via direct commits on main (not a squash). Changes landed in:

  • 1e8f8ac6f
  • 902f8cdb7
  • 8ebfa29
  • 3a7274d36
  • c0709fb33
    Thanks @tobalsan! Credited in CHANGELOG.md.

@steipete
Copy link
Contributor

Closing: changes already merged on main via commits noted above. Thanks again!

@steipete steipete closed this Jan 17, 2026
@steipete
Copy link
Contributor

Thanks for the PR! We incorporated the work via a clean refactor in main: 331141a (centralized target resolution + plugin hints + broadcast display cleanup). Closing out here.

TSavo pushed a commit to TSavo/clawdbot that referenced this pull request Jan 18, 2026
rsneh pushed a commit to rsneh/clawdbot that referenced this pull request Jan 21, 2026
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