fix(auto-reply): log suppressed message-tool-only finals#82609
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. by source inspection and the current dispatch test path: group/channel turns default to Real behavior proof Next step before merge Security Review detailsBest 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 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:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 6a65ea8c3ac1. Re-review progress:
|
There was a problem hiding this comment.
💡 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, |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
💡 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".
| 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 |
There was a problem hiding this comment.
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 👍 / 👎.
0398170 to
222c110
Compare
There was a problem hiding this comment.
💡 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".
| 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. |
There was a problem hiding this comment.
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 👍 / 👎.
222c110 to
8803571
Compare
Summary:
message_toolvisible-reply mode strict: assistant final text stays private unless the agent callsmessage(action=send)Verification:
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.