docs: add file-tool error flow standardization design #455#456
Open
andrii-novikov wants to merge 1 commit into
Open
docs: add file-tool error flow standardization design #455#456andrii-novikov wants to merge 1 commit into
andrii-novikov wants to merge 1 commit into
Conversation
Internal file tools let raw DialExceptions escape their bodies, so the forward_tool_error_message flag introduced by #408 is a silent no-op for them: compose_tool_error_fallback_message forwards only ToolErrorException subclasses, which exist for MCP and REST tools but not for file tools. The LLM then reports vague failures like "the backend tool is failing" (#447). _download_text additionally mislabels Core 5xx errors as InvalidToolCallParameterException, telling the model to fix a parameter that is not broken and bypassing configured fallback strategies. The design standardizes every failure escaping a file tool into one of two shapes: InvalidToolCallParameterException for parameter-shaped failures (unchanged retry-with-a-fixed-value behavior) and a new FileToolErrorException(ToolErrorException) for genuine tool/server failures, plus forward_tool_error_message=True defaults for all nine file tool configs. Zero changes to the fallback machinery. Implementation is a follow-up; this PR carries only the design doc.
ypldan
approved these changes
Jul 17, 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.
Applicable issues
ToolErrorExceptionsoforward_tool_error_messageworks for internal file tools #455 (design only — implementation is a follow-up PR, so the issue stays open)Description of changes
Adds the design doc
docs/designs/file_tool_error_flow.md(Status: Draft) for standardizing the internal file tools' error flow ontoToolErrorException.Why: #408 introduced
forward_tool_error_message, which forwards a tool's real error text to the LLM — but the gate incompose_tool_error_fallback_messageforwards onlyToolErrorExceptionsubclasses, and those exist for MCP and REST tools only. The internal file tools (dial_files_tooling/) let rawDialExceptions escape, so the flag is a silent no-op for them: the model receives only generic fallback instructions and reports vague failures like "the backend tool is failing" — the symptom of #447. On top of that,_download_textmislabels Core 5xx errors asInvalidToolCallParameterException, steering the model into "fix the parameter and retry" for a server fault and bypassing configured fallback strategies.The design: every failure escaping a file tool becomes one of exactly two standardized shapes —
InvalidToolCallParameterExceptionfor parameter-shaped failures (404/403/etag conflict/bad range — unchanged retry behavior) and a newFileToolErrorException(ToolErrorException)for genuine tool/server failures, produced by a translation helper in_base_file_tool.pythat replaces the 403-only_check_permission_denied. All nine file-tool configs shipforward_tool_error_message=Truedefaults. Zero changes to the fallback machinery; no schema changes (the file-tool configs are hardcoded, not manifest-driven).No implementation code in this PR — the doc will go through design review separately; implementation follows in its own PR.
Checklist
[ ] Changes are tested on review environment(docs-only change, nothing to deploy)[ ] App schema changes are backward compatible, or breaking changes are documented with a migration guide(no schema changes)[ ] Integration tests pass(docs-only change)By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.