fix(#24): strip all XML pseudo tool-call dialects from model replies #68
No reviewers
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_shrimp!68
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_strip_xml_tool_call_text"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Completes the fix for issue #24 — pseudo tool-call text leaking to the user.
PR #52 fixed the
[TOOL_CALL]{tool => …}[/TOOL_CALL]bracket dialect. Retesting revealed three additional XML formats that were not handled. This PR adds three-layer defense (engine → server → UI) for all of them.Formats added
<tool_call><function_name>…</function_name></tool_call><function_calls><invoke name="…">…</invoke></function_calls><execute><cmd>…</cmd></execute>Changes per layer
store.ts—stripBracketToolCalls()extended with all three new regex patterns (applied at streaming flush +turn:end, no call-site changes needed)session.rsstrip_fake_tool_call_envelopes— one strip step added per format, each withtracing::warn!+ teststool_call_recovery.rs—strip_xml_tool_calls+parse_xml_tool_call_body,strip_function_calls_xml+parse_function_calls_body,strip_execute_xml+parse_execute_bodytool_call_recovery_module.rs— all three hooked intolift_recovered_tool_calls: promote to real tool call when name is in tool map, suppress otherwiseCloses #24
c655393909c379a71454