Skip to content

tool_args call fix for A0 v1.6)#1418

Closed
ESP-Geek wants to merge 3 commits intoagent0ai:mainfrom
ESP-Geek:fix/validate-tool-args
Closed

tool_args call fix for A0 v1.6)#1418
ESP-Geek wants to merge 3 commits intoagent0ai:mainfrom
ESP-Geek:fix/validate-tool-args

Conversation

@ESP-Geek
Copy link
Copy Markdown

@ESP-Geek ESP-Geek commented Apr 2, 2026

Summary

Implementation

  • agent.py (validate_tool_request):
    • If tool_args is present: must be dict ({} allowed)
    • Else if args present: must be dict; mapped to tool_args
    • Else: raise ValueError("Tool request must have a tool_args (type dictionary) field")

Tests

  • Added tests/tests_tool_request_validation.py covering:
    • Empty tool_args is accepted
    • Missing both tool_args and args is rejected
    • Legacy args={} is accepted and mapped
    • Non-dict tool_args and args are rejected
    • Missing tool_name is rejected

Documentation

  • New: docs/developer/tool-requests.md — canonical schema and examples for tool requests (tool_name required; tool_args required; legacy args fallback explained)
  • README: added link in developer docs table to the new page
  • docs/developer/mcp-configuration.md: TIP box linking to tool-requests.md for MCP invocations

Fork branch with changes

Notes

  • Title set per user request: "tool_args call fix for A0 v1.6)"
  • Happy to add more tests or adjust messaging if reviewers prefer alternative error text or stricter deprecation notes.

@ESP-Geek
Copy link
Copy Markdown
Author

ESP-Geek commented Apr 2, 2026

Update after restart and follow-ups:\n\n- Added unit tests covering empty/missing tool_args and legacy args acceptance, plus negative cases for non-dict inputs: tests/test_tool_request_validation.py.\n- PR description updated with details and test coverage.\n- Attempted to request a GitHub Copilot review, but received 404 (likely permission or feature availability).\n\nKindly:\n- Trigger a Copilot review on this PR if available in this repo, or proceed with human review.\n- Apply appropriate labels (suggested: bug, core, validation, tests).\n- Assign reviewers as you see fit. If you prefer specific maintainers, we can request them explicitly once provided.

… accept legacy args fallback

tests: add/adjust coverage for validator behavior

docs: add Tool Request Schema; link from README and MCP config
@ESP-Geek ESP-Geek closed this by deleting the head repository Apr 7, 2026
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