Repository navigation
Description
Observed Behavior
When a tool raises an exception, Agent Framework logs:
Function 'failing_tool' raised an exception; returning an error result to the model. Set include_detailed_errors=True for the full detail.
The recommendation appears even when function_invocation_configuration["include_detailed_errors"] is explicitly True. This incorrectly suggests that detailed error feedback is disabled or that the configuration was ignored.
Expected Behavior
Preserve the tool-failure warning, but include the recommendation only when include_detailed_errors is disabled.
Steps to Reproduce
- Run the minimal reproduction below with
agent-framework-core==1.20.0. - Observe the warning with
include_detailed_errors=False. - Observe the same recommendation with
include_detailed_errors=True, despite the model-bound result correctly including the exception.
Minimal Reproduction
The following isolates the SDK's error-result handler without requiring a model connection:
import logging
from agent_framework import Content
from agent_framework._tools import _function_execution_error_result
logging.basicConfig(level=logging.WARNING)
call = Content.from_function_call(
call_id="test-call",
name="failing_tool",
arguments={},
)
for enabled in (False, True):
print(f"include_detailed_errors={enabled}", flush=True)
result = _function_execution_error_result(
function_call=call,
tool_name="failing_tool",
exception=RuntimeError("test failure"),
config={"include_detailed_errors": enabled},
)
print(result.result, flush=True)Error Messages and Stack Traces
Both configurations emit this warning:
WARNING:agent_framework:Function 'failing_tool' raised an exception; returning an error result to the model. Set include_detailed_errors=True for the full detail.
The model-bound results correctly differ:
| Setting | Model-bound result |
|---|---|
| `False` | `Error: Function failed.` |
| `True` | `Error: Function failed. Exception: test failure` |
Package Versions
agent-framework-core==1.20.0
Python Version
Python 3.14
Operating System
Linux
Regression
No
Additional Context
Reproduced with sensitive-data logging both enabled and disabled.
In _function_execution_error_result, both logging branches include the recommendation unconditionally. The configuration is checked afterward when constructing the model-bound result.
This is a misleading logging message, not a failure of the detailed-error setting.
A search of open and closed issues did not identify a report covering this specific warning bug.
Acknowledgements
- I searched existing issues and did not find a duplicate.
- I personally verified this behavior and the reproduction details are authentic.
- I will wait for explicit maintainer agreement before starting implementation of a non-trivial change.
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
github-actions commentedon Oct 16, 2026
🤖 Automated triage reproduction notes (agent-authored — trust but verify)
Agent analysis
Repro:
python/packages/core/agent_framework/_tools.py::_function_execution_error_resultunconditionally includes the recommendation in both warning branches when a tool exception occurs, including withinclude_detailed_errors=True. Minimal repro: call the helper with a function-callContent, aRuntimeError, andconfig={"include_detailed_errors": True}, then assert the detailed result is present but the recommendation is absent from captured logs.python/packages/core/tests/core/test_function_invocation_logic.py::test_function_execution_error_warning_omits_recommendation_when_detailed_errors_enabled1.20.01.22.0