Skip to content

fix(message): table silently missing when a presentation table lacks a caption - #196642

Open
hidenori-endo wants to merge 1 commit into
openclaw:mainfrom
hidenori-endo:fix/message-send-reject-dropped-table
Open

hidenori-endo wants to merge 1 commit into
openclaw:mainfrom
hidenori-endo:fix/message-send-reject-dropped-table

Conversation

@hidenori-endo

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: a message send with a presentation table that lacks a caption (or has an empty cell or a duplicate header) reports sent, but the table never reaches the channel. In Slack, only the presentation title header is posted.

User Impact

User impact: agents get an error naming presentation.blocks[<index>] and the required fields, so they can fix and resend the table instead of silently posting a message without its data. Valid tables and charts behave as before.

Behavior change: sends that used to succeed with a silently dropped table or chart block now fail. Normalization itself still drops invalid blocks for other producers, as docs/plugins/message-presentation.md documents.

Why This Change Was Made

The tool schema stays flat for provider validators, so normalizeMessagePresentation is where table and chart shapes are enforced, and it drops an invalid block without telling the caller. buildMessagePayload is shared by executeMessageSend and the source-reply path, so it now rejects a table or chart block that normalization would drop. The Slack docs said a table that cannot render natively "becomes complete text"; they now state the required fields and the error.

Evidence

  • Observed on 2026.11.2 with a Slack DM: the agent sent a 35-row table without caption. The tool result was deliveryStatus: "sent", and conversations.replies showed only section + header blocks. Resending the same rows with a caption produced a data_table.
  • New cases in src/infra/outbound/message-action-send.validation.test.ts (missing caption, empty cell, incomplete chart) fail on the base and pass with the fix. The valid-table case passes on both.
  • vitest run src/infra/outbound extensions/slack/src/channel.presentation.test.ts extensions/slack/src/reply-blocks.test.ts src/agents/tools/message-tool: 122 files, 1404 tests passed.
  • pnpm check:changed: formatting, lint, and core/test typecheck pass. The dead export scan fails on files this PR does not touch (for example src/agents/models-config.ts).
  • Gap: not re-run through an isolated Gateway with the Slack e2e skill.

A presentation table without a caption, or with an empty cell or duplicate header, is dropped during normalization. The send then delivers the rest of the message and reports success, so a Slack reply shows only its title header and the agent never learns the table is missing. Reject such table and chart blocks in the message send payload with an error naming the block index and its required fields.
@clawsweeper

clawsweeper Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: slack Channel integration: slack size: XS labels Nov 10, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 10, 2026
@clawsweeper

clawsweeper Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR rejects message sends containing tables or charts that presentation normalization would discard.

Example: Send “Hosts” with headers [“Name”, “State”], rows [[“web”, “running”]], and no table caption.

  • Before: The surviving message can report successful delivery without the table.
  • After: An ordinary send rejects with an error identifying presentation.blocks[0].

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) Useful bug-fix direction, with an incomplete validation boundary, a concrete CI blocker, and no after-fix shipped-entry-point proof.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦪 silver shellfish (2/6) 2 actionable review findings remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: Agents can report successful delivery even though the table containing the requested information was omitted.
Reason: Rejecting malformed authored data prevents misleading delivery receipts while preserving the existing atomic normalization contract.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep open: this addresses a real silent-content-loss bug and adds coverage beyond the earlier caption-only PR, but validation runs too late for decorated cross-context sends and introduces a CI ratchet violation.

Priority: P2
Reviewed head: dc56871ae5a72df3e5ee96c272a6c13ee7bfaec4

Before merge

  • Add real behavior proof - At dc56871, after-fix evidence consists of reported tests and dry-run regressions; the Slack observation describes the original failure, and the body explicitly states that the fix was not rerun through an isolated Gateway. Provide shipped CLI or Gateway output covering rejection before transport and intact valid-table delivery, redacting IPs, API keys, phone numbers, and non-public endpoints. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Validate original blocks before cross-context decoration (P2) - When a Discord-bound agent sends “Hosts” plus a captionless table from one channel to another with the default marker enabled, applyMessageCrossContextMarker runs before this assertion. Discord's buildCrossContextPresentation supplies decoration, and message-action-execution.ts:156 normalizes and replaces the original presentation, dropping the invalid table. The new assertion then sees only valid decoration and permits the incomplete send. Move validation before this mutation and add a cross-context regression.
  • Use the existing record coercer instead of new unchecked assertions (P2) - The assertions here and on line 98 add two unexempted production assertions above the file's grandfathered count of one. The assertion-safety scanner counts both, and the exact-head baseline check reports assertion-safety failure, propagating to ci-gate. Use the already imported asOptionalRecord for raw and block so the repair passes without widening the baseline or suppressing the guard.

Findings

  • [P2] Validate original blocks before cross-context decoration — src/infra/outbound/message-action-send.ts:326
  • [P2] Use the existing record coercer instead of new unchecked assertions — src/infra/outbound/message-action-send.ts:93-98

Tests

  • Low-value test src/infra/outbound/message-action-send.validation.test.ts: The added valid-table test asserts only kind === send and would pass if the entire table disappeared; remove it or replace it with an assertion of complete delivered table content.
  • Missing end-to-end proof: Supply a redacted shipped-entry-point trace showing invalid blocks reject before transport, including decorated cross-context sends, and a valid table reaches delivery intact.
Agent review details

How this fits together

The shared message-send builder converts tool and CLI arguments into reply payloads before channel rendering, fallback generation, and delivery.

flowchart LR
  A[Message tool or CLI] --> B[Shared send builder]
  B --> C[Cross-context decoration]
  C --> D[Presentation validation]
  D --> E[Presentation normalization]
  E --> F[Channel rendering and fallback]
  F --> G[Transport delivery]
Loading

Technical review

Best possible solution:

Validate the original presentation before decoration or content checks can discard blocks, using existing coercion and normalization owners.

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

Current-main source establishes omission when text or a title survives a captionless table, consistent with reports on official releases; no target code was executed during this review.

Is this the best way to solve the issue?

Send-boundary rejection is appropriate, but it must inspect original arguments before cross-context decoration performs normalization.

Full review comments:

  • [P2] Validate original blocks before cross-context decoration — src/infra/outbound/message-action-send.ts:326
    When a Discord-bound agent sends “Hosts” plus a captionless table from one channel to another with the default marker enabled, applyMessageCrossContextMarker runs before this assertion. Discord's buildCrossContextPresentation supplies decoration, and message-action-execution.ts:156 normalizes and replaces the original presentation, dropping the invalid table. The new assertion then sees only valid decoration and permits the incomplete send. Move validation before this mutation and add a cross-context regression.
    Confidence: 0.99
  • [P2] Use the existing record coercer instead of new unchecked assertions — src/infra/outbound/message-action-send.ts:93-98
    The assertions here and on line 98 add two unexempted production assertions above the file's grandfathered count of one. The assertion-safety scanner counts both, and the exact-head baseline check reports assertion-safety failure, propagating to ci-gate. Use the already imported asOptionalRecord for raw and block so the repair passes without widening the baseline or suppressing the guard.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 3f17d921f6cc.

Provenance checked

  • Portable table validity and atomic normalization keeps the original intent (81a201d: Portable tables require complete, typed data and deterministic native or text rendering, as explained in feat: add portable table presentation blocks #103583.)
  • Shared message-send payload construction changes intended behavior with a stated reason (627e5bb: refactor(outbound): split message action runner by concept #121434 separated send construction from routing and execution while preserving behavior; this PR explicitly explains changing malformed-send success into an error.)
  • Slack rich-message documentation keeps the original intent (8398d0f: The Slack documentation was split by reader task; the added validity explanation remains in the existing rich-message guide.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test src/infra/outbound/message-action-send.validation.test.ts src/infra/outbound/message-action-send.test.ts src/interactive/payload.test.ts
  • pnpm test src/channels/plugins/contracts/outbound-payload.contract.test.ts src/infra/outbound/message-action-execution.test.ts src/infra/outbound/message-action-execution.source-reply.test.ts src/infra/outbound/message-action-execution.accepted-results.test.ts
  • pnpm check:assertion-safety
  • pnpm check:changed
  • git diff --check

What I checked:

PR surface

Source +24, Tests +16, Docs +7. Total +47 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 24 0 +24
Tests 1 16 0 +16
Docs 2 8 1 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 48 1 +47

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Malformed presentation data can disappear behind successful delivery, but the trigger is bounded and valid payloads avoid it.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 10, 2026, 6:53 AM ET / 11:53 UTC.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: slack Channel integration: slack docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant