mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-11-03 04:06:16 +00:00
Expand §§include(path) recursively at the tool execution boundary so Chat, native Responses, and parallel calls receive file contents even without streaming. Mutate the original argument dictionary so both execution kwargs and tool.args receive the expanded values. Run expansion before tool-policy checks and secret unmasking. Preserve unreadable-file placeholders, add regression coverage, and document hook ordering. Validation: 133 focused tests passed in the a0 conda environment; seven targeted tests passed in the live localhost:32081 container's framework runtime. Full-suite and LLM-driven UI testing were not run.
1.4 KiB
1.4 KiB
Tool Execute Before Extensions DOX
Purpose
- Own backend processing immediately before tool execution.
Ownership
- Ordered Python files own file-include expansion, prior tool-output replacement, parallel recursion guards, and secret unmasking before execution.
Local Contracts
- Unmask only values required by the target tool.
- Preserve safety checks and do not expose secrets to logs or unrelated tools.
- Keep ordering stable where replacement must occur before unmasking or execution.
_05_replace_include_alias.pyexpands§§include(path)recursively in argument values before tool-policy checks and secret unmasking. Mutate the original argument dictionary so bothtool.argsand execution kwargs receive file contents; unreadable files keep their placeholders throughhelpers.strings.replace_file_includes.- Execution expansion must work without response streaming for Chat, native Responses calls, and parallel workers; the response-stream hook remains display-only.
Work Guidance
- Coordinate with secret handling, tool argument preparation, and plugin tool gates.
Verification
- Smoke-test tool execution with masked secret arguments and prior-output references after changes.
- Run
pytest tests/test_tool_file_includes.py tests/test_parallel_tool_args.py -qfor include expansion, hook ordering, and shared argument mutation.
Child DOX Index
No child DOX files.