Repository navigation
fix(text): hide encoded MiniMax tool envelopes - #126307
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 11, 2026, 7:01 AM ET / 11:01 UTC (Revision 13). ClawSweeper reviewWhat this changesThe PR removes complete encoded MiniMax tool-call envelopes from assistant replies and shared history while preserving code examples and surrounding prose. Merge readiness✅ Ready for maintainer review This remains a useful fix absent from current main and v2026.9.4. The previous code concerns and PR-body follow-up are addressed; no blocking introduced defect was found. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s shared text sanitizer turns model-generated assistant text into visible replies and history. Telegram delivery and public shared-session rendering consume this sanitized text. flowchart TD
A[Assistant text] --> B[Shared text sanitizer]
B --> C{Complete encoded envelope outside code?}
C -->|Yes| D[Normalize envelope and remove tool XML]
C -->|No| E[Preserve existing text handling]
D --> F[Visible assistant text]
E --> F
F --> G[Channel replies]
F --> H[Public shared history]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +38, Tests +142. Total +180 across 3 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep encoded-envelope recognition in the existing shared sanitizer, preserving literal examples, incomplete-input behavior, and structured tool dispatch. Do we have a high-confidence way to reproduce the issue? Yes: current source shows why interleaved MiniMax markers bypass tool-payload recognition, and the supplied Telegram observations report the same failure. This read-only review did not execute target code. Is this the best way to solve the issue? Yes: extending the existing MiniMax sanitizer before generic XML cleanup repairs both delivery and history without adding a competing parser owner or configuration surface. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 227e7ae26af4. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (12 earlier review cycles; latest 8 shown)
|
c9c6481 to
818f62f
Compare
|
Rebased onto current main, ported the fix to the shared code-region-aware sanitizer, added redacted terminal behavior proof to the PR body, and verified 127/127 targeted tests plus clean autoreview. @clawsweeper re-review |
|
Exact-head CI for |
|
Addressed the latest ClawSweeper compatibility concern in 6d2d335c: encoded MiniMax delimiters are now normalized only inside a complete encoded <tool_call> envelope, while standalone literal delimiters are preserved. Verified with node scripts/run-vitest.mjs src/shared/text/assistant-visible-text.test.ts (129 passed) and the required autoreview (clean). The local changed-file gate reached an unrelated assertion-SAFETY baseline drift outside this PR; conflict-marker and max-lines checks passed. @clawsweeper re-review |
|
Fixed the current-head max-lines CI failure in check-lint-core-1. The stripToolCallXmlTags cases now live in assistant-visible-text.tool-calls.test.ts, keeping the original focused sanitizer test file at 985 lines without changing production behavior or coverage. Validation:
The prior current-head core-test failure remains an unrelated timing miss in src/audit/audit-event-writer.test.ts (266.9ms vs 250ms). New CI is now running on edb914cf. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Normalize complete encoded envelopes at the shared visible-text boundary while preserving code examples, incomplete input, and structured tool dispatch. Retain current streaming projection and history behavior when integrating the contributor fix.
Security-sensitive guard clearedThis PR no longer has blocked security-sensitive file changes. A future security-sensitive change requires a fresh
|
|
Thanks @zhucegep! Proof: Real Telegram Test Server messages and public shared-session history show the encoded payload leak before the fix and clean replies after it. Synthetic HTTP provider responses exercise the same 11-case flow, including code examples, incomplete input, and an actual structured
Final hosted CI passed on |
Preserve the reviewed harness while incorporating the landed benchmark prerequisite. Punchcard-Session: coral-orchard-orchard-d4 * commit '4407ed19ac63b1c1c84a0cfe6eb4bbeca9c2322c': (1196 commits) fix(perf): isolate benchmark subprocess transport (#144159) refactor(auth): await Copilot cache persistence (#144810) refactor(web-fetch): exercise URL normalization through the public tool (#144887) fix(ollama): preserve hosted subdomain model context (#144891) fix(doctor): explain Codex plugin health failures (#144813) fix(channels): honor pinned accounts in Mattermost model menus (#144880) fix(update): failed-update records hide the triggering error behind the excerpt tail (#144729) fix(logging): preserve OpenClaw package references in diagnostics (#144808) fix: retain plugin detail tab selections while inspection loads (#144647) fix: keep discovered models when sign-in tokens renew (#144861) fix(update): preserve local package overrides (#89985) fix(update): resolve compatibility bridges within the runtime graph (#144831) chore(i18n): refresh native locales (#144856) fix: preserve child signal termination during CLI respawn (#144838) fix(text): hide encoded MiniMax tool envelopes (#126307) fix(subagents): deliver child replies that match the empty placeholder (#130647) fix(cli): reject blank message channel selectors (#144802) fix(telegram): preserve mixed text order and pending stop (#144839) fix(memory): restore FTS fallback for same-name view collisions (#144783) chore(release): close out 2026.9.4 on main (#144708) ...
Remove complete encoded MiniMax internal tool envelopes from delivered replies and public shared-session history while preserving code examples and incomplete input. Keep the repair at the shared visible-text owner and preserve current streaming projection behavior. Validated with real Telegram Test Server baseline/candidate flows, shared-history captures and revocations, a structured read control, 239 focused tests, and static checks. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
MiniMax can emit internal tool XML as assistant text with interleaved
]<]minimax[>[transport markers. Those markers prevent the existing XML filter from recognizing the payload, which exposes internal text in channel replies and public shared-session history.Recognize complete encoded envelopes at the shared visible-text boundary, then apply the existing XML cleanup. Ignore opening and closing markers inside code examples. Stop the closing-marker search once it reaches the end of incomplete input. The integration preserves current main's streaming projection and existing tests.
Evidence
readcall returns its actual result, and generic XML cleanup works after switching to another provider fixture.Channel proof uses synthetic HTTP provider responses and real Telegram transport. Full type checks and suites run in hosted CI. Test messages, temporary shares, Gateway processes, and credential leases were cleaned up.
AI-assisted.