mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-04 16:38:49 +00:00
apply_final_call_ids iterated over all final tool calls, including non-file-edit tools like read_file. The greedy path-match in matches_final_tool_call could overwrite a correct unique id with a stale one from a different streaming state, producing duplicate tool_use ids that poison the persisted session. Guard the loop with is_file_edit_tool() so only tracked file-edit tools (write_file, edit_file, apply_patch) are subject to canonical id remapping. Non-file-edit tools keep their authoritative id from get_final_message(). Fixes #4595