Skip to content

fix(delivery): prevent agent sessions from becoming message targets - #115657

Merged
steipete merged 1 commit into
mainfrom
codex/s28-reject-internal-message-target
Jul 29, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/s28-reject-internal-message-target

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #114159

What Problem This Solves

Fixes an issue where users relying on Discord or another messaging channel for subagent, cron, or autonomous replies could see messages dead-lettered or delivered to an internal session identity instead of their actual channel. A session-shaped current channel could also hide a valid current conversation target.

Why This Change Was Made

Infer outbound destinations only from actual conversation targets. Reuse the canonical agent-session parser at both message-action normalization and the pre-discovery target gate, skip bare and channel-wrapped internal sessions, keep searching for a real current messaging target, and leave every explicitly supplied destination unchanged. This is a provider-neutral core fix; it changes no channel plugin, configuration, authentication, schema, or Discord target grammar.

User Impact

Subagent, cron, and autonomous messages use the real current conversation when available. When no channel destination exists, message sending fails immediately with the existing actionable target-required error instead of discovering a plugin, making a provider request, or producing a dead-letter.

Evidence

  • Current-main negative control: Testbox run 30425768538 reproduces all 9 original regressions, including a real registered outbound adapter accepting the channel-wrapped session key.
  • Exact rebased head faf0ded0d561890f404d5cbd7a713a0627c86823: 495/495 remote tests passed on Blacksmith Testbox tbx_01kyp78n6px5kse5n2fbe82ew7: canonical normalization, real registered outbound send/no-send, agent message tool, gateway send RPC, and actual Discord REST send, outbound adapter, target parser, and channel-action contract suites.
  • Exact head: remote pnpm check:changed passed, including core and core-test tsgo, changed-file formatting, lint, SDK and plugin boundaries, dependency guards, dead exports, runtime cycles, and state-schema guards.
  • Exact head: structured Codex gpt-5.6-sol autoreview at xhigh completed clean with no accepted/actionable findings.
  • AI-assisted and human-reviewed; reporter credit: @coveredbygreco-hub.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Jul 29, 2026
@steipete
steipete merged commit 665b312 into main Jul 29, 2026
129 of 133 checks passed
@steipete
steipete deleted the codex/s28-reject-internal-message-target branch July 29, 2026 06:26
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 29, 2026
vincentkoc added a commit that referenced this pull request Jul 29, 2026
…ifecycle-hooks

* origin/main:
  fix(mattermost): key private channels as group on outbound routing (#96645)
  fix(ci): grant Telegram QA runtime scratch access (#115659)
  fix(telegram): stop retrying blocked recipients (#115640)
  fix(tts): persist generated speech in media store (#115647)
  fix(gateway): preserve complete streamed chat completions (#115652)
  fix(mac): prevent app auth from blocking node-host startup (#115533)
  fix(heartbeat): keep message-tool final replies private (#115629)
  fix(gateway): drain root work continuations before direct-stop process exit (#105848)
  fix(ollama): keep active streams within their idle timeout (#115648)
  fix(delivery): keep session keys out of inferred message targets (#115657)
  fix(ci): type code mode matrix catch callback (#115674)
  refactor(agents): centralize bundled CLI backend auth policy (#115633)
  refactor: remove 3,527 lines of runtime and test duplication (#115626)
  [AI] fix(doctor): stop repeated bundledDiscovery migration noise on beta (#115208)

# Conflicts:
#	scripts/code-mode-model-matrix.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Discord: omitted target on message tool falls back to internal session key (toolContext.currentChannelId) → Invalid Form Body dead-letters

1 participant