Skip to content

fix(channels): keep title-only cards visible and media counts accurate - #129193

Merged
steipete merged 1 commit into
mainfrom
codex/title-only-presentation-rendering-20260825
Aug 25, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/title-only-presentation-rendering-20260825

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users sending a presentation that contains only a heading would have a genuinely visible card recorded as an empty message in durable send and live-preview metadata. Ordinary message-tool media sends also recorded one attachment twice because the payload producer mirrors its primary attachment in both supported media fields.

Why This Change Was Made

The rendered-batch owner now recognizes presentation headings, merges the overlapping single-media alias without collapsing deliberately repeated ordered attachments, and derives every aggregate from the same normalized render-plan items. This removes the duplicate raw-payload counting path and preserves distinct attachments supplied through both fields.

User Impact

Title-only cards stay visible to durable delivery and live-preview consumers, and generated-image or other media sends report the number of attachments that will actually be delivered. Existing voice, location, multi-attachment, distinct legacy-media, and intentionally repeated-attachment behavior remains unchanged.

Evidence

  • Authentic pre-fix producer proof: the real message-action payload builder accepted a title-only presentation, while the real rendered-batch owner labeled it empty; the same builder produced one attachment in both mediaUrl and mediaUrls, while the owner incorrectly counted two.
  • Authentic pre-fix regression results: rendered-batch owner suite failed three new cases; the actual durable-send/live-preview boundary failed both new presentation and media cases.
  • Post-fix focused owner, caller, sibling bridge, real message-action producer, and media compatibility proof: node scripts/run-vitest.mjs src/channels/message/rendered-batch.test.ts src/channels/message/send.test.ts src/channels/message/outbound-bridge.test.ts src/media/media-retirement-non-goals.test.ts src/infra/outbound/message-action-send.test.ts — 57 tests passed across five files and three Vitest shards.
  • Targeted formatting, lint, diff checks, independent owner-boundary review, and structured Codex review all passed. Production code shrank by seven lines.
  • Live-channel execution was not performed: this deterministic generic render-plan metadata repair is fully exercised through the actual message-action producer and durable live-preview owner without accessing an operator-owned channel or live credentials.

@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 25, 2026
@steipete
steipete marked this pull request as ready for review August 25, 2026 09:24
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 25, 2026
@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 25, 2026, 5:31 AM ET / 09:31 UTC.

ClawSweeper review

What this changes

This PR updates rendered channel-message metadata so title-only presentations are visible and a media URL mirrored in the plural media list is counted once.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. The title-only and mirrored-alias fixes are directionally correct, but the new repeated-media case conflicts with the canonical outbound delivery normalization and can leave durable fan-out metadata inaccurate.

Priority: P2
Reviewed head: a8b32afd35e4ed35359e3c749816175a82a7ef3a

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch has focused scope and useful source-level proof, but its new repeated-media expectation conflicts with the delivery contract.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body records focused owner and producer test evidence.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body records focused owner and producer test evidence.
Evidence reviewed 6 items Changed planner behavior: The PR’s planner preserves repeated entries in mediaUrls after collapsing only the singular/plural alias overlap.
Canonical delivery normalization: Outbound payload planning trims and de-duplicates every media URL before delivery, preserving first-seen order.
Durable fan-out invariant: Required durable sends compare rendered-plan media count with the normalized effective delivery payload and reject a mismatch.
Findings 1 actionable finding [P2] Align repeated-media expectations with delivery canonicalization
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs src/channels/message/rendered-batch.test.ts src/channels/message/send.test.ts

Result: PASS (completed)

runner@runnervm76f27:/tmp/clawsweeper-live-proof-129193-eiDgvx/target$ node scripts/run-vitest.mjs src/channels/message/rendered-batch.test.ts src/channels/mess
age/send.test.ts
[test] starting test/vitest/vitest.unit-fast.config.ts
node scripts/run-vitest.mjs src/channels/message/rendered-batch.test.ts src/channels/message/send.test.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-129193-eiDgvx/target

 ✓  unit-fast  src/channels/message/rendered-batch.test.ts (5 tests) 6ms

 Test Files  1 passed (1)
      Tests  5 passed (5)
   Start at  09:32:43
   Duration  306ms (transform 98ms, setup 99ms, import 35ms, tests 6ms, environment 0ms)

[test] starting test/vitest/vitest.channels.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-129193-eiDgvx/target


































Assertions:

  • PASS expect_output: Tests

How this fits together

Message-action payloads enter the durable channel sender, which creates a rendered batch plan for live previews, queue metadata, and recovery before outbound delivery normalizes the actual payload. The plan’s media cardinality must match the canonical delivery payload.

flowchart LR
  A[Message action payload] --> B[Durable send context]
  B --> C[Rendered batch planner]
  C --> D[Live preview and queue metadata]
  B --> E[Outbound payload normalizer]
  E --> F[Channel delivery]
  C --> G[Fan-out consistency check]
  E --> G
Loading

Before merge

  • Align repeated-media expectations with delivery canonicalization (P2) - The new case expects two identical ordered URLs to remain in the render plan, but outbound planning removes duplicates in src/infra/outbound/payloads.ts:191-210; required durable sends compare that effective fan-out with this plan and reject a mismatch. Normalize this path with the canonical rule and cover the durable boundary instead of preserving repeated entries here.
  • Resolve merge risk (P1) - The repeated-list expectation can leave the rendered plan at two attachments while canonical outbound delivery reduces it to one, violating required durable-send fan-out checks.

Findings

  • [P2] Align repeated-media expectations with delivery canonicalization — src/channels/message/rendered-batch.test.ts:43-46
Agent review details

Security

None.

PR surface

Source -7, Tests +54. Total +47 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 16 23 -7
Tests 2 54 0 +54
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 70 23 +47

Review metrics

Metric Value Why it matters
Production versus test LOC production -7, tests +54 The implementation shrinks, but the added repeated-media test currently encodes behavior inconsistent with canonical delivery.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Derive rendered media metadata from the same canonical ordering and de-duplication rule as outbound payload planning, then cover the required durable-send boundary.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Derive rendered media metadata from the same canonical ordering and de-duplication rule as outbound payload planning, then cover the required durable-send boundary.

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

Yes—source inspection gives a high-confidence path: a title-only presentation is accepted by the presentation normalizer but current main marks only nonempty blocks, while canonical outbound normalization demonstrates the repeated-media mismatch.

Is this the best way to solve the issue?

No. The title-only and mirrored-alias portions use the correct owner boundary, but repeated-list media must follow the canonical outbound normalization rather than a separate local rule.

Full review comments:

  • [P2] Align repeated-media expectations with delivery canonicalization — src/channels/message/rendered-batch.test.ts:43-46
    The new case expects two identical ordered URLs to remain in the render plan, but outbound planning removes duplicates in src/infra/outbound/payloads.ts:191-210; required durable sends compare that effective fan-out with this plan and reject a mismatch. Normalize this path with the canonical rule and cover the durable boundary instead of preserving repeated entries here.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 315969f6693e.

Labels

Label changes:

  • add P2: The PR has a concrete durable-message metadata mismatch that needs correction before merge.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body records focused owner and producer test evidence.

Label justifications:

  • P2: The PR has a concrete durable-message metadata mismatch that needs correction before merge.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body records focused owner and producer test evidence.

Evidence

What I checked:

Likely related people:

  • steipete: Recent current-main work on mixed explicit and parsed attachments is directly adjacent to this media-normalization boundary. (role: recent area contributor; confidence: high; commits: 251197b95db2; files: src/infra/outbound/payloads.ts, src/channels/message/rendered-batch.ts)
  • qingminlong: Commit 3b23812 is the recorded prior repair for rendered message media counts. (role: introduced earlier media-count repair; confidence: medium; commits: 3b238128b2ba; files: src/channels/message/rendered-batch.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Use the canonical outbound media normalization for rendered metadata.
  • Add a required durable-send regression that proves duplicated input yields one planned and one effective attachment.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 2da70a8 into main Aug 25, 2026
473 of 482 checks passed
@steipete
steipete deleted the codex/title-only-presentation-rendering-20260825 branch August 25, 2026 09:47
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant