Skip to content

fix(discord): keep long table labels bold across messages - #205328

Merged
vincentkoc merged 1 commit into
mainfrom
fix/discord-table-label-emphasis-split-c34
Nov 25, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/discord-table-label-emphasis-split-c34

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

With Discord tables rendered as bullets, a long first-column label could cross the 2,000-character message limit. Each message then carried only part of the bold markup. A 1,997-character label became italic and exposed a literal asterisk in an independent Markdown parse.

User Impact

Long labels stay bold across the message boundary. Their text and the fields that follow remain in order. A 1,996-character label still fits intact in the first message.

Why This Change Was Made

The formatter already produces the intended bold span. The Discord chunker now recognizes a parsed standalone bold label and accounts for closing and reopening it when measuring each message. Thanks to @jakepresent for reporting the broader Discord Markdown splitting problem and exploring an earlier repair. Earlier report · Earlier proposal

Evidence

Captured serialized requests from the ordinary guild-channel sender using a synthetic REST transport. At label lengths 1,996, 1,997 and 1,998, the two messages measured 2,000/11, 2,000/17 and 2,000/18 UTF-16 units. Parsing each message independently preserved every label character in bold and exposed zero literal stars. Both the original generated failure and its shrunk example passed. Additional captures covered an escaped star in a two-row table, ordinary text, escaped markup, inline code and fenced code.

Formatting and whitespace checks passed. Hosted Vitest for the Discord sender is pending. The capture covers outgoing content and parsed formatting. Live Discord client appearance is unverified.

@vincentkoc vincentkoc self-assigned this Nov 25, 2026
@clawsweeper

clawsweeper Bot commented Nov 25, 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 channel: discord Channel integration: discord size: S labels Nov 25, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 25, 2026
@clawsweeper

clawsweeper Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR closes and reopens bold formatting when a long Discord table label crosses a message boundary.

Example: Send a bullet-rendered table with a 1,997-character first-column label and State: Ok.

  • Before: The label's bold markers split between messages, producing italic text and a literal asterisk.
  • After: Each message receives balanced bold markers while the label text and following field remain ordered.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The patch is focused and source-plausible with useful boundary tests, but required real-behavior proof is absent and the failed CI check remains unattributed.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Long table labels lose bold formatting and expose markup when Discord sends them in separate messages.
Reason: The maintainer-authored direction restores the formatter's intended output with a focused change and no new setting or public API.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR addresses a concrete formatting gap still present on main; source review found no definite introduced defect.

Reviewed head: f8c2154a308cb4f196175f6ecb4529e7ebeff710

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Provide redacted before/after Discord captures of the 1,997-character label split; a recorded base-red/head-green regression run is also not supplied.
Agent review details

How this fits together

Discord delivery converts Markdown tables to labeled bullets, then the Discord chunker produces bounded message payloads for bot and webhook sends.

flowchart LR
  A[Markdown reply] --> B[Discord Markdown formatter]
  B --> C[Table bullet labels]
  C --> D[Discord source range chunker]
  D --> E[Bot or webhook sender]
  E --> F[Discord messages]
Loading

Technical review

Best possible solution:

Keep the repair in Discord's existing source-range renderer, preserving label text, message limits, and current code-formatting behavior.

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

The table producer emits a 2,001-unit bold span for a 1,997-character label, while main splits without balancing strong delimiters; this establishes the source path, but no target code was executed during this read-only review.

Is this the best way to solve the issue?

The approach uses the existing Discord boundary owner and declared Markdown parser dependency; simplification review found no definite unnecessary production machinery or unrelated change.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 52715199483c.

Provenance checked

  • Discord rendered-range sizing and inline-code preservation keeps the original intent (38b8819: Keep source ranges separate from synthetic delimiters and measure complete physical messages while preserving code and container ownership.)
  • Ordered range lookup keeps the original intent (5008ea8: Avoid repeated full-span scans while retaining strict endpoint behavior and identical delivery content.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 38b8819 adds extensions/discord/src/chunk.ts:396 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 38b881999166; files: extensions/discord/src/chunk.ts)

PR surface

Source +76, Tests +75. Total +151 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 79 3 +76
Tests 1 76 1 +75
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 155 4 +151

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:

  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

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

  • Supply live Discord evidence for the changed label-boundary behavior.

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 25, 2026, 7:19 AM ET / 12:19 UTC.

@vincentkoc
vincentkoc marked this pull request as ready for review November 25, 2026 12:24
@vincentkoc
vincentkoc merged commit a7ed11e into main Nov 25, 2026
245 of 247 checks passed
@vincentkoc
vincentkoc deleted the fix/discord-table-label-emphasis-split-c34 branch November 25, 2026 13:32
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Nov 25, 2026
* commit '92569e37ab84a8cb1e4a12c3dcbb45acb97977c9':
  fix: distinguish Desktop sources without wrapping their names or IDs (#203747)
  fix(ui): Greek sigma searches miss matches outside Sessions and Files (#189518)
  fix: keep agent skill names on one line beside their switches (#203734)
  test(cron): admit scheduled occurrences in cron fixtures and fix Node 24 toHex in Vitest (#205383)
  fix: keep the Agents menu usable after copying an ID (#203739)
  fix(whatsapp): preserve code table spaces across message chunks (#205327)
  refactor(cron): admit legacy scheduled requesters through operator admission (#205346)
  fix: keep silent Codex turns healthy with running commands (#196062)
  test(update): verify the recorded preparation failure (#205363)
  fix(test): prove sibling imports on the active update path
  fix(chat): complete mentions without leaving part of the name behind (#205326)
  fix(test): restore Side chat hydration and retry checks (#205376)
  refactor: plugin-run turns get owner status from commands.ownerAllowFrom, like text messages (#205373)
  chore(ui): refresh control ui locales (#205378)
  fix: keep Telegram rich <details> and list blocks in one message when replies stream in chunks (#205318)
  refactor(gateway): one refusal owner with a required next step (#205337)
  fix(discord): keep long table labels bold across messages (#205328)
  feat: invitation, sharing and participant controls in the Control UI (#204920)
  fix(test): distinguish stamped Skill Library upgrade policies
  fix(markdown): preserve trailing inline-code spaces in plain-text tables (#205317)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant