Repository navigation
fix(cli): failed message actions report success - #130281
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 2:21 PM ET / 18:21 UTC. ClawSweeper reviewWhat this changesThe PR makes message CLI actions report top-level plugin payload failures consistently in terminal output, JSON, and process exit status. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open. Current main still converts plugin soft failures into CLI success; this PR repairs that shared outcome boundary across exit status, text, and JSON. The protected Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe message CLI dispatches sends, polls, and channel actions through the outbound action runner. Channel plugins return action payloads, which the CLI turns into human output, JSON, and an exit code for operators and scripts. flowchart LR
A[CLI message action] --> B[Outbound action runner]
B --> C[Channel plugin result]
C --> D[Canonical outcome resolver]
D --> E[Terminal message]
D --> F[JSON envelope]
D --> G[Process exit status]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +17, Tests +139. Total +156 across 7 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land one canonical outcome resolver after refreshing the branch and validating the exact head; keep core delivery statuses authoritative and preserve plugin payloads unchanged. Do we have a high-confidence way to reproduce the issue? Yes—current main preserves plugin action payloads containing Is this the best way to solve the issue? Yes—the shared outcome resolver is the narrowest maintainable fix because the same result must govern CLI exit status, text output, and JSON output. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1fec7b6ccd89. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Maintainer rank-up resolution: skipping the optional refresh onto current main because this branch remains mergeable, and its exact immutable head |
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where operators running message actions would see a successful green checkmark and exit code zero even when a channel explicitly reported that the action failed. Disabled or rejected Telegram reactions could misleadingly print
Reaction updatedorReaction added, failed message deletions looked successful, and plugin-handled sends or polls also hid their failures. JSON output kept the failure buried insidepayloadwithout the standard top-level failure envelope.Why This Change Was Made
Reuse one canonical message-action outcome at all three CLI boundaries: process exit status, human-readable output, and machine-readable JSON. Only an authoritative top-level
payload.ok === falseis treated as a provider-reported failure; existing core delivery statuses and broadcast aggregation remain authoritative, and providererror,warning, orhinttext is surfaced without modifying the original payload. Channel plugins continue returning their intentional soft failures to model tools, preventing duplicate-action retry loops.User Impact
Failed reactions, deletions, edits, plugin-handled sends, and polls now explain the actual provider failure and exit nonzero; JSON callers receive the normal
ok: false/cli_errorenvelope alongside the unchanged provider payload. Successful actions, legacy payloads without a boolean outcome, dry runs, broadcast results, and partially delivered messages retain their existing behavior.Evidence
addedmetadata, deletes, plugin polls, and plugin sends all exited zero instead of one; 50 existing parser tests passed.node scripts/run-vitest.mjs src/cli/program/message/helpers.test.ts src/commands/message-format.test.ts src/commands/message.test.ts src/infra/outbound/message-action-runner.plugin-dispatch.test.ts src/infra/outbound/message-action-runner.core-send.test.ts— 128 tests passed across three routed shards.git diff --check, independent source review, and configured Codex autoreview all passed.AI-assisted.