Skip to content

fix: populate output field in all error ToolResults for AI visibility#7

Merged
bkrabach merged 1 commit intomainfrom
fix/error-output-visibility
Feb 17, 2026
Merged

fix: populate output field in all error ToolResults for AI visibility#7
bkrabach merged 1 commit intomainfrom
fix/error-output-visibility

Conversation

@bkrabach
Copy link
Collaborator

Summary

  • Adds output=error_msg alongside error={"message": error_msg} for all 11 error return paths across grep.py and glob.py
  • ToolResult.output is the primary channel the AI reads — when only error={"message": ...} was set, error details were invisible to the AI agent

Context

Same class of bug fixed in amplifier-bundle-lsp PR #3. The pattern applied uniformly:

# BEFORE (error invisible to AI):
return ToolResult(success=False, error={"message": f"Invalid regex pattern: {e}"})

# AFTER (error visible via output):
error_msg = f"Invalid regex pattern: {e}"
return ToolResult(success=False, output=error_msg, error={"message": error_msg})

Test plan

  • python_check clean across both files (ruff format, ruff lint, pyright)
  • No logic changes — only adds output= parameter to existing returns

🤖 Generated with Amplifier

ToolResult.output is the primary channel the AI reads. When only
error={"message": ...} was set, error details were invisible to the AI agent.
This adds output=error_msg alongside error={"message": error_msg} for all
error return paths (11 instances across grep.py, glob.py).

Same class of bug fixed in amplifier-bundle-lsp PR #3.

🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier)

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
@bkrabach bkrabach merged commit b5d7092 into main Feb 17, 2026
1 check passed
@bkrabach bkrabach deleted the fix/error-output-visibility branch February 17, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant