Skip to content

fix(auto-reply): log suppressed message-tool-only finals#82609

Merged
steipete merged 4 commits into
mainfrom
fix/group-channel-final-fallback
May 16, 2026
Merged

fix(auto-reply): log suppressed message-tool-only finals#82609
steipete merged 4 commits into
mainfrom
fix/group-channel-final-fallback

Conversation

@steipete

@steipete steipete commented May 16, 2026

Copy link
Copy Markdown
Contributor

Summary:

  • keep group/channel message_tool visible-reply mode strict: assistant final text stays private unless the agent calls message(action=send)
  • add gateway verbose logging when a suppressed final payload had outbound content, including routing context and capped payload metadata for diagnosis
  • update prompt/tool guidance, config help, docs, troubleshooting, and changelog to stop advertising a final-text fallback

Verification:

  • node scripts/run-vitest.mjs src/auto-reply/reply/dispatch-from-config.test.ts src/auto-reply/reply/source-reply-delivery-mode.test.ts src/agents/system-prompt.test.ts src/agents/tools/message-tool.test.ts
  • pnpm check:docs
  • git diff --check
  • /Users/steipete/Projects/agent-scripts/skills/codex-review/scripts/codex-review --mode local

Behavior addressed:
Group/channel turns configured for message-tool visible replies now stay private when the model forgets to call the message tool, while operators get a gateway-log signal explaining that a final payload was suppressed.

Real environment tested:
Local source checkout.

Exact steps or command run after this patch:
node scripts/run-vitest.mjs src/auto-reply/reply/dispatch-from-config.test.ts src/auto-reply/reply/source-reply-delivery-mode.test.ts src/agents/system-prompt.test.ts src/agents/tools/message-tool.test.ts
pnpm check:docs
git diff --check
/Users/steipete/Projects/agent-scripts/skills/codex-review/scripts/codex-review --mode local

Evidence after fix:
Dispatch regression tests prove message-tool-only group/channel finals are not queued to normal source delivery, room_event finals stay private, and explicitly deliverable source-reply payloads still send. Docs and prompts now say normal final text stays private in message-tool-only mode.

Observed result after fix:
Focused tests pass, docs checks pass, whitespace check passes, and Codex review reported no accepted/actionable findings.

What was not tested:
Live Discord/Slack/Telegram delivery was not exercised in this PR.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: discord Channel integration: discord channel: slack Channel integration: slack gateway Gateway runtime agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels May 16, 2026
@clawsweeper

clawsweeper Bot commented May 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

Summary
The PR changes group/channel message_tool delivery so substantive non-ambient final replies can be posted as a fallback, and updates prompts, config help, docs, tests, and the changelog.

Reproducibility: yes. by source inspection and the current dispatch test path: group/channel turns default to message_tool_only, ordinary final replies are suppressed unless marked with suppression-bypass metadata, and the current test asserts no final reply is queued. I did not run tests because this review checkout is read-only.

Real behavior proof
Needs real behavior proof before merge: The PR body supplies focused tests/docs checks and explicitly says live Discord/Slack/Telegram delivery was not exercised, so it needs redacted terminal/live output, logs, a linked artifact, or a short recording before merge; after updating the PR body, a fresh ClawSweeper review should run automatically, or a maintainer can comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, ask a maintainer to comment @clawsweeper re-review.

Next step before merge
No repair job: this protected maintainer-labeled PR has no concrete code finding for automation, and the remaining blockers are human product review plus contributor real-behavior proof.

Security
Cleared: The diff changes dispatch policy, prompt/docs text, tests, and changelog only; it does not add dependencies, scripts, CI permissions, secret handling, or external code execution paths.

Review details

Best possible solution:

Settle the message-tool group/channel fallback contract, then land one implementation that guards ambient turns, send-policy denials, errors, duplicate delivery, docs/config help, and real channel or runtime proof.

Do we have a high-confidence way to reproduce the issue?

Yes, by source inspection and the current dispatch test path: group/channel turns default to message_tool_only, ordinary final replies are suppressed unless marked with suppression-bypass metadata, and the current test asserts no final reply is queued. I did not run tests because this review checkout is read-only.

Is this the best way to solve the issue?

Unclear pending maintainer decision. The patch is narrow and preserves several important guards, but it changes documented default behavior and should be reconciled with the broader guarded/audited approach in #80949 plus real behavior proof.

What I checked:

Likely related people:

  • @vincentkoc: Current blame for both the group/channel visible-reply selection and final suppression-bypass gate points to a recent commit by Vincent Koc; local history is compact, so this is a routing signal rather than sole authorship proof. (role: recent current-main area contributor; confidence: medium; commits: 97e86fb2da58; files: src/auto-reply/reply/dispatch-from-config.ts, src/agents/system-prompt.ts, src/agents/tools/message-tool.ts)
  • @steipete: The path-limited history for the touched dispatch/tests/docs surfaces shows repeated recent adjacent work by Peter Steinberger, including message hook, typing lifecycle, release, and docs/config baseline work; this is independent of authorship of this PR. (role: adjacent delivery/docs contributor; confidence: medium; commits: 29dde80c3e1a, f07bb8e8fc1c, 37a138c554c3; files: src/auto-reply/reply/dispatch-from-config.ts, docs/channels/groups.md, docs/gateway/config-channels.md)
  • Onur Solmaz: Recent path-limited history includes ACP dispatch delivery/settings refactors on nearby delivery infrastructure, making Onur a possible reviewer for dispatch-boundary interactions if maintainers want another routing candidate. (role: adjacent ACP dispatch contributor; confidence: low; commits: 752398a6babd; files: src/auto-reply/reply/dispatch-from-config.ts, src/auto-reply/reply/dispatch-acp.ts)

Remaining risk / open question:

  • The PR body lists focused unit/docs checks but no live Discord, Slack, Telegram, or terminal runtime proof showing after-fix delivery behavior.
  • The narrower fallback overlaps the broader open recovery/audit proposal at Clarify, warn, and recover message-tool-only finals #80949, so maintainers need to choose the intended product contract.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 6a65ea8c3ac1.

Re-review progress:

@clawsweeper clawsweeper Bot added the mantis: telegram-visible-proof Mantis should capture Telegram visible proof. label May 16, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8fbde5d48b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

`error=${reply.isError === true}`,
`beforeAgentRunBlocked=${metadata?.beforeAgentRunBlocked === true}`,
`deliverDespiteSuppression=${metadata?.deliverDespiteSourceReplySuppression === true}`,
textPreview ? `textPreview=${JSON.stringify(textPreview)}` : undefined,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Remove suppressed-reply text preview from verbose logs

This adds textPreview for suppressed finals, so when source delivery is intentionally blocked (for example message_tool_only suppression, ambient room_event, or send-policy deny), the first 160 characters of the assistant reply are still written to verbose logs. In environments where verbose logs are collected, this leaks content that was explicitly meant to stay undisclosed on the delivery path, including sensitive/error text; logging should keep structural diagnostics only (counts/flags) or redact content.

Useful? React with 👍 / 👎.

@steipete steipete changed the title fix(auto-reply): fallback group finals when message tool is missed fix(auto-reply): log suppressed message-tool-only finals May 16, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0398170a63

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/gateway/configuration-examples.md Outdated
visibleReplies: "automatic",
groupChat: {
visibleReplies: "message_tool", // default; use "automatic" for legacy room replies
visibleReplies: "message_tool", // default; falls back to final text for normal requests

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Correct message_tool fallback description in config examples

This comment says group/channel "message_tool" mode “falls back to final text for normal requests,” but the runtime path in this commit does the opposite: suppressed finals are dropped unless metadata explicitly marks delivery (deliverDespiteSourceReplySuppression), and the updated test now asserts no final is sent when the tool is missed. That mismatch will cause operators to expect visible room replies that never appear and misdiagnose channel delivery. Please align the example text with the actual behavior (private by default when the message tool is missed).

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot removed the mantis: telegram-visible-proof Mantis should capture Telegram visible proof. label May 16, 2026
@steipete
steipete force-pushed the fix/group-channel-final-fallback branch from 0398170 to 222c110 Compare May 16, 2026 15:18
@steipete steipete added the proof: override Maintainer override for the external PR real behavior proof gate. label May 16, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 222c110d56

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/channels/discord.md
By default, your agent only responds in guild channels when @mentioned. For a private server, you probably want it to respond to every message.

In guild channels, normal assistant final replies stay private by default. Visible Discord output must be sent explicitly with the `message` tool, so the agent can lurk by default and only post when it decides a channel reply is useful.
In guild channels, visible Discord output should use the `message` tool by default, so the agent can lurk and only post when it decides a channel reply is useful. For normal requests, OpenClaw falls back to the assistant's final text when the model misses the tool; ambient room events stay quiet unless the tool sends.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Correct Discord fallback claim for message-tool-only mode

This sentence says normal guild requests fall back to posting the assistant final text when the model misses message(action=send), but runtime behavior in this commit suppresses those finals in message_tool_only mode unless payload metadata explicitly opts into delivery. That mismatch can send operators down the wrong troubleshooting path (they will expect a visible fallback that never occurs), especially when diagnosing “typing but no message” incidents in Discord channels.

Useful? React with 👍 / 👎.

@steipete
steipete force-pushed the fix/group-channel-final-fallback branch from 222c110 to 8803571 Compare May 16, 2026 15:25
@steipete
steipete merged commit 5759364 into main May 16, 2026
114 checks passed
@steipete
steipete deleted the fix/group-channel-final-fallback branch May 16, 2026 15:30
@steipete

Copy link
Copy Markdown
Contributor Author

Landed via squash onto main.

  • Gate: focused dispatch/source/system/message-tool tests; pnpm check:docs; git diff --check; GitHub required checks green with proof override for this maintainer logging/docs/test PR
  • Land commit: 8803571
  • Merge commit: 5759364

galiniliev pushed a commit to galiniliev/openclaw that referenced this pull request May 20, 2026
)

* fix(auto-reply): fallback group finals when message tool is missed

* fix(auto-reply): log suppressed message-tool finals

* docs(auto-reply): clarify message-tool finals stay private

# Conflicts:
#	CHANGELOG.md

* docs(auto-reply): fix group visible reply examples
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
)

* fix(auto-reply): fallback group finals when message tool is missed

* fix(auto-reply): log suppressed message-tool finals

* docs(auto-reply): clarify message-tool finals stay private

# Conflicts:
#	CHANGELOG.md

* docs(auto-reply): fix group visible reply examples
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
)

* fix(auto-reply): fallback group finals when message tool is missed

* fix(auto-reply): log suppressed message-tool finals

* docs(auto-reply): clarify message-tool finals stay private

# Conflicts:
#	CHANGELOG.md

* docs(auto-reply): fix group visible reply examples
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
)

* fix(auto-reply): fallback group finals when message tool is missed

* fix(auto-reply): log suppressed message-tool finals

* docs(auto-reply): clarify message-tool finals stay private

# Conflicts:
#	CHANGELOG.md

* docs(auto-reply): fix group visible reply examples
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
)

* fix(auto-reply): fallback group finals when message tool is missed

* fix(auto-reply): log suppressed message-tool finals

* docs(auto-reply): clarify message-tool finals stay private

# Conflicts:
#	CHANGELOG.md

* docs(auto-reply): fix group visible reply examples
galiniliev pushed a commit to galiniliev/openclaw that referenced this pull request May 25, 2026
)

* fix(auto-reply): fallback group finals when message tool is missed

* fix(auto-reply): log suppressed message-tool finals

* docs(auto-reply): clarify message-tool finals stay private

# Conflicts:
#	CHANGELOG.md

* docs(auto-reply): fix group visible reply examples
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
)

* fix(auto-reply): fallback group finals when message tool is missed

* fix(auto-reply): log suppressed message-tool finals

* docs(auto-reply): clarify message-tool finals stay private

# Conflicts:
#	CHANGELOG.md

* docs(auto-reply): fix group visible reply examples
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
)

* fix(auto-reply): fallback group finals when message tool is missed

* fix(auto-reply): log suppressed message-tool finals

* docs(auto-reply): clarify message-tool finals stay private

# Conflicts:
#	CHANGELOG.md

* docs(auto-reply): fix group visible reply examples
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
)

* fix(auto-reply): fallback group finals when message tool is missed

* fix(auto-reply): log suppressed message-tool finals

* docs(auto-reply): clarify message-tool finals stay private

# Conflicts:
#	CHANGELOG.md

* docs(auto-reply): fix group visible reply examples
qiaokuan1992 pushed a commit to qiaokuan1992/openclaw that referenced this pull request Jun 2, 2026
)

* fix(auto-reply): fallback group finals when message tool is missed

* fix(auto-reply): log suppressed message-tool finals

* docs(auto-reply): clarify message-tool finals stay private

# Conflicts:
#	CHANGELOG.md

* docs(auto-reply): fix group visible reply examples
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
)

* fix(auto-reply): fallback group finals when message tool is missed

* fix(auto-reply): log suppressed message-tool finals

* docs(auto-reply): clarify message-tool finals stay private

# Conflicts:
#	CHANGELOG.md

* docs(auto-reply): fix group visible reply examples
SYU8384 pushed a commit to SYU8384/openclaw that referenced this pull request Jun 3, 2026
)

* fix(auto-reply): fallback group finals when message tool is missed

* fix(auto-reply): log suppressed message-tool finals

* docs(auto-reply): clarify message-tool finals stay private

# Conflicts:
#	CHANGELOG.md

* docs(auto-reply): fix group visible reply examples
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
)

* fix(auto-reply): fallback group finals when message tool is missed

* fix(auto-reply): log suppressed message-tool finals

* docs(auto-reply): clarify message-tool finals stay private

# Conflicts:
#	CHANGELOG.md

* docs(auto-reply): fix group visible reply examples
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: discord Channel integration: discord channel: slack Channel integration: slack docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR proof: override Maintainer override for the external PR real behavior proof gate. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant