Repository navigation
improve: format long list-heavy reports faster - #145665
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 12, 2026, 3:17 AM ET / 07:17 UTC (Revision 4). ClawSweeper reviewWhat this changesThe shared Markdown renderer checks the last two characters directly when separating lists, reducing formatting work for long reports without changing their output. Merge readiness✅ Ready for maintainer review This optimization remains useful: current main and the latest release retain the repeated regex scan. The replacement preserves separator behavior, and no actionable correctness or security defect was found. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw parses outbound Markdown into text and formatting spans shared by channel renderers. List separators become part of that text before chunking and channel-specific formatting. flowchart LR
A[Outbound Markdown] --> B[Shared Markdown parser]
B --> C[List closes]
C --> D{Ends with two newlines?}
D -->|No| E[Append one newline]
D -->|Yes| F[Text and formatting spans]
E --> F
F --> G[Channel chunking and rendering]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -1. Total -1 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the suffix check in the existing shared renderer, preserving list spacing and all downstream text offsets. Do we have a high-confidence way to reproduce the issue? Yes, from source: each top-level list close searches the accumulated output with a regex on current main. The PR reports a matching large-report benchmark; this review did not execute it. Is this the best way to solve the issue? Yes. Testing the required suffix directly is a narrow replacement within the existing owner, with equivalent separator decisions and no new API or state. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 69467d2ed8a5. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
c29cbc9 to
d006825
Compare
|
Merged via squash.
|
What Problem This Solves
Resolves a problem where long reports with many separate lists take progressively longer to format for messaging channels.
Why This Change Was Made
The shared Markdown renderer only needs to know whether its output ends with two newlines. Check that suffix directly instead of searching the entire accumulated output after every top-level list. This preserves the existing separator behavior and removes repeated prefix scans.
User Impact
Large list-heavy responses spend less time in Markdown parsing. Formatting, Unicode offsets, and parser metadata remain unchanged.
Evidence
markdownToIRsource entry, ten warmups and thirty samples per fixed synthetic report. The 512-section / 225,575 UTF-16-unit workload improved from 323.50 ms to 136.90 ms median (2.36x). Smaller cases were noisy and do not establish a speedup.canonicalProviderNameinscripts/crabbox-wrapper-providers.mtsdespite existing external consumers; that export, its consumers, and Knip configuration were unchanged between original baseline7275b4baa025 and the tested patch.git range-diffconfirms the Markdown patch is identical, and the measured candidate source hash remains unchanged. Fresh exact-head CI run34679693312 passed, including the originally failing shard.d0068253c7866c20e0bc32c5205dad07db891f0d: 54 tests, Node 26.8.2, after repairing missing task-local dependency payloads. The checkout remains clean.The benchmark artifact is local task evidence, not a new timing-sensitive CI assertion.