Skip to content

fix: preserve escaped-bang links in fetched text - #183532

Merged
obviyus merged 4 commits into
openclaw:mainfrom
zechen5:fix-web-fetch-escaped-image-markers
Oct 28, 2026
Merged

obviyus merged 4 commits into
openclaw:mainfrom
zechen5:fix-web-fetch-escaped-image-markers

Conversation

@zechen5

@zechen5 zechen5 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: web_fetch in text mode drops ordinary link text when an escaped exclamation mark immediately precedes the Markdown link, for example \![important](https://example.com).

User Impact

Users retain the literal exclamation mark and link label instead of silently losing that text. Shared text previews also retain the literal marker. Actual images, including those preceded by an even number of backslashes, keep their existing behavior. No configuration changes, migrations, or new dependencies.

Why This Change Was Made

Image detection now respects the parity of the backslash run before !. The change stays within the existing lossy text projection contract: it does not introduce general Markdown unescaping.

This is a small independently discovered bug. No matching issue or fix PR was found during the pre-submission duplicate checks.

Evidence

Exact-head built Gateway proof refresh

Current-main versus exact-head Linux Node 24.22.1 Gateway evidence: two baseline failures and two candidate fixes for escaped-bang links through authenticated /tools/invoke, with ordinary-link/image and even/odd-backslash controls. All 20 tool requests matched expectations. Existing Deepgram CI failure remains a separate hold; this is not a green-gate claim.

Final-head CI and exact-base attribution (October 28)

Run 40657429313 for 3f29c7549141a3e86a8f002a2539270b31a198ff finished failure: 111 jobs succeeded, 25 skipped, one test job failed, and the aggregate gate failed. The test-lines ratchet, all three Bun UI shards, and selected UI E2E passed. Other workflows on this head also reached terminal states without failures.

The remaining Deepgram failure is extensions/deepgram/audio-flux.test.ts → “keeps decoding, connection preparation, and transcription within one deadline,” timing out after 120,000 ms.

Exact base comparison: the CI checkout was synthetic merge 4573c5a82f98e9a776612d168919fcf1eee440fd, whose first parent is ac8c6616d58c49702e06055652382000b16daba9. Ran the same unmodified single-file command on each tree using Node 24.22.1, pnpm 12.15.0 and CI's pinned Bun 1.4.4-canary.1+191755ec1:

RAYON_NUM_THREADS=2 NODE_OPTIONS=--max-old-space-size=3072 \
  pnpm test extensions/deepgram/audio-flux.test.ts --maxWorkers=1
  • Synthetic merge: 1 failed, 9 passed; exact deadline assertion timed out at 120,000 ms (185.86 seconds wrapper wall time, including cold compilation).
  • Exact base, without this PR: 1 failed, 9 passed; same assertion and timeout (184.16 seconds wrapper wall time).
  • Deepgram sources, lockfile, and Bun pin are identical across this comparison. No Deepgram modifications or timeout/retry changes were made. This demonstrates the failure on the base without this patch; it does not establish the underlying cause or turn the failed CI gate green.
  • CI's automatic job-name classifier still says unknown, because its separate comparison main run had no matching job. The direct exact-base reproduction above is additional evidence, not a changed CI verdict.

The ClawSweeper review was refreshed on October 28 at 09:24 UTC for current head 3f29c7549141a3e86a8f002a2539270b31a198ff: 5/6, sufficient proof, and zero findings. It is ready for maintainer review, not cleared to merge: the required CI gate remains red. No merge or auto-merge has been performed.

Current head: test-budget repair on October 28

Head 3f29c7549141a3e86a8f002a2539270b31a198ff fixes the concrete test-lines gate from run 40655257135. That run ended with two failing jobs plus the aggregate gate: test-line growth (+10) and an unrelated extensions/deepgram/audio-flux.test.ts 120-second deadline-test timeout. All three Bun UI shards and the selected UI E2E job passed. At that point the Deepgram failure was unclassified (CI reports no matching main job); the final-head exact-base comparison above adds direct reproduction evidence.

Only the two regression fixtures changed:

  • Folded odd/even escaped-bang examples into the existing normal-link table case and real-HTTP Markdown/code fixture. Ordinary link/image controls and the complete fenced-code assertions remain; the HTTP fixture now also checks ordinary image omission.
  • No test-line ceiling change, unrelated deletion, matcher weakening, timeout/retry change, or production-code change. Net test-line delta is now zero.
  • Reproduced the ratchet failure locally before this change (exit 1, +10), then passed the same ratchet against 01d66c79… after consolidation (exit 0, net 0).
  • Verified the consolidated regressions still detect the defect: temporarily replacing only the production parser with main's version produced exactly one normalization failure and one real-HTTP extraction failure. Restoring the unchanged parity fix passed 39 normalization + 14 real-HTTP tests; those two shards took 66.20 seconds including worker rebuilding. The previously passing 56 utility tests and production typecheck apply unchanged; no full-suite claim.
  • Formatting, targeted type-aware lint for both modified test files, and whitespace checks passed. Independent AI static review confirmed the old controls and both new parity behaviors remain; no findings. This is not an autoreview certification.

The earlier ClawSweeper review covered 1ec4ef15…. A subsequent current-head review now covers 3f29c754… with zero findings and sufficient proof; its re-review request completed. Current-head CI remains separately blocked as recorded above.

Prior head: October 28 conflict repair and validation

Head 1ec4ef153fa85d555d8f8d86f3a6262b45de922b incorporates main 01d66c79ae4c518b355469797752e09e75a35ec6 without rewriting branch history. The only textual conflict was adjacent documentation additions: both the escaped-bang explanation and main's Readability line-boundary explanation are retained. The production parity change and both regression cases remain unchanged in intent; the diff is still four files, +19/-1.

  • 111 focused tests passed on the resolved tree: normalization (40), fetch utilities (56), and real HTTP tool extraction (15).
  • Normalization production typecheck, targeted type-aware lint, four-file formatting, and diff whitespace checks passed.
  • Used Node 24.22.1, a successful pnpm 12.15.0 frozen-lockfile installation, and the newly integrated main's pinned Bun openclaw-v1.4.4-20261026-191755ec11-webkit-b82bc917e9. The HTTP suite completed in 68.87 seconds including cold worker compilation. This is focused proof, not a full-suite or new shipped-Gateway claim.
  • Local review route: independent AI static review of all four changed files against main 01d66c79…, resolved tree 33e74315…; no blocking findings. Covered parity logic with the updated parser, both regression paths, and preservation of both documentation additions. Not an autoreview/ClawSweeper certification, full-repository review, or independent rerun of the test results above.

October 28 investigation of the earlier Bun UI failure

The failed UI job checked out synthetic merge ec08eaf1fae505f29aadf9c66e4f10e5a1dcb23d, merging head 36803f65… into dea6ff0cd0a3b4f3c65518167a4fac013ba742f6. The October 26 local comparison against 1206d801… below was not this exact CI base.

Replayed the logged compressed test selection with the repository's scripts/ci-run-node-test-shard.mts, bun-all, three workers, shard 2/3, and two-CPU affinity, on both the exact synthetic merge and its first-parent base. Both used the CI pin 1.4.4-canary.1+807211511, matching dependency lockfiles, and the existing non-isolated UI configuration.

  • On each side, all 66 non-browser files / 1,101 tests passed, including the original catalog-needed assertion.
  • Neither complete shard passed: five browser files could not run because Chromium's Unix socket was denied by this execution sandbox. Installing CI's Chromium 1248 returned truncated/non-ZIP downloads; the supported system-browser override selected Chromium 155 rather than CI's 156. A permission-tool attempt failed before command launch. The browser concurrency/load and restored CI transform cache were therefore not reproduced.
  • The original failing worker had run chat-pane-session-menu.test.ts immediately before cron-page.lifecycle.test.ts. A bounded same-Bun, non-isolated single-worker replay of that ordered pair passed 61 tests on each exact tree. This reduces, but does not eliminate, a simple predecessor-leak hypothesis.
  • UI source, test scripts, and lockfile have no changes between that base and synthetic merge. No UI/QA source or tests were changed, retries or timeouts loosened, or CI reruns requested.
  • The original UI failure remains unresolved. Passing replays are not a proven fix and do not establish that it is flaky. The prior CI gate remains failed for its own head; new-head CI must be evaluated independently.
  • pnpm test:ci-failed 183532 --json still cannot authenticate in this cloud workspace; exact run/job logs were inspected through the connected GitHub identity instead.

Focused current-tree commands:

pnpm test packages/normalization-core/src/markdown-plain-text.test.ts src/agents/tools/web-fetch-utils.test.ts --maxWorkers=1
RAYON_NUM_THREADS=2 NODE_OPTIONS=--max-old-space-size=3072 pnpm test src/agents/tools/web-fetch-visibility.tool-extraction.test.ts --maxWorkers=1
node scripts/run-tsgo.mjs -p packages/normalization-core/tsconfig.json --noEmit
OPENCLAW_LINT_TOOL=oxlint node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json packages/normalization-core/src/markdown-plain-text.ts packages/normalization-core/src/markdown-plain-text.test.ts src/agents/tools/web-fetch-visibility.tool-extraction.test.ts
pnpm exec oxfmt --check packages/normalization-core/src/markdown-plain-text.ts packages/normalization-core/src/markdown-plain-text.test.ts src/agents/tools/web-fetch-visibility.tool-extraction.test.ts docs/tools/web-fetch.md

Prior head: October 26 conflict resolution and revalidation

Head 36803f65f64931f7dd05681ee9fdec4ec473b18a merges main 1206d801b27738ff604cec4633779f84a1cb3b0e without rewriting branch history. Upstream consolidated the real-fetch fixtures in #183808; the escaped-bang regression now uses that response table. The production parity fix is unchanged, and no removed upstream tests were restored.

On this exact resolved tree:

  • 95 targeted tests passed: normalization (24), web-fetch utilities (56), and real HTTP tool extraction (15), including the escaped-bang link and actual-image control.
  • Normalization production typecheck, targeted type-aware lint, four-file formatting, and git diff --check passed.
  • The adapted real-HTTP file took 150.14 seconds including cold subprocess compilation (157.33 seconds wrapper wall time); its escaped-bang case took 14 ms. The first attempt failed before test collection with compiler exit 137. A serial run with RAYON_NUM_THREADS=2 and a 3 GiB Node heap passed; no assertions or timeouts were weakened.
  • Tests ran on Node 24.22.1 through pnpm 12.15.0. Dependencies were restored offline from the frozen lockfile using pnpm 11.25.0 after the pinned installer was interrupted; pnpm 12 offline reconciliation lacked registry metadata. No dependency or lockfile edits are included.
  • Independent review of the mechanical fixture adaptation found no concerns. The October 25 shipped-Gateway transcript below is prior-head evidence, not a new Gateway run or full-suite claim. New-head CI must be evaluated separately.
OPENCLAW_VITEST_RUNTIME=node pnpm test packages/normalization-core/src/markdown-plain-text.test.ts src/agents/tools/web-fetch-utils.test.ts --maxWorkers=1
OPENCLAW_VITEST_RUNTIME=node RAYON_NUM_THREADS=2 NODE_OPTIONS=--max-old-space-size=3072 pnpm test src/agents/tools/web-fetch-visibility.tool-extraction.test.ts --maxWorkers=1
node scripts/run-tsgo.mjs -p packages/normalization-core/tsconfig.json --noEmit
OPENCLAW_LINT_TOOL=oxlint node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json packages/normalization-core/src/markdown-plain-text.ts packages/normalization-core/src/markdown-plain-text.test.ts src/agents/tools/web-fetch-visibility.tool-extraction.test.ts
pnpm exec oxfmt --check packages/normalization-core/src/markdown-plain-text.ts packages/normalization-core/src/markdown-plain-text.test.ts src/agents/tools/web-fetch-visibility.tool-extraction.test.ts docs/tools/web-fetch.md
git diff --cached origin/main --check

Prior head: October 26 exact-head CI follow-up

CI run 40356261884 for 36803f65f64931f7dd05681ee9fdec4ec473b18a finished failure: 106 jobs succeeded, 25 skipped, two test jobs failed, and the aggregate CI gate failed. This is not a green-CI claim.

  • QA coverage failure: extensions/qa-lab/src/coverage-report.test.ts:213, “groups scenario coverage metadata by theme and surface,” expected false but received true. Local single-file runs on both this head and base 1206d801b27738ff604cec4633779f84a1cb3b0e reproduced the identical assertion (36 passed, 1 failed on each). This is demonstrated base behavior. The CI classifier called it unknown because main had no matching job name.
  • UI failure: ui/src/pages/cron/cron-page.lifecycle.test.ts, “preserves catalog provider identity through model selection and save (catalog-needed),” expected a non-null element. Both head and base subsequently passed the isolated file locally (31 tests each). The comparison main job also passed the exact assertion, but used a larger test scope. CI classified this as new at job level, explicitly without comparing selected scope. Its cause remains unresolved; these isolated passes do not prove a flake or excuse the failed gate.
  • No unrelated UI/QA changes, CI reruns, or extra pushes were made. pnpm test:ci-failed 183532 --json could not authenticate because this cloud workspace has no GitHub CLI login; logs and exact-head status were read through the connected GitHub identity instead.

Local comparison commands (same existing dependency installation; Node 24.22.1, serial worker, 3 GiB heap):

pnpm test extensions/qa-lab/src/coverage-report.test.ts --maxWorkers=1
pnpm test ui/src/pages/cron/cron-page.lifecycle.test.ts --maxWorkers=1

Original fix validation

Validated on base 192947deb5f3ab9454e614dd520bbdde3ba90d40 on October 25, 2026:

  • Before the fix, the new normalization regression failed with 23 existing cases passing.
  • A real HTTP fixture through createWebFetchTool.execute reproduced the lost link label: the new regression failed while 17 controls passed.
  • After the fix, 162 targeted tests passed across six files: normalization (24), web-fetch utilities (57), real web-fetch execution (18), session cut-content (5), gateway projection (25), and ClawHub source handling (33).
  • Production normalization-package typecheck, formatting for all four changed files, and git diff --check passed.
  • Independent manual review found no issues, including odd/even backslash counts 0–64 and nested/adjacent links.

Shipped Gateway entry-point proof

On October 25, 2026 at 11:46:34 UTC, the compiled CLI at head b48f9a21179aadb781f609ac253c4041708c58d2 was run as a separate foreground Gateway process, not an in-process test harness. The source CLI build and pnpm openclaw --help completed before the run (Node 24.22.1, pnpm 12.15.0).

  • Temporary isolated state, token authentication, loopback binding, and an exact loopback-host fetch exception.
  • Only web_fetch allowed; channels, plugins, schedulers, and browser sidecars disabled. No model API credentials or LLM inference.
  • A separate HTTP fixture served Content-Type: text/markdown.
  • The authenticated production POST /tools/invoke route invoked web_fetch with extractMode: "text".
  • The Gateway and fixture were stopped after the successful assertion. Temporary addresses, port values, and authentication details are omitted below.

Redacted terminal transcript (the body line is the returned content inside OpenClaw's external-content wrapper):

$ pnpm openclaw gateway run --bind loopback --port <temporary-port> --auth token
$ POST <loopback-gateway>/tools/invoke
{"tool":"web_fetch","args":{"url":"<loopback-fixture>/markdown-escaped-bang","extractMode":"text","maxChars":5000}}

Fixture (text/markdown):
Read \![important](https://example.com) and \\![diagram](image.png).

HTTP 200
ok: true
contentType: text/markdown
extractMode: text
extractor: cf-markdown
fetchedAt: 2026-10-25T11:46:34.173Z
returned body:
Read \!important and \\.

PASS: escaped-bang link label retained; actual-image label omitted.
Temporary Gateway and fixture stopped.

The remaining backslashes are intentional under the existing lossy projection contract; this change does not introduce general Markdown unescaping.

Prior-head upstream CI

CI run 40189213207 completed with failures on the merge of this head and base 60c3a7c35283dd6377baff1e6ab137d1e0e96c0d. Three test shards failed with four assertions in sessions-create-thinking-claim.test.ts, close-wedge.test.ts, and session-accessor.sqlite-session-row.test.ts. These files are outside this patch. The targeted comparison below reproduces three of the four assertions on the base; the remaining failure is unclassified. No all-green CI claim is made.

Targeted CI failure comparison

On October 25, 2026, separate source trees for PR head b48f9a21179aadb781f609ac253c4041708c58d2 and CI base 60c3a7c35283dd6377baff1e6ab137d1e0e96c0d were tested with Node 24.22.1, pnpm 12.15.0, Vitest 5.0.5, and one worker:

  • src/gateway/server-methods/sessions-create-thinking-claim.test.ts: head 3 passed, base 3 passed. The CI assertion at line 202 remains unclassified.
  • src/state/openclaw-agent-execution.close-wedge.test.ts: head 10 passed; base 8 passed, 2 failed at lines 438 and 496. The base reproduces the CI signatures: expected an AggregateError cause but received SQLite worker exited with code 3; expected aggregated cleanup cause but received the bare synthetic-unavailable error.
  • src/config/sessions/session-accessor.sqlite-session-row.test.ts: head 8 passed; base 7 passed, 1 failed at line 147, matching CI's expected 4 to be less than or equal to 3.

These three assertion failures reproduce on the base without this patch. This local comparison used Node, whereas CI used its pinned Bun runtime on the synthetic merge; it is not proof that the remaining CI failure is flaky, and it does not replace green upstream CI.

OPENCLAW_VITEST_RUNTIME=node pnpm test \
  src/state/openclaw-agent-execution.close-wedge.test.ts \
  src/gateway/server-methods/sessions-create-thinking-claim.test.ts \
  src/config/sessions/session-accessor.sqlite-session-row.test.ts --maxWorkers=1
# Head: 21 passed across 3 files.
# Base stopped after the failed infra shard; ran the remaining file separately:
OPENCLAW_VITEST_RUNTIME=node pnpm test \
  src/config/sessions/session-accessor.sqlite-session-row.test.ts --maxWorkers=1
# Base combined: 18 passed, 3 failed across 3 files.

Prior-head validation limits

Type-aware lint did not complete. An initially broad declaration-generation command was interrupted; the core-config retry stopped at a retained artifact lock whose detached child completion could not be verified. The lock was left untouched. The first combined green test command also hit a subprocess build exit 137; the real-tool suite subsequently passed when rerun alone. No full-repository test pass is claimed.

The automated autoreview helper was not run because its additional reviewer would exceed this task's two-agent limit. A separate manual review was performed; no automated clean certification is claimed.

Validation commands
OPENCLAW_VITEST_RUNTIME=node pnpm test packages/normalization-core/src/markdown-plain-text.test.ts src/agents/tools/web-fetch-visibility.tool-extraction.test.ts src/agents/tools/web-fetch-utils.test.ts --maxWorkers=1
# 24 normalization + 57 utility tests passed; tool subprocess build failed.
# Serial tool rerun:
OPENCLAW_VITEST_RUNTIME=node pnpm test src/agents/tools/web-fetch-visibility.tool-extraction.test.ts --maxWorkers=1
# 18 passed.
OPENCLAW_VITEST_RUNTIME=node pnpm test src/config/sessions/session-message-cut-content.test.ts src/gateway/session-display-projection.test.ts src/claws/clawhub-source.test.ts --maxWorkers=1
# 63 passed.
node scripts/run-tsgo.mjs -p packages/normalization-core/tsconfig.json --noEmit
pnpm exec oxfmt --check packages/normalization-core/src/markdown-plain-text.ts packages/normalization-core/src/markdown-plain-text.test.ts src/agents/tools/web-fetch-visibility.tool-extraction.test.ts docs/tools/web-fetch.md
git diff --check

AI assistance: this fix was discovered, implemented, tested, and independently reviewed with OpenAI AI assistance. The validation statements above distinguish completed checks from blocked checks.

Respect odd/even backslash parity before image markers so ordinary link labels are not omitted. Cover the normalization owner and real web_fetch execute path, retaining actual-image handling.
@clawsweeper

clawsweeper Bot commented Oct 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 docs Improvements or additions to documentation agents Agent runtime and tooling size: XS labels Oct 25, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment 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-environment Preliminary submission classification; full source review pending. labels Oct 25, 2026
@clawsweeper

clawsweeper Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR preserves Markdown link labels when an escaped exclamation mark precedes the link.

Example: Fetch Read \![important](https://example.com). with extractMode: "text".

  • Before: Read .
  • After: Read !important.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, correct repair with exact-head shipped-entry-point proof and useful consolidated regressions; the separate red CI gate remains enforced.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Exact-head Linux Node 24.22.1 builds exercised registered web_fetch through authenticated /tools/invoke in separate isolated Gateways against a real Markdown HTTP server; escaped and three-backslash links retained labels, with ordinary-link and actual-image controls unchanged. The downloaded sidebar screenshots concern historical preview behavior and were not used as proof of this correction.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Text-mode web_fetch silently drops an ordinary link label when an escaped exclamation mark immediately precedes it.
Reason: The change restores readable content within the established lossy projection contract while preserving the separate preview and web image policies.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR fixes a current text-extraction bug with a focused shared-parser change and no actionable correctness findings; the required CI gate remains red.

Priority: P2
Reviewed head: 3f29c7549141a3e86a8f002a2539270b31a198ff

Before merge

None.

Findings

None.

Agent review details

How this fits together

Fetched Markdown passes through the web text converter and shared inline-link parser before reaching the agent; session previews also consume that parser with a different image policy.

flowchart TD
  A[Markdown HTTP response] --> B[web_fetch]
  B --> C[Markdown text converter]
  C --> D[Shared inline link parser]
  E[Session preview flattener] --> D
  D --> F[Readable text]
Loading

Technical review

Best possible solution:

Retain the parity correction in the shared parser and land it through the repository’s required CI or authorized inherited-failure path.

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

Current-main source deterministically omits the escaped-bang link as an image, and the supplied baseline Gateway trace confirms that result; this read-only review executed no target code.

Is this the best way to solve the issue?

The existing parser is the correct owner, and toggling image classification for each preceding backslash fixes the defect without another parser, option, or general unescaping policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9634a5298af2.

Provenance checked

  • Shared inline-link classification keeps the original intent (e73028f: The balanced-link parser preserves labels and surrounding prose without leaking nested destination syntax.)
  • Web extraction image omission keeps the original intent (9c39447: Web text omits actual images while previews retain image labels through the same parser.)
  • Consolidated HTTP regression fixtures keeps the original intent (6cd7f8c: Consolidate repeated fixtures while preserving distinct content-fidelity contracts.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • AmelioMansour: Raw commit 9c39447 adds packages/normalization-core/src/markdown-plain-text.ts:151 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9c3944759f73; files: packages/normalization-core/src/markdown-plain-text.ts)
  • Jay Zhou: Raw commit e73028f adds packages/normalization-core/src/markdown-plain-text.ts:152 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e73028f81cda; files: packages/normalization-core/src/markdown-plain-text.ts)
  • Peter Steinberger: Raw commit 9a947e4 adds packages/normalization-core/src/markdown-plain-text.ts:9 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9a947e4bb8d0; files: packages/normalization-core/src/markdown-plain-text.ts)

PR surface

Source +6, Tests 0, Docs +2. Total +8 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 7 1 +6
Tests 2 5 5 0
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 14 6 +8

Labels

Label changes:

No label changes.

Label justifications:

  • P2: A narrow Markdown input silently loses useful fetched text, with no demonstrated broader workflow outage.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-25T10:58:49.884Z sha b48f9a2 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-28T08:20:06.873Z sha 1ec4ef1 :: needs maintainer review before merge. :: none

Reviewed October 28, 2026, 5:24 AM ET / 09:24 UTC (Revision 3).

@zechen5
zechen5 marked this pull request as ready for review October 25, 2026 11:31
Preserve the upstream unified response table and port the escaped-bang
regression into it without changing the production fix.
@clawsweeper clawsweeper Bot removed 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. labels Oct 27, 2026

zechen5 commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 28, 2026
@obviyus

obviyus commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

Exact-head shipped Gateway proof

Candidate: 3f29c7549141a3e86a8f002a2539270b31a198ff
Current-main baseline: eba63b90fe0da45aecbc75accc50633934d3f07f

Both complete builds succeeded with Node 24.22.1 in secretless Linux Docker. Each built CLI started a separate isolated Gateway with explicit profile/config/state and token authentication. Binary-resolved config and agent database paths were checked before startup. No paid keys, model calls, parser mocks, or direct helper invocation were used.

A local HTTP server returned actual text/markdown documents. The authenticated production POST /tools/invoke endpoint invoked the registered web_fetch tool with extractMode: "text". Fixture access used the existing exact-host SSRF exception, with cache TTL zero and a distinct URL per invocation.

Observed terminal summary (each row repeated twice on each build, 20 tool invocations total):

case       HTTP  extractor    main body             candidate body
escaped    200   cf-markdown  Read \.               Read \!important.
ordinary   200   cf-markdown  Read ordinary guide.   Read ordinary guide.
image      200   cf-markdown  Read .                Read .
even       200   cf-markdown  Read \\.              Read \\.
odd-three  200   cf-markdown  Read \\\.             Read \\\!third label.

Triggering fixture:

Read \![important](https://example.com).

Controls included a normal link, a normal image, an image preceded by two backslashes, and a link preceded by three backslashes. Both main attempts lost the valid escaped-bang link label; both candidate attempts retained it. Ordinary-link preservation and actual-image omission were unchanged. Every expected-result assertion passed, and the fixture recorded all 20 network requests. Gateways and fixture processes were stopped afterward.

The existing contributor regressions already cover this owner and real-HTTP extraction boundary, with net test-line delta 0. No source or test changes were needed for this proof refresh; the parity fix remains at the shared stripInlineLinks owner. Simplification review retained the eight-line parity repair and existing consolidated fixtures; no additional implementation was introduced.

CI remains a separate hold

The exact-head CI gate is currently red: run 40657429313, Deepgram job, audio-flux.test.ts deadline case. The PR body's existing exact-synthetic-merge/first-parent comparison records the same 120-second failure without this patch. I did not rerun that reported failure merely to reconfirm it, and this Gateway proof does not turn the CI gate green. One separate PR context and evidence check is cancelled; no product-test cancellation is being treated as passing.

Merge danger: two-way door; reverting restores prior extraction behavior without stored-state or schema changes. Blast radius is shared Markdown-to-text consumers, especially web_fetch text mode; ordinary image and link behavior was controlled above. No merge or CI rerun was performed.

@obviyus

obviyus commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@obviyus

obviyus commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

The inherited Deepgram failure is now attributed to the monotonic-clock sweep in #186484, not this escaped-bang patch. Five complete-file runs passed before the sweep; all five failed at the sweep and all five failed on pinned current main. The deadline test faked Date/timers without performance.now(). Maintainer repair #186679 adds performance to that existing fake list; all ten tests pass in three complete-file runs. Production deadline enforcement is unchanged. Exact-head review and CI for the repair are pending; this does not change the red gate on this PR. Matrix: #186679 (comment)

@obviyus

obviyus commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

Maintainer override:

The only red job is checks-node-changed-extensions-bundle-1 (run 40657429313, job 122735218781, also red on the first attempt in job 122712419709): extensions/deepgram/audio-flux.test.ts "keeps decoding…" times out. This PR doesn't touch Deepgram. The cause was main's monotonic sweep bf10fbe (#186484): the test file failed 5 of 5 runs on main 326ad6a and on bf10fbe, and passed 5 of 5 on a3b12ef before the sweep. #186679 fixes it on main. Matrix and cause: #186679 (comment). The exact-head review is 5/6 with no findings.

@obviyus
obviyus merged commit 4b4c689 into openclaw:main Oct 28, 2026
356 of 363 checks passed
@obviyus

obviyus commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

Landed in 4b4c689. Thanks @zechen5. web_fetch now keeps link text that starts with an escaped bang.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 29, 2026
fix(web-fetch): keep links whose text starts with an escaped bang

web_fetch's Markdown cleanup treated a link written as \![label](url) as an image marker and dropped the label, so fetched pages lost link text. An escaped bang (an odd number of backslashes) now stays a plain link; real images and even-backslash images are unchanged.

Evidence: built Gateway, authenticated /tools/invoke with the registered web_fetch tool, and real HTTP Markdown fixtures. Main lost the escaped-bang link label (twice); with this change it was kept (twice). Ordinary links, ordinary images, even-backslash images and three-backslash links behave as expected across all 20 calls. Details: openclaw#183532 (comment).

Thanks @zechen5.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS 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.

2 participants