Repository navigation
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 October 4, 2026, 11:07 AM ET / 15:07 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR preserves literal syntax inside fenced code examples when web_fetch converts Markdown responses to text, with regression coverage for extraction and surrounding prose. Merge readiness✅ Ready for maintainer review This PR remains useful: current main still has the fenced-literal defect, and the refreshed Gateway before/after evidence supports the fix. No blocking correctness finding remains. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw's web_fetch tool retrieves web content and extracts readable text for agents. This change affects Markdown-to-text conversion before the existing output limits and untrusted-content wrapping. flowchart TD
A[Agent requests a page] --> B[Guarded HTTP fetch]
B --> C{Response format}
C --> D[Markdown text extraction]
D --> E[Protect code and convert prose]
E --> F[Normalize and restore literals]
F --> G[Limit and wrap external content]
G --> H[Agent receives tool result]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +13, Tests +51. Total +64 across 3 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep literal protection in the existing converter while preserving prose conversion, list separation, whitespace normalization, and output safety boundaries. Do we have a high-confidence way to reproduce the issue? Yes: current-main source clearly strips literal markers after removing fences, and the supplied Gateway before/after reports that exact failure. This reviewer did not execute a reproduction. Is this the best way to solve the issue? Yes: protecting literals inside the existing converter is a focused repair, and the refreshed comparison supports unchanged prose and list-boundary behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ab57310b7e87. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
@clawsweeper re-review Please review merged head |
|
🦞👀 Re-review progress:
|
|
Landed as 4a90ec6. Thanks @ly85206559! Maintainer note: a diagnostic command I ran by mistake performed the squash merge, so the commit on main has the placeholder subject and body fix(web-fetch): preserve code literals in text extraction (#164936) Related: #164692. Text-mode |
What Problem This Solves
Fixes: text-mode
web_fetchremoves comment markers, list syntax, links, and inline backticks from fenced code examples in Markdown responses.Related: #164692, whose landing note identified this separate fenced-code issue. Thanks to @ly85206559 for reporting and implementing the follow-up; the contributor's commits are preserved.
User Impact
User impact: agents reading documentation in text mode retain literal syntax inside fenced code examples. Ordinary Markdown prose still converts to text; Markdown mode, existing fence recognition, whitespace normalization, and size limits remain unchanged.
Why This Change Was Made
Protect fenced literals while converting prose, then restore them before the existing whitespace normalization. Escaped input NULs cannot be mistaken for temporary code markers. The branch now includes current main and #164692's LF/CRLF list-boundary fix.
No overlap with Pash/Sarah changes.
Evidence
Validated merged head
746af80caca566d13542e288d1cce96bd1754e15against frozen mainbb5656bf89e230bb3d6c9040b1e9b86df0306439in an isolated Docker container:web_fetchwithextractMode: "text"against a localtext/markdownpage. Main returnedcomment,item,ordered,link, andbackticksfrom the fenced example. The candidate returned the literal# comment,- item,1. ordered,[link](https://example.com), and inline backticks. Both kept surrounding prose and the paragraph/list blank line identical. The actual model-facing tool responses were compared, not a mocked converter result.web-fetch-utils.test.ts,web-fetch-visibility.tool-extraction.test.ts, andweb-fetch.cf-markdown.test.ts, including LF/CRLF boundaries and Markdown-mode controls. Command:node scripts/run-vitest.mjs <these three files> --maxWorkers=1 --retry=0; candidate wall time 22.05 seconds. Baseline stopped after the failing HTTP shard (21.49 seconds), then the converter file ran separately (2.25 seconds).pnpm build:docker; the candidate container's changed-source hashes match the worktree.gpt-5-minirequest through a passive proxy on the exact candidate head, reasoninglow, output budget 4096, HTTP 200, expected final reply received. No paid Firecrawl call.Not claimed: broader CommonMark/fence grammar support or exact code whitespace preservation beyond the existing normalization.