[mtp] Integrate output parser into MTP step to prevent token leakage (#56) #63
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/56-mtp-output-parser"
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
Fixes #56. The MTP step (
_mtp_step) was bypassing the output parser session, causing structural tokens likeuserand<|im_end|>to leak into the output stream for Harmony models (GPT-4o etc.).Changes
_get_output_parser_session()when availableparser_session.finalize()on request finish to flush text and extract tool callsTest Results
81/82 scheduler tests pass. 1 failure is pre-existing on main (boundary snapshot token tracking).
Acceptance Criteria
is_stoptriggers early stoppingrecord_tokencontrols output_token_idsfinalize()15ebe73adbtoc9ca178bae