Skip to content

fix: show dry-run output for message send and poll#80863

Closed
yfge wants to merge 13 commits into
openclaw:mainfrom
yfge:fix/issue-80507
Closed

fix: show dry-run output for message send and poll#80863
yfge wants to merge 13 commits into
openclaw:mainfrom
yfge:fix/issue-80507

Conversation

@yfge

@yfge yfge commented May 12, 2026

Copy link
Copy Markdown
Contributor

Summary

openclaw message send --dry-run and message poll --dry-run were formatting their pretty-text output like real deliveries whenever the runner still reported handledBy: "core". This patch makes the CLI formatter honor the stable dryRun flag so dry-run invocations print the muted preview text instead of a misleading success checkmark.

Changes

  • treat result.dryRun as the primary dry-run signal in formatMessageCliText
  • keep the existing handledBy: "dry-run" fallback for other action kinds
  • add regression coverage for dry-run send and poll formatter output

Testing

  • pnpm test src/commands/message-format.test.ts src/commands/message.test.ts src/infra/outbound/format.test.ts
  • pnpm exec oxfmt --check --threads=1 src/commands/message-format.ts src/commands/message-format.test.ts
  • node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/commands/message-format.ts src/commands/message-format.test.ts src/commands/message.test.ts src/infra/outbound/format.test.ts
  • pnpm build

Impact

This only changes CLI dry-run presentation for message send/poll. Actual dry-run delivery safeguards stay unchanged.

Fixes #80507

Real behavior proof

Redacted CLI dry-run output after this patch:

$ pnpm openclaw message send --channel slack --target channel:C00000FAKE000 --message "Hi" --dry-run
[dry-run] would run send via slack

$ pnpm openclaw message poll --channel telegram --target 123456 --poll-question "Snack?" --poll-option Pizza --poll-option Sushi --dry-run
[dry-run] would run poll via telegram

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations channel: feishu Channel integration: feishu size: L triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 12, 2026
@clawsweeper

clawsweeper Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Close as duplicate: #80604 already tracks the same dry-run formatter/test fix for #80507. This PR now has useful redacted CLI proof and a narrow net diff, but its branch history still contains removed unrelated workspace/artifact commits, so it is not the best second merge vehicle.

So I’m closing this here and keeping the remaining discussion on the canonical linked item.

Review details

Best possible solution:

Keep one canonical clean implementation for #80507, land the formatter/test change after acceptable proof, and preserve this PR's redacted CLI output only as supporting context if useful.

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

Yes. Current-main source shows send and poll dry-runs can reach the formatter as dryRun: true with handledBy: "core", while the formatter only branches on handledBy === "dry-run"; I did not execute the CLI in this read-only review.

Is this the best way to solve the issue?

Yes for the code direction: checking result.dryRun before success formatting is the narrow fix. This PR should not be kept as a second merge vehicle because the same fix is already under review in #80604 and this branch history still contains unrelated removed artifacts.

Security review:

Security review needs attention: The current net diff is clean, but this PR branch history still contains removed workspace/artifact commits that should not be preserved if code is reused.

  • [medium] Avoid preserving removed artifact commits — memory/2026-05-07.md:1
    Earlier commits in the PR branch added memory and x-post artifact paths before later removal. A squash or cherry-pick of the net formatter diff avoids publishing those unrelated artifacts into main history.
    Confidence: 0.9

What I checked:

Likely related people:

  • @steipete: Current-main blame covers the formatter guard and result contract lines, and recent GitHub path history shows substantial outbound/message action work on the implicated files. (role: recent area contributor; confidence: high; commits: 5b1d1eac1214, 5e8e77ed83eb, 2ead1502c9bf; files: src/commands/message-format.ts, src/infra/outbound/message-action-runner.ts, src/infra/outbound/message.ts)
  • @shakkernerd: Recent path history for src/commands/message-format.ts includes formatter-summary work on the same CLI presentation surface. (role: recent formatter contributor; confidence: medium; commits: 8fe449c8834b; files: src/commands/message-format.ts)
  • @vincentkoc: Recent path history shows CLI and terminal formatting work adjacent to the command path that calls the message formatter. (role: adjacent CLI contributor; confidence: medium; commits: be1c38e692f2, 74e7b8d47b18; files: src/commands/message.ts, src/commands/message-format.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against 5ed2a9a4e21b.

@openclaw-barnacle openclaw-barnacle Bot added size: XS and removed channel: feishu Channel integration: feishu size: L labels May 12, 2026
@yfge

This comment was marked as spam.

@clawsweeper

clawsweeper Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper could not start a re-review for this item.

Reason: re-review requires an open issue or PR.

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 12, 2026
@clawsweeper clawsweeper Bot closed this May 12, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

1 participant