Skip to content

Clarify visible replies for message-tool-only chats#80050

Closed
anyech wants to merge 4 commits into
openclaw:mainfrom
anyech:fix/discord-message-tool-only-context
Closed

Clarify visible replies for message-tool-only chats#80050
anyech wants to merge 4 commits into
openclaw:mainfrom
anyech:fix/discord-message-tool-only-context

Conversation

@anyech

@anyech anyech commented May 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Clarifies the prompt context for message_tool_only group/direct conversations so agents do not put user-facing answers only in private final text when a visible update is expected.

This is a prompt-only clarification; it does not change reply-delivery runtime behavior.

This keeps the existing privacy boundary intact:

  • normal final replies remain private in message_tool_only contexts
  • visible output still goes through message(action=send)
  • the change only strengthens the instruction for directly addressed/status/completion cases where a visible response is expected

Tests

  • corepack pnpm format -- src/auto-reply/reply/groups.ts src/auto-reply/reply/groups.test.ts
  • corepack pnpm vitest run src/auto-reply/reply/groups.test.ts

Real behavior proof

  • Behavior or issue addressed: In a real Discord message_tool_only thread, user-facing status/result answers could be written only as private final text, so the channel showed progress/tool output but no visible answer. This PR clarifies that directly addressed status/completion answers must use message(action=send) and must not be left only in normal final text.
  • Real environment tested: Real OpenClaw 2026.5.7 installation using Discord message_tool_only thread routing. Channel, session, user, host, and file-path identifiers are redacted.
  • Exact steps or command run after this patch:
    1. Reproduced the symptom before the complete prompt-surface patch: the session transcript contained normal final_answer payloads that were not visible in Discord, while a manual message.send recovery was visible immediately.
    2. Applied the same source-level guidance to the real installed prompt/tool bundles covering the native agent prompt, ACP dispatch prompt, and message tool description surfaces.
    3. Ran the after-fix installed-runtime validation command before restart and checked connectivity after restart.
  • Evidence after fix:
FINAL_VISIBILITY_COMPLETE_HOTFIX_OK
system_prompt_bundle=patched
acp_dispatch_bundle=patched
message_tool_bundle=patched
phase=success
maintenance_rc=0
validation_rc=0
gateway_start_rc=0
connectivity_probe=ok
  • Observed result after fix: The real installed runtime contained the strengthened message_tool_only guidance in the native agent prompt, ACP dispatch prompt, and message tool description surfaces; validation returned FINAL_VISIBILITY_COMPLETE_HOTFIX_OK, and connectivity was OK after restart. The pre-fix failure was narrowed to private normal final text versus visible message(action=send), not a Discord send failure.
  • What was not tested: No broad runtime auto-delivery change was tested or made. This PR does not auto-post all final replies; it only changes prompt/tool guidance for visible-answer cases.

@openclaw-barnacle openclaw-barnacle Bot added size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 10, 2026
@clawsweeper

clawsweeper Bot commented May 10, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Summary
The PR adds message-tool-only visible-answer guidance to group/direct prompt context, ACP turn text, agent system prompts, message-tool descriptions, tests, and prompt snapshots.

Reproducibility: yes. for the source-level prompt gap: current main keeps message-tool-only finals private and lacks the direct-addressed/status/completion warning on the relevant prompt surfaces. The PR body also supplies redacted real Discord terminal proof, but I did not rerun the live Discord path.

Real behavior proof
Sufficient (terminal): The PR body includes redacted terminal proof from a real Discord message_tool_only installation showing the patched prompt/tool bundles validated successfully after restart.

Next step before merge
No automated repair lane is needed; the diff has no blocking findings, but merge needs maintainer review and current-head CI resolution.

Security
Cleared: The diff changes prompt text, tests, and prompt snapshot fixtures only; it does not add dependencies, workflows, scripts, permissions, or secret-handling paths.

Review details

Best possible solution:

Land the prompt clarification after maintainer review and green current-head checks, while leaving deterministic suppressed-final diagnostics to #80949.

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

Yes for the source-level prompt gap: current main keeps message-tool-only finals private and lacks the direct-addressed/status/completion warning on the relevant prompt surfaces. The PR body also supplies redacted real Discord terminal proof, but I did not rerun the live Discord path.

Is this the best way to solve the issue?

Yes for this PR's scope: a prompt-only clarification across group/direct, ACP, agent-system, and tool-description surfaces is the narrowest maintainable mitigation. Runtime diagnostics are a separate path already represented by #80949.

What I checked:

  • Current delivery contract: Current main defines message_tool_only as keeping final/block/preview output private, with visible source-channel output coming from the message tool. (src/auto-reply/get-reply-options.types.ts:170, 916fc3d09ae1)
  • Current group/direct prompt gap: Current main tells group/direct message-tool-only turns that normal finals are private and message(action=send) posts visibly, but the new direct-addressed/status/completion warning is absent. (src/auto-reply/reply/groups.ts:235, 916fc3d09ae1)
  • Current agent/tool prompt gap: Current main has private-final/message-tool-only guidance in ACP dispatch, agent system prompt, and the message tool description, but not the explicit instruction to avoid leaving expected visible answers only in normal final text. (src/agents/tools/message-tool.ts:749, 916fc3d09ae1)
  • PR implementation surface: The PR diff adds the visible-answer warning to group/direct context, ACP turn guidance, buildAgentSystemPrompt messaging guidance, the message tool description, and matching tests/snapshots. (src/auto-reply/reply/groups.ts:234, fbcaed002710)
  • Real behavior proof: The PR body includes redacted terminal proof from a real Discord message_tool_only installation showing the patched prompt/tool bundles validated successfully after restart and connectivity was OK. (fbcaed002710)
  • Related runtime diagnostic work: The related open PR tracks the deterministic suppressed-final warning path, so this PR can stay focused on prompt guidance rather than auto-forwarding private finals. (47056e8df729)

Likely related people:

  • steipete: Current blame for the prompt surfaces points to Peter Steinberger's 0844e77 commit, and b621663 updated the message-tool-only tool spec adjacent to this PR. (role: current implementation contributor; confidence: high; commits: 0844e771a8df, b62166301efd; files: src/auto-reply/reply/groups.ts, src/auto-reply/reply/dispatch-acp.ts, src/agents/system-prompt.ts)
  • pashpashpash: Recent message-tool-mode/no-reply prompt work changed src/agents/system-prompt.ts and src/auto-reply/reply/groups.ts, the same prompt boundary this PR clarifies. (role: adjacent behavior contributor; confidence: medium; commits: 064d455fd879; files: src/agents/system-prompt.ts, src/auto-reply/reply/groups.ts)
  • scoootscooob: Commit 3c63620 changed group replies toward tool-only visible delivery by default, which is the policy boundary clarified here. (role: introduced related delivery default; confidence: medium; commits: 3c636208b0a0; files: docs/channels/groups.md, src/auto-reply/reply/dispatch-acp.ts, src/auto-reply/reply/groups.ts)
  • shakkernerd: Recent ACP reply durability work touched the ACP dispatch path that receives one of the prompt clarifications. (role: recent adjacent contributor; confidence: medium; commits: 511f42d8a3a2; files: src/auto-reply/reply/dispatch-acp.ts)

Remaining risk / open question:

  • Current-head CI is not green; visible failures are in Telegram type/boundary checks outside the changed files and should be resolved or confirmed unrelated before merge.
  • I did not rerun a live Discord session in this read-only review; the real behavior proof assessment relies on the PR body's redacted terminal output.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 916fc3d09ae1.

@anyech
anyech force-pushed the fix/discord-message-tool-only-context branch from aaf5d1b to f002f65 Compare May 10, 2026 02:21
@anyech
anyech force-pushed the fix/discord-message-tool-only-context branch from f9cde59 to 8d08155 Compare May 10, 2026 07:07
@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label May 10, 2026
@anyech
anyech force-pushed the fix/discord-message-tool-only-context branch from 11f25d1 to e67b638 Compare May 10, 2026 09:56
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 10, 2026
@anyech
anyech force-pushed the fix/discord-message-tool-only-context branch 2 times, most recently from 163bb76 to 8ca012d Compare May 10, 2026 20:56
@clawsweeper clawsweeper Bot added the mantis: telegram-visible-proof Mantis should capture Telegram visible proof. label May 10, 2026
@anyech

anyech commented May 10, 2026

Copy link
Copy Markdown
Contributor Author

Updated this PR head so the generated protocol output is included directly on this branch; it no longer depends on #80436. The PR body includes redacted after-fix behavior proof for the visible-reply guidance lane.

/clawsweeper review

@anyech
anyech force-pushed the fix/discord-message-tool-only-context branch 3 times, most recently from 6944464 to ef2d4c3 Compare May 12, 2026 21:26
@clawsweeper clawsweeper Bot removed the mantis: telegram-visible-proof Mantis should capture Telegram visible proof. label May 12, 2026
@clawsweeper

clawsweeper Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 12, 2026
@anyech
anyech force-pushed the fix/discord-message-tool-only-context branch from ef2d4c3 to 02e61d2 Compare May 15, 2026 04:57
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 15, 2026
@anyech
anyech force-pushed the fix/discord-message-tool-only-context branch from 02e61d2 to 3dfce9b Compare May 15, 2026 05:08
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 15, 2026
@anyech
anyech force-pushed the fix/discord-message-tool-only-context branch from 3dfce9b to e2e4119 Compare May 15, 2026 05:51
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 15, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 15, 2026
@anyech
anyech force-pushed the fix/discord-message-tool-only-context branch from e2e4119 to fbcaed0 Compare May 15, 2026 06:35
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 15, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 15, 2026
@anyech

anyech commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #80949.

I consolidated this prompt/context guidance into #80949 so the message-tool-only final-visibility work has one review surface. #80949 now includes:

  • this prompt/tool/context guidance;
  • the suppressed-final audit warning;
  • the guarded runtime fallback for missed message-tool-only final replies.

Closing this PR to avoid splitting the same fix across multiple open PRs.

@anyech anyech closed this May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant