Repository navigation
refactor(tool-call-repair): simplify redundant guards - #166192
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 6, 2026, 12:34 PM ET / 16:34 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR simplifies incomplete-payload handling and Markdown fence bookkeeping in OpenClaw’s plain-text tool-call repair package without changing intended behavior. Merge readiness✅ Ready for maintainer review Keep open: the cleanup remains absent from current main, and source review found no introduced correctness defect. This member-authored PR is also protected from automatic closure. Priority: P3 Review scores
Verification
How this fits togetherTool-call repair processes model text that contains tool-call syntax, separating calls from visible replies. Its Markdown protection scanner preserves literal examples and falls back to the full parser when ownership is uncertain. flowchart TD
A[Model text] --> B[Tool-call repair]
B --> C[Markdown protection]
C --> D{Protection certain?}
D -->|No| E[Full Markdown parser]
D -->|Yes| F[Payload scanner]
E --> F
F --> G[Tool calls and visible text]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -11. Total -11 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the simpler implementation while preserving conservative Markdown fallback and incomplete-payload semantics. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR proposes behavior-preserving cleanup rather than a reported bug; equivalence was checked in source without executing tests. Is this the best way to solve the issue? Yes: both removals follow existing scanner invariants and avoid adding another owner, API, or compatibility path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 817706084620. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
## What Problem This Solves Removes redundant guard bookkeeping in tool-call repair as part of the requested internal simplification. ## User Impact No intended runtime behavior or public API change. Fence protection, ambiguous-input fallback, and incomplete payload handling remain unchanged. ## Why This Change Was Made The fence scanner already rejects indented openings before recording protection, so it can record the resolved fence state directly. An early incomplete-prefix return duplicates the later undefined block-end return. ## Evidence - Independent source/diff review and scoped autoreview found no actionable findings; the reviewed two-file patch is unchanged after incorporating main. - The original aggregate failed on the baseline `CallBrief` re-export. Its other 31 commands passed, including the separately completed nine-command suffix. The blocker was repaired separately in openclaw#166147. - Refreshed native plan: all 32 commands covered by seven input-qualified retained passes and 25 fresh passes, including all three unused-export scans and all 27 core-test type graphs. - Fresh whole focused suites passed: protection fast path (13), stream normalizer (52), payload (27), and the SDK tool-payload consumer (38): 130 tests across four files, zero skips. - Exact-head required hosted CI and native landing gates remain required. This does not claim complete CommonMark coverage or live-provider proof.
What Problem This Solves
Removes redundant guard bookkeeping in tool-call repair as part of the requested internal simplification.
User Impact
No intended runtime behavior or public API change. Fence protection, ambiguous-input fallback, and incomplete payload handling remain unchanged.
Why This Change Was Made
The fence scanner already rejects indented openings before recording protection, so it can record the resolved fence state directly. An early incomplete-prefix return duplicates the later undefined block-end return.
Evidence
CallBriefre-export. Its other 31 commands passed, including the separately completed nine-command suffix. The blocker was repaired separately in fix(voice-call): unblock unused-export checks #166147.