Skip to content

fix: antml:/mm: namespaced tool-call XML leaks into chat replies (#97750) - #97845

Closed
Jerry-Xin wants to merge 6 commits into
openclaw:mainfrom
Jerry-Xin:fix/antml-toolcall-leak-97750
Closed

Jerry-Xin wants to merge 6 commits into
openclaw:mainfrom
Jerry-Xin:fix/antml-toolcall-leak-97750

Conversation

@Jerry-Xin

@Jerry-Xin Jerry-Xin commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

Closes #97750

What Problem This Solves

Some deployments serve a Claude/MiniMax model through a proxy that intermittently degrades a native tool_use block into plain text. In that degraded case the tool call arrives as the namespaced attribute dialect — <invoke name="tool"><parameter name="x">v</parameter></invoke> prefixed with antml: or mm:, and/or wrapped in <function_calls>...</function_calls>.

On current main two gaps remained:

  1. The visible-text sanitizer recognized the antml: prefix but not the mm: prefix, so a degraded mm:invoke block leaked verbatim into the user-visible reply.
  2. The persist-path stripper (packages/tool-call-repair stripPlainTextToolCallBlocks) did not recognize the attribute-dialect invoke at all, so an unfenced standalone degraded invoke block was written into the durable done.message instead of being scrubbed.

A follow-up review then surfaced a P1 code-region regression: the shared code-region detector was a flat scanner that only opened an indented code block when the nearest non-blank predecessor line was itself unindented. That heuristic misfired for valid indented code nested under a CommonMark list container whose content indent was ≥ 4 columns, so a qualified antml:/mm:/<function_calls> invoke example placed in such nested code was treated as prose by the downstream visible-text and persistence scrubbers and silently removed from both delivered replies and persisted assistant history.

Why This Change Was Made

The degraded tool call should never reach the user, and it must not be persisted into session state either — but a legitimate <invoke> XML example must be preserved, not deleted. Two kinds of legitimate example matter: fenced/inline code spans, and a bare (un-namespaced, unwrapped) standalone <invoke> block written as plain prose content.

Because the reported degradation only ever carries a provider-owned signature — an antml:/mm: namespace or a <function_calls> wrapper — the scrubber is scoped to exactly those qualified forms. A bare, un-namespaced, unwrapped <invoke> block carries no degradation signature and is therefore treated as legitimate content and preserved on both the visible-delivery and persisted-history paths. This keeps the change inside the actual scope of #97750 (namespaced/proxy-degraded leaks) and avoids an over-broad content-removal policy on durable transcripts, where a false positive would be unrecoverable. This mirrors the pre-existing sibling stripper stripToolCallXmlTags, which likewise only enumerates the antml:/mm: namespaces and never removes a bare invoke.

Scope of the net delta that still reproduces on main:

  • Visible text (assistant-visible-text.ts): mirror the existing antml: handling for the mm: namespace in the tag-name scan, quick-check, and payload-start patterns. The <function_calls>-wrapped case is scrubbed by the package strip stage in the delivery pipeline.
  • Persist path (packages/tool-call-repair): a dedicated linear scanner recognizes a standalone invoke block and classifies it. It returns complete only when the block is namespace-qualified (antml:/mm:) or <function_calls>-wrapped; a bare unqualified block returns none (preserved). On an unterminated open it returns incomplete so the strip loop bails and preserves the remainder, keeping the scan linear on adversarial input.
  • Code-region awareness (canonical CommonMark): findCodeRegions / isInsideCode / CodeRegion now live in @openclaw/markdown-core as a dedicated code-regions subpath adapter over the canonical findMarkdownCodeSpans (mdast). The prior flat scanner in normalization-core — which could not resolve container-relative indentation — has been deleted (a leaf package cannot import markdown-core without cycling, which is why the flat scanner was inlined there in the first place). tool-call-repair now depends on markdown-core directly (tool-call-repair → markdown-core → normalization-core stays acyclic; pnpm check:import-cycles and pnpm check:madge-import-cycles both report 0 cycles). src/shared/text/code-regions.ts re-exports the adapter so every existing caller sees the identical CodeRegion shape; the plugin-SDK surface is preserved (regenerated via scripts/generate-plugin-sdk-api-baseline.ts).
  • Reasoning-progress streaming hot-path gate: src/channels/progress-draft-status-text.ts calls the code-region detector on accumulated reasoning text. To avoid paying full mdast parsing on chunks that carry no reasoning tag at all, the three progress helpers now short-circuit on a cheap REASONING_PROGRESS_TAG_RE.test(text) gate before invoking findCodeRegions. On a 17 KB no-tag reasoning-progress sample this took normalizeReasoningProgressLine from 965 ms → 17 ms (200 iterations), formatReasoningProgressDisplayLine from 1706 ms → 62 ms, and mergeReasoningProgressText from 44 ms → 1 ms (measured locally).
  • Plugin SDK contract preserved: the exported stripPlainTextToolCallBlocks stays strict by default for its scrub-region behavior, with code-aware behavior available only via the explicit { preserveCodeRegions: true } opt-in.

Non-goals/boundaries: the native Anthropic/DSML transports are untouched; no runtime fallback execution from sanitized text is introduced; the equals dialect (<function=...>/<parameter=...>), bracket, and Harmony paths are unchanged; the invoke dialect is recognized only by the strip/sanitize paths (never promoted to an executable call and never wired into the stream-buffering scanner).

User Impact

Users on proxied Claude/MiniMax routes no longer see raw namespaced (antml:/mm:) or <function_calls>-wrapped invoke tool-call XML in their replies, and the leaked block is no longer written into the persisted message (no session-state content loss). Legitimate <invoke> XML examples are preserved rather than stripped on both the visible and persisted paths — inside code fences/inline code, inside indented code blocks nested under CommonMark list containers whose content indent is ≥ 4 columns (the reachable P1 case), inside single-level list indented code, and as a bare, un-namespaced, unwrapped standalone block in plain prose. A resolved-review audit also removed an O(n²) worst case on the persist strip path, so adversarial degraded text cannot cause pathological CPU use. The reasoning-progress streaming hot path no longer pays full mdast parsing on chunks that carry no reasoning tag.

Evidence

Focused regression tests cover the sanitiser and code-region boundary at every layer that owns the contract:

  • packages/tool-call-repair/src/payload.test.ts: qualified invoke-dialect scrub variants (antml:/mm:, function_calls wrapper, self-closing, zero-param), bare-survives cases (multi-parameter, self-closing, zero-parameter, and under a strict predicate), code-region preservation vs. unfenced qualified scrub, a linear-time guard against many unterminated opens, nested-list code preservation (real reachable P1 case), blockquote-list continuation preservation, single-level-list preservation, blockquote invariant lock, and negative over-preserve guards (plain-paragraph 4-space continuation, tight-list lazy continuation, loose-list non-code continuation).
  • src/shared/text/assistant-visible-text.test.ts: the mm:invoke/mm:parameter visible-text scrub case (parallel to the existing antml: case), plus bare-survives regressions on both the delivery and history/persisted profiles, and the nested-code positive / negative-over-preserve pair.
  • src/agents/embedded-agent-utils.test.ts: a bare unfenced <invoke> example is preserved verbatim by extractAssistantText ([Bug]: Anthropic antml: namespaced tool-call XML leaks into visible content (and fails the turn) when proxy degrades tool_use to text #97750 preservation contract).
  • packages/markdown-core/src/code-regions.test.ts: direct adapter coverage — fenced (incl. markers), inline (incl. backticks), doc-start 4-space, indent-after-blank, paragraph-continuation, leading tab, interior/trailing blank exclusion, and a nested-container positive case.

Real-behavior proof (before = main sanitize/strip; after = this branch head), driving the ACTUAL sanitizeAssistantVisibleText and stripPlainTextToolCallBlocks on the reported leak shapes:

=== BEFORE (main) ===
A2 mm-visible       => "Working on it.\n<mm:invoke name=\"get_weather\">\n<mm:parameter name=\"city\">Paris</mm:parameter>\n</mm:invoke>"
A3 wrapped-visible  => "Done.\n<function_calls>\n<invoke name=\"get_weather\">\n<parameter name=\"city\">Paris</parameter>\n</invoke>\n</function_calls>"
C1 persist-mm       => "Here you go.\n<mm:invoke name=\"get_weather\">\n<mm:parameter name=\"city\">Paris</mm:parameter>\n</mm:invoke>"
D1 bare-visible     => "Example:\n<invoke name=\"Bash\">\n<parameter name=\"command\">ls</parameter>\n</invoke>"   (leaked/undecided on main)
B1 persist-fenced   => "...```xml\n<invoke ...>...\n```..."   (preserved)

=== AFTER (this branch) ===
A2 mm-visible       => "Working on it."
A3 wrapped-visible  => "Done."
C1 persist-mm       => "Here you go.\n"
D1 bare-visible     => "Example:\n<invoke name=\"Bash\">\n<parameter name=\"command\">ls</parameter>\n</invoke>"   (preserved — bare is legitimate content)
B1 persist-fenced   => "...```xml\n<invoke ...>...\n```..."   (still preserved)

Nested-Markdown code-region proof (before = flat scanner in normalization-core; after = canonical mdast adapter in @openclaw/markdown-core/code-regions), driving the ACTUAL findCodeRegions and stripPlainTextToolCallBlocks on the persist path:

=== CASE A: 3-level nested list, indented invoke (the real reachable P1 case) ===
input:
  See a nested-list code example:

  1. Outer
     - Middle
       - Inner

             <invoke name="read"><parameter name="path">x</parameter></invoke>

  Back to prose.

BEFORE (flat scanner):
  findCodeRegions => []
  stripPlainTextToolCallBlocks => the qualified invoke line is scrubbed as prose (data loss)

AFTER (mdast adapter, this branch head):
  findCodeRegions => [{start:75,end:156}]
  stripPlainTextToolCallBlocks => text preserved unchanged

=== CASE B: list container with a >=4-column indented continuation before code ===
BEFORE: regions => [], persist stripped
AFTER : regions => [{start:63,end:146}], persist preserved

=== CASE C: single-level list indented code (already-working guard) ===
AFTER : regions => [{start:30,end:111}], persist preserved

=== CASE D: blockquote invariant lock (unreachable-by-scrubber, still preserved) ===
AFTER : regions => [{start:23,end:104}], persist preserved
Note (matches the code comment in the test): the persist scrubber's block scan
requires a `<` at the first non-space/non-tab column (via `skipLineIndentation`
which skips only spaces/tabs, not `>`). Blockquote lines start with `>`, so a
qualified invoke in a blockquote is unreachable. Any future scrubber change
that begins consuming `>` MUST re-check code detection.

=== NEGATIVE E: plain paragraph + 4-space continuation ===
AFTER : regions => [], persist SCRUBBED (as expected)

=== NEGATIVE F: tight-list lazy continuation ===
AFTER : regions => [], persist SCRUBBED (as expected)

Perf gate proof (before = mdast on every chunk; after = cheap REASONING_PROGRESS_TAG_RE.test() gate first), 200 iterations on a 17 KB no-tag reasoning-progress sample driving the actual functions:

BEFORE: normalizeReasoningProgressLine=965.5 ms, formatReasoningProgressDisplayLine=1705.5 ms, mergeReasoningProgressText=44.1 ms
AFTER : normalizeReasoningProgressLine= 17.2 ms, formatReasoningProgressDisplayLine=  62.2 ms, mergeReasoningProgressText= 1.1 ms

Correctness of the gate: REASONING_PROGRESS_TAG_RE is the single source of truth for which tags matter on the reasoning-progress path; if .test() reports no match, there is nothing to strip and nothing to gate against code regions, so findCodeRegions is redundant work. The three helpers reset lastIndex before and after the gate to avoid stateful regex leakage.

Verification suite on this branch head:

  • node scripts/run-vitest.mjs packages/tool-call-repair/src/payload.test.ts → 46 tests pass.
  • node scripts/run-vitest.mjs src/shared/text/assistant-visible-text.test.ts → 124 tests pass.
  • node scripts/run-vitest.mjs packages/markdown-core → 25 files / 261 tests pass.
  • node scripts/run-vitest.mjs src/channels/progress-draft-lines.test.ts → 3 tests pass.
  • node scripts/run-vitest.mjs src/channels/progress-draft-compositor.test.ts → 40 tests pass.
  • pnpm tsgo:core → exit 0.
  • pnpm tsgo:core:test → exit 0.
  • pnpm check:import-cycles → 0 runtime value cycles.
  • pnpm check:madge-import-cycles → 0 cycles.

O(n²) audit fix: a resolved-review pass measured the persist strip degrading quadratically on adversarial input with many unterminated invoke opens (720 KB ≈ 977 ms, scaling to seconds for a few MB). Making the scanner bail on incomplete (mirroring the existing unterminated-candidate bail) brought the same 720 KB input to ≈ 0.8 ms and restored linear scaling; a regression test locks this.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: L labels Jun 29, 2026
@clawsweeper

clawsweeper Bot commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 2, 2026, 2:26 AM ET / 06:26 UTC.

ClawSweeper review

What this changes

The branch adds sanitization for proxy-degraded antml:/mm: invoke XML in delivered and persisted assistant text, while moving Markdown code-region detection behind a markdown-core adapter.

Merge readiness

⚠️ Needs maintainer review before merge - 7 items remain

This PR still addresses a real current-main gap: visible-text handling accepts antml: but not mm:, and the plain-text repair stripper does not recognize invoke-dialect blocks. However, it is dirty against current main and its stale SDK wrapper would discard the newer protected-range API that preserves literal Markdown examples, so it needs a rebase and compatibility repair before merge.

Priority: P1
Reviewed head: 6e29fbf1e861bf65a83465709ce7506ec130b721
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The behavior proof is strong, but the stale branch currently conflicts with a new public compatibility contract and needs a maintainer decision on its package edge.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The PR body provides before/after terminal output from the actual sanitizer and persistence-strip functions for the reported leak shapes, and the provided check context includes a successful real-behavior-proof run.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body provides before/after terminal output from the actual sanitizer and persistence-strip functions for the reported leak shapes, and the provided check context includes a successful real-behavior-proof run.
Evidence reviewed 6 items Current visible-text gap: Current main recognizes only the optional antml: namespace in the tool-call quick check and payload-start matcher; mm:invoke is not a recognized tag form, so the reported MiniMax namespace remains outside this sanitizer path.
Current persistence-path gap: Current main's full-line plain-text stripping prefilter only enters for bracket, Harmony, or &lt;function= forms, not standalone invoke-dialect XML, leaving the reported durable-message path unhandled.
New public compatibility contract on main: Current main added the public PlainTextToolCallStripOptions.resolveProtectedRanges option and forwards it to tool-call repair so callers can preserve literal code regions.
Findings 1 actionable finding [P1] Preserve the protected-range SDK option on rebase
Security Needs attention Authorize the workspace dependency graph change: Adding @openclaw/markdown-core to tool-call-repair changes package resolution and the lockfile; repository automation blocks this external graph change until an authorized owner approves the rebased head.

How this fits together

Model output flows through shared visible-text and tool-call-repair sanitizers before OpenClaw delivers messages to channels and records assistant text in session history. Markdown code-region detection tells those sanitizers which tool-shaped text is a literal example rather than leaked control markup.

flowchart LR
  ModelOutput[Model output] --> VisibleText[Visible-text sanitizer]
  ModelOutput --> PersistStripper[Persisted-message stripper]
  VisibleText --> CodeRegions[Markdown code-region detector]
  PersistStripper --> CodeRegions
  VisibleText --> DeliveredReply[Channel reply]
  PersistStripper --> SessionHistory[Assistant history]
Loading

Decision needed

Question Recommendation
Should this PR be allowed to add the tool-call-repair to markdown-core workspace dependency after rebasing, or should the same repair be reshaped to avoid a dependency-graph change? Approve the canonical ownership move: After the contributor rebases and preserves the protected-range API, authorize the exact rebased head's workspace dependency because markdown-core owns the CommonMark interpretation.

Why: The behavior fix is needed, but repository policy blocks an external manifest and lockfile graph change; only maintainers can decide whether the ownership move is acceptable.

Before merge

  • Preserve the protected-range SDK option on rebase (P1) - Current main added PlainTextToolCallStripOptions.resolveProtectedRanges and core callers now use it to preserve literal Markdown examples. This branch's strict one-argument wrapper would remove that supported contract when resolving the dirty merge; retain and forward the option instead of forcing an always-false predicate. This became visible after the August 1, 2026 current-main change.
  • Resolve security concern: Authorize the workspace dependency graph change - Adding @openclaw/markdown-core to tool-call-repair changes package resolution and the lockfile; repository automation blocks this external graph change until an authorized owner approves the rebased head.
  • Resolve merge risk (P1) - Rebasing without retaining resolveProtectedRanges would break current core and plugin callers that preserve code-fence examples, and would reintroduce message/history content loss on those paths.
  • Resolve merge risk (P1) - The new tool-call-repair → markdown-core workspace dependency and lockfile change remain an externally submitted dependency-graph change requiring explicit authorization for the rebased head.
  • Resolve merge risk (P1) - The branch is currently dirty against main; its compatibility and focused proof need to be rerun on the resolved merge result rather than the July 31 head.
  • Complete next step (P2) - A maintainer must decide whether to authorize the new workspace dependency; after that, the contributor needs a rebase that preserves the current public protected-range contract.

Findings

  • [P1] Preserve the protected-range SDK option on rebase — src/plugin-sdk/tool-payload.ts:43-48
  • [low] Authorize the workspace dependency graph change — packages/tool-call-repair/package.json:10
Agent review details

Security

Needs attention: No new third-party package is introduced, but the external PR changes a workspace manifest and lockfile dependency graph that requires exact-head authorization.

PR surface

Source +319, Tests +391, Config +7, Generated 0, Other +3. Total +720 across 19 files.

View PR surface stats
Area Files Added Removed Net
Source 9 434 115 +319
Tests 5 396 5 +391
Docs 0 0 0 0
Config 3 7 0 +7
Generated 1 2 2 0
Other 1 3 0 +3
Total 19 842 122 +720

Review metrics

Metric Value Why it matters
Public strip API 1 current SDK option must be retained Current main exposes one protected-range option and multiple core callers use it to preserve literal tool-shaped Markdown examples.
Workspace dependency 1 dependency added The proposed tool-call-repair → markdown-core edge changes the manifest and lockfile graph, which repository automation requires maintainers to authorize.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/shared/text/assistant-visible-text.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #97750
Summary: This PR is a candidate repair for the reported proxy-degraded namespaced tool-call XML leak, but it has not merged and still needs current-main compatibility work.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Rebase without dropping protected ranges (recommended)
    Resolve the current-main conflict by retaining PlainTextToolCallStripOptions.resolveProtectedRanges, its core callers, and the strict-default regression test while adding the invoke-dialect behavior.
  2. Approve the workspace edge
    A maintainer may authorize the exact rebased head's tool-call-repair → markdown-core dependency if canonical mdast ownership is preferred.
  3. Pause for a maintainer-owned reshape
    Pause this branch if the new package dependency is not acceptable and request a narrower implementation using the current protected-range seam.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Rebase onto current main; preserve PlainTextToolCallStripOptions.resolveProtectedRanges and its protected-code behavior, then rerun focused tool-call-repair, plugin-SDK, and shared visible-text tests on the rebased head.

Technical review

Best possible solution:

Rebase onto current main, preserve the existing protected-range SDK contract and all current call sites, then layer the mm: and qualified invoke-dialect repair narrowly on top; obtain exact-head approval for the workspace dependency only if the canonical markdown-core ownership move remains necessary.

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

Yes, from current source: the visible sanitizer only accepts antml: and the persistence stripper's entry prefilter does not include invoke-dialect XML. This read-only review did not execute a failing runtime reproduction.

Is this the best way to solve the issue?

No: the proposed behavior is directionally correct, but this stale branch is not the best current solution until it rebases and preserves the protected-range plugin-SDK contract added on August 1, 2026.

Full review comments:

  • [P1] Preserve the protected-range SDK option on rebase — src/plugin-sdk/tool-payload.ts:43-48
    Current main added PlainTextToolCallStripOptions.resolveProtectedRanges and core callers now use it to preserve literal Markdown examples. This branch's strict one-argument wrapper would remove that supported contract when resolving the dirty merge; retain and forward the option instead of forcing an always-false predicate. This became visible after the August 1, 2026 current-main change.
    Confidence: 0.97

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P1: The unresolved path can leak raw tool-call markup into user-visible replies and persist it in assistant history.
  • merge-risk: 🚨 compatibility: The stale branch conflicts with a current public plugin-SDK option and must not remove that supported call shape.
  • merge-risk: 🚨 message-delivery: The changed sanitizers decide whether model-generated tool markup or literal examples reach channels.
  • merge-risk: 🚨 session-state: The persistence stripper changes which assistant text is retained in durable history.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (terminal): The PR body provides before/after terminal output from the actual sanitizer and persistence-strip functions for the reported leak shapes, and the provided check context includes a successful real-behavior-proof run.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides before/after terminal output from the actual sanitizer and persistence-strip functions for the reported leak shapes, and the provided check context includes a successful real-behavior-proof run.

Evidence

Security concerns:

  • [low] Authorize the workspace dependency graph change — packages/tool-call-repair/package.json:10
    Adding @openclaw/markdown-core to tool-call-repair changes package resolution and the lockfile; repository automation blocks this external graph change until an authorized owner approves the rebased head.
    Confidence: 0.99

What I checked:

  • Current visible-text gap: Current main recognizes only the optional antml: namespace in the tool-call quick check and payload-start matcher; mm:invoke is not a recognized tag form, so the reported MiniMax namespace remains outside this sanitizer path. (src/shared/text/assistant-visible-text.ts:36, b671c1bfe7c3)
  • Current persistence-path gap: Current main's full-line plain-text stripping prefilter only enters for bracket, Harmony, or <function= forms, not standalone invoke-dialect XML, leaving the reported durable-message path unhandled. (packages/tool-call-repair/src/payload.ts:683, b671c1bfe7c3)
  • New public compatibility contract on main: Current main added the public PlainTextToolCallStripOptions.resolveProtectedRanges option and forwards it to tool-call repair so callers can preserve literal code regions. (src/plugin-sdk/tool-payload.ts:29, a1c689e375ec)
  • Current callers depend on protected ranges: Core outbound, assistant sanitization, Discord reply safety, and the plugin-SDK regression test pass resolveProtectedRanges: findCodeRegions; the current test locks the strict-default versus opt-in preservation behavior. (src/plugin-sdk/tool-payload.test.ts:453, b671c1bfe7c3)
  • PR is stale against a conflicting main evolution: The PR head is 6e29fbf1e861bf65a83465709ce7506ec130b721, while its base is 4976eb38ab4e55e57477ffcc7e670fdff0471c3f; GitHub reports the current merge state as dirty. The newer main change at a1c689e added the protected-range contract after the PR base. (src/plugin-sdk/tool-payload.ts:43, a1c689e375ec)
  • Dependency-graph approval remains outstanding: The PR adds one workspace dependency from tool-call-repair to markdown-core and corresponding lockfile entry; repository automation explicitly blocks external dependency-graph changes without authorization for the exact head. (packages/tool-call-repair/package.json:10, 6e29fbf1e861)

Likely related people:

  • Vincent Koc: Introduced the current protected-range contract and its public plugin-SDK forwarding to preserve fenced tool-call examples on current main. (role: recent area contributor; confidence: high; commits: a1c689e375ec; files: packages/tool-call-repair/src/payload.ts, src/plugin-sdk/tool-payload.ts)
  • Peter Steinberger: Current main blames the shared visible-text and plain-text stripping surfaces to the recent main lineage led by this commit author. (role: recent shared-sanitization contributor; confidence: medium; commits: 6d6b3a852d45; files: src/shared/text/assistant-visible-text.ts, packages/tool-call-repair/src/payload.ts)
  • 0668000787: History identifies this contributor on the earlier main commit that added antml: namespaced tool-call stripping, the direct sibling behavior this PR extends to mm:. (role: original namespaced-tool-call contributor; confidence: medium; commits: b2787a1c7a7a; files: src/shared/text/assistant-visible-text.ts)

Rank-up moves

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

  • Rebase onto current main and retain the protected-range SDK option plus its callers and regression test.
  • Obtain maintainer authorization for the exact rebased dependency-graph change, or remove that package edge.
  • Run the focused sanitizer, tool-call-repair, plugin-SDK, and affected outbound tests on the resolved head.

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.

History

Review history (84 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-30T13:56:56.779Z sha f43b089b2abe2909e9a218e86185d555b0fd8d01 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-30T15:10:14.815Z sha f43b089b2abe2909e9a218e86185d555b0fd8d01 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-30T16:18:31.598Z sha 7543b900b1575c0d8720e0102d3bf7dcd623b21a :: needs maintainer review before merge. :: none
  • reviewed 2026-07-30T19:14:44.264Z sha f1eaeb9408808dff3194cf0e63b5978489e39d8e :: needs maintainer review before merge. :: none
  • reviewed 2026-07-30T22:13:33.268Z sha d9153e5ee0396ee82d75092216e161a1af3629f9 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-30T22:50:57.315Z sha d9153e5ee0396ee82d75092216e161a1af3629f9 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-31T10:13:04.624Z sha 900e4be7e1c60f944940ac2f19da5a135ad1ca52 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-31T22:13:45.960Z sha 6e29fbf :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added 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. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jun 29, 2026
@Jerry-Xin
Jerry-Xin force-pushed the fix/antml-toolcall-leak-97750 branch 3 times, most recently from c345a7b to f6576ab Compare June 30, 2026 01:15
@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Pushed the streaming-prefix fix for the remaining P1 (the streamed invoke recognizer now mirrors the final parser's whitespace-flexible grammar via a phase scanner, with split-whitespace regression coverage), and added redacted real-behavior proof under proof/pr-97845/ plus the captured before/after runtime output in the PR body. @clawsweeper re-review

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 30, 2026
@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Addressed the latest review:

  • [P1] Aligned the streamed <function_calls> wrapper recognizer with the parser grammar — the same whitespace-flexible phase scanner as the invoke open is now applied to the wrapper prefix, so a grammar-legal split form like < function_calls > stays buffered instead of leaking. Added split-wrapper regression coverage.
  • [P2] Removed the in-repo proof harness; the redacted before/after runtime proof is kept in the PR description.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 30, 2026
@Jerry-Xin
Jerry-Xin force-pushed the fix/antml-toolcall-leak-97750 branch from 790e9c0 to 6bba759 Compare June 30, 2026 07:06
@clawsweeper clawsweeper Bot added 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. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 30, 2026
@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Addressed the visible-text stripping finding: stripPlainTextToolCallBlocks now strips a tool-call block only when it is full-line-standalone. A line-leading complete block followed by same-line prose (a documentation example such as <invoke name="find">...</invoke> is the attribute form.) is preserved instead of having its block deleted and the trailing prose orphaned. The guard mirrors the existing line-start guard and the function's documented full-line-standalone contract, applies to every dialect routed through the loop, and still strips the standalone degraded tool-call blocks the leak fix targets. Added regression coverage for the preserved inline forms and the still-stripped standalone form.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Rebased onto latest upstream/main (clean, no conflicts); branch head is now 1e076955. @clawsweeper re-review

@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Rebased onto latest upstream/main (clean, no conflicts); branch head is now 0e72cf8f. @clawsweeper re-review

@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Rebased onto latest upstream/main (clean, no conflicts); branch head is now 92d06db8. @clawsweeper re-review

@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Rebased onto latest upstream/main (resolved a generated plugin-sdk API baseline conflict by regenerating the baseline; plugin-sdk:api:check passes). No source/behavior changes in this rebase. @clawsweeper re-review

@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Rebased onto latest upstream/main (clean, no conflicts; no source changes). New head is current. @clawsweeper re-review

@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Rebased onto latest upstream/main (resolved the generated plugin-sdk API baseline conflict by regenerating the baseline; plugin-sdk:api:check passes). No source/behavior changes in this rebase. @clawsweeper re-review

@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Rebased onto latest upstream/main (clean, no conflicts; no source changes). @clawsweeper re-review

@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Rebased onto latest upstream/main (clean, no conflicts). @clawsweeper re-review

3 similar comments
@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Rebased onto latest upstream/main (clean, no conflicts). @clawsweeper re-review

@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Rebased onto latest upstream/main (clean, no conflicts). @clawsweeper re-review

@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Rebased onto latest upstream/main (clean, no conflicts). @clawsweeper re-review

@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Rebased onto latest upstream/main (clean, no conflicts). Verified head now at e262bff0. Requesting a fresh review on the current head.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Rebased onto latest upstream/main (clean, no conflicts). Head now at a85bca71. Requesting a fresh review on the current head.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Rebased onto latest upstream/main. This time upstream had overlapping changes: it extracted a shared code-regions helper and a CJK-chars module in packages/normalization-core, so there were conflicts in packages/normalization-core/src/index.ts and src/shared/text/code-regions.ts. Resolved by keeping normalization-core as the single canonical home for findCodeRegions/isInsideCode/CodeRegion (re-exported from src/shared/text/code-regions.ts) alongside upstream's cjk-chars export, so there is one implementation rather than a forked copy, and our code-region-preservation behavior is retained. Head now at bb06cae1. Requesting a fresh review on the current head.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Addressed the remaining P1 (preserve indented Markdown code regions).

The shared code-region detector regressed when it moved into normalization-core: it recognized only fenced and inline-backtick spans and dropped four-space / tab indented CommonMark code-block detection, so a qualified antml:/mm: invoke example (or a <details> example) inside an indented block was treated as prose and stripped/flattened on both the delivery and persisted-history paths. This also turned the markdown-details.test.ts "leaves literal details examples inside code unchanged" shard red.

findCodeRegions now includes a self-contained CommonMark indented-code-block scanner:

  • indent measured in columns (tab advances to the next multiple of four);
  • a block opens only at document start or after a blank line whose nearest non-blank predecessor is unindented, so a four-column line following prose stays a scrubbable lazy paragraph continuation;
  • interior blanks kept, trailing blanks excluded;
  • runs after the fenced pass and before the inline pass.

It contains no markdown-core import (which would cycle, since markdown-core depends on normalization-core); pnpm check:import-cycles reports 0 cycles. The PR body's Evidence section now includes before/after findCodeRegions output for an indented invoke example and the full verification list. New code-regions.test.ts plus delivery/history regressions cover the contract, including the paragraph-continuation negative and tab-indent cases.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@github-actions

Copy link
Copy Markdown
Contributor

Dependency Guard

This PR changes dependency-related files. Maintainers should confirm these changes are intentional.

Changed files:

  • packages/tool-call-repair/package.json
  • pnpm-lock.yaml

Maintainer follow-up:

  • Review whether the dependency changes are intentional.
  • Inspect resolved package deltas when lockfiles or workspace dependency policy changes are present.
  • Treat pnpm-lock.yaml and package-lock.json diffs as dependency security-review surfaces.
  • Run pnpm deps:changes:report -- --base-ref origin/main --markdown /tmp/dependency-changes.md --json /tmp/dependency-changes.json locally for detailed release-style evidence.

@github-actions

github-actions Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Dependency graph changes are blocked

OpenClaw does not accept dependency graph changes through PRs unless a repository admin or security explicitly authorizes the current head SHA. Dependency updates are generated internally by maintainers so external PRs cannot change the resolved graph.

Detected dependency graph changes:

  • pnpm-lock.yaml changed.
  • packages/tool-call-repair/package.json changed dependencies.

Auto-scrub was not attempted because this PR changes package manifest dependency graph fields:

  • packages/tool-call-repair/package.json changed dependencies.

Dependency graph changes must be reviewed by security or handled by maintainers internally. Please remove lockfile changes manually if they are not needed.

To remove lockfile changes, restore them from the target branch:

git fetch origin
git checkout 'origin/main' -- 'pnpm-lock.yaml'
git commit -m 'chore: remove dependency lockfile change'
git push

If this PR intentionally needs a dependency graph change, ask a repository admin or member of @openclaw/openclaw-secops to comment:

/allow-dependencies-change

The action will approve the current head SHA (6e29fbf1e861bf65a83465709ce7506ec130b721) when it reruns. A later push requires a fresh approval.

@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Fix C1 landed at f43b089b2abe: moved code-region detection to a canonical mdast-backed adapter in @openclaw/markdown-core, deleted the flat leaf scanner in normalization-core, and repointed tool-call-repair + src/shared/text/code-regions.ts. This preserves qualified antml:/mm: invoke examples in indented code nested under CommonMark list containers (the real reachable P1 case) while still scrubbing plain-paragraph 4-space continuations and tight/loose list non-code continuations. New test coverage for nested-list, blockquote-list, single-list, blockquote invariant lock, and the three negative over-preserve guards. Also added a cheap tag-presence gate on the reasoning-progress streaming hot path so mdast is only invoked when a reasoning tag is actually present (17KB no-tag sample: normalize 965ms→17ms, format 1706ms→62ms, merge 44ms→1ms across 200 iterations). PR body Evidence section refreshed with the real-behavior proof for all six nested-code cases. @clawsweeper re-review

…out deleting code examples (openclaw#97750)

Some proxies degrade native Anthropic/MiniMax tool calls into namespaced or
bare XML text using the attribute dialect
`<invoke name="tool"><parameter name="x">v</parameter></invoke>`, optionally
wrapped in `<function_calls>...</function_calls>` and optionally prefixed with
`antml:` or `mm:`. This markup leaked into user-visible text and was mishandled
on the persist path.

Visible text: mirror the existing `antml:` handling for the `mm:` namespace in
the assistant-visible-text stripper so truncated/mid-line `mm:invoke` leaks are
removed. The `<function_calls>`-wrapped bare invoke case is already handled by
the package strip stage in the delivery pipeline.

Persist path: teach the tool-call-repair strip to recognize a complete
standalone invoke block (bare/antml:/mm:, `<function_calls>` wrapper,
self-closing, and zero-parameter forms) via a dedicated linear scanner. The
scanner returns none/incomplete/complete so the strip loop bails on an
unterminated open exactly like the existing dialects, keeping the scan linear
(no quadratic rescan on adversarial input). The strip now takes an optional
code-region predicate so fenced and inline Markdown examples of the invoke
dialect are preserved while unfenced standalone leaked blocks are scrubbed;
without a predicate it lazily computes code regions so a bare package call still
spares examples.

Keep the exported plugin-SDK helper strict by default (forces a scrub of every
region) with an opt-in `{ preserveCodeRegions: true }` for code-aware callers,
and keep the closed `(?:antml:|mm:)?` namespace allow-list so arbitrary `ns:`
tokens in prose are never matched.

Move findCodeRegions/isInsideCode/CodeRegion into normalization-core so the
tool-call-repair package can share one implementation without importing app
source; the shared/text module re-exports them so existing callers are
unaffected.

Add focused regression tests for the invoke-dialect variants, code-region
preservation, the predicate override, the SDK preserveCodeRegions option, the
mm: visible-text case, and a linear-time guard against many unterminated opens.

Split the standalone invoke strip helpers into payload-strip-invoke.ts and
the visible-text tool-call pattern constants into
assistant-visible-text-tool-call-patterns.ts. This is a pure structural
extraction with no behavior change, keeping the two touched legacy files within
the changed-file size ratchet.
…l stripper

Restore stripPlainTextToolCallBlocks to its single-argument strict
contract and remove the StripPlainTextToolCallOptions type. The
preserveCodeRegions opt-in was added on this branch and never shipped in
a release; no production caller uses it, so it is dead public surface.
The code-region-aware path remains available in the internal
packages/tool-call-repair helper, and package-level tests keep that
coverage. Decrement the public export surface budget accordingly and
regenerate the plugin-sdk API baseline.
…y qualified forms

Narrow the standalone-invoke scrubber so a bare (un-namespaced, unwrapped)
full-line <invoke>...</invoke> block is preserved as legitimate content on both
the visible-delivery and persisted-history paths. Only namespace-qualified
(antml:/mm:) or <function_calls>-wrapped forms are treated as degraded tool-call
leakage and removed, matching the actual scope of the reported proxy degradation.

- grammar.ts: make the namespace group capturing; scanStandaloneXmlishInvokeBlock
  now returns 'none' for an unqualified bare block while keeping the incomplete
  (linearity/ReDoS) bail ahead of the qualification check.
- payload.ts: tighten the strip trigger prefilter so a bare <invoke> no longer
  arms the scrub pass on its own; wrapper/namespaced forms still arm it.
- tests: move the bare case out of the scrub set, add bare-survives regressions
  across the visible-delivery and persisted-history profiles, and update the
  openclaw#97750 visible-text test to assert the preservation contract.
…ode-region detector

findCodeRegions only recognized fenced and inline-backtick spans after the
detector moved into normalization-core, dropping the indented (four-space / tab)
CommonMark code-block detection the previous shared helper provided via the
Markdown scanner. Qualified antml:/mm: invoke examples and <details> examples
inside an indented code block were therefore treated as ordinary text and
stripped/flattened on both the visible-delivery and persisted-history paths.

Add a self-contained CommonMark indented-code-block detector (no markdown-core
import, which would cycle since markdown-core depends on normalization-core):
- indent measured in columns (tab advances to the next multiple of four)
- a block opens only at document start or after a blank line whose nearest
  non-blank predecessor is unindented; a four-column line following prose stays
  a lazy paragraph continuation and remains scrubbable
- region spans the first indented line through the last non-blank indented line,
  keeping interior blanks and excluding trailing blanks
- runs after the fenced pass and before the inline pass

Add code-regions unit coverage (fenced/indented/inline/tab/interior-blank/
paragraph-continuation-negative) plus delivery- and history-profile regressions
for a qualified invoke example inside an indented block.
…pter

The old flat scanner in packages/normalization-core/src/code-regions.ts opened an
indented code block only when the nearest non-blank predecessor line was itself
unindented. That heuristic misfires for valid indented code nested under a
CommonMark list container whose content indent is >= 4 columns (nested lists, or
a list item whose continuation line is itself indented). A qualified antml:/mm:/
function_calls invoke example placed in such nested code was recognised as
prose by the downstream visible-text and persistence scrubbers and silently
removed from both delivered replies and persisted assistant history.

Route the code-region source through the canonical mdast implementation:

- Add packages/markdown-core/src/code-regions.ts, a small adapter over
  findMarkdownCodeSpans exposing the existing CodeRegion / findCodeRegions /
  isInsideCode surface via a dedicated @openclaw/markdown-core/code-regions
  subpath.
- Delete the leaf flat scanner from packages/normalization-core and drop its
  export; a leaf cannot import markdown-core without cycling.
- Repoint packages/tool-call-repair/src/payload-strip-invoke.ts and
  src/shared/text/code-regions.ts to the markdown-core adapter. The link
  tool-call-repair -> markdown-core -> normalization-core stays acyclic.
- Regenerate docs/.generated/plugin-sdk-api-baseline.sha256 via the repo's own
  generator; the public CodeRegion shape is preserved.

Add coverage across the sanitiser boundary:

- Positive-preserved: qualified invoke in indented code nested under a >= 4
  column list container (real reachable case); a second container variant;
  single-level list still preserved; blockquote invoke preserved as an
  invariant lock, with a comment noting the scrubber requires '<' at line
  start (skipLineIndentation skips only spaces/tabs, not '>'), so any future
  scrubber change consuming '>' must re-check code detection.
- Negative still-scrubbed: plain paragraph + 4-space continuation, tight-list
  lazy continuation, loose-list non-code continuation.

Guard the reasoning-progress streaming hot path with a cheap tag-presence
gate in src/channels/progress-draft-status-text.ts so the mdast-backed
detector only runs when a reasoning tag is actually present. Micro-bench on
a 17KB no-tag sample: normalize 965 ms -> 17 ms, format 1706 ms -> 62 ms,
mergeDeltas 44 ms -> 1 ms across 200 iterations.
@Jerry-Xin

Copy link
Copy Markdown
Contributor Author

Closing this PR as superseded by upstream work.

Since this PR was opened, upstream #117089 landed and now handles the antml: namespaced/bare invoke-dialect scrub through the public protected-range path (resolveProtectedRanges / code-region detection), without introducing a new tool-call-repair → markdown-core workspace dependency. The originally reported issue (#97750) has also been closed. The core behavior this PR set out to fix — degraded invoke-dialect XML leaking into visible text while preserving code examples — is therefore already covered on main.

The only residual difference is the mm: (MiniMax) namespace form, which is a small, separable follow-up better addressed narrowly on top of the current main contract rather than by rebasing this now-divergent branch. This branch's remaining blockers — the externally submitted dependency-graph change requiring exact-head authorization, plus hard rebase conflicts against the new protected-range API in payload.ts / tool-payload.ts — no longer buy anything now that the primary fix has landed elsewhere.

Closing to keep the queue clean. If the mm: namespace gap needs its own fix, I'll open a fresh, focused PR against current main. Thanks for the reviews.

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

Labels

agents Agent runtime and tooling dependencies-changed PR changes dependency-related files docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L 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.

[Bug]: Anthropic antml: namespaced tool-call XML leaks into visible content (and fails the turn) when proxy degrades tool_use to text

1 participant