Draft
[Evaluation] Consolidate _get_tool_calls_results/_reformat_tool_calls_results into _common/utils.py#47842
Conversation
…ool_calls_results from _common/utils.py - Add _stringify_tool_result and _log_safe_summary to _common/utils.py - Add improved _get_tool_calls_results and _reformat_tool_calls_results to _common/utils.py (using _format_value and _stringify_tool_result for consistent arg/result formatting) - Remove duplicate local definitions from _tool_call_success.py - Import _get_tool_calls_results and _reformat_tool_calls_results from _common/utils.py in _tool_call_success.py Co-authored-by: m7md7sien <16615690+m7md7sien@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix imports in _tool_call_success.py
[Evaluation] Consolidate _get_tool_calls_results/_reformat_tool_calls_results into _common/utils.py
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
_tool_call_success.pydefined its own_get_tool_calls_resultsand_reformat_tool_calls_results, duplicating (and diverging from) equivalent logic elsewhere. The two copies formatted tool-call arguments differently:_tool_call_success.pyusedf'{k}="{v}"'(all values quoted), while the utils path used_format_value(v)(numbers unquoted,None→"None").Changes
_common/utils.py— Added:_stringify_tool_result: renders tool results as LLM-readable strings (list/dict → JSON viajson.dumps,None→"", str passthrough)_log_safe_summary: shape-only structural summary for safe logging (avoids leaking PII/customer data into telemetry)_get_tool_calls_results: canonical implementation using_format_valuefor args and_stringify_tool_resultfor results_reformat_tool_calls_results: safe wrapper around_get_tool_calls_resultswith fallback on parse failure, logging via_log_safe_summary_tool_call_success.py— Removed the 64-line duplicate definitions; imports_get_tool_calls_resultsand_reformat_tool_calls_resultsfrom_common/utils.pyinstead.