ZIm/crates/assistant_tools
Mani Rash Ahmadi 68e0105627
Agent: Include partial output if terminal tool fails (#29115)
This PR addresses the behavior of the agent's terminal tool when the
executed command is interrupted or fails after producing some output.
Currently, if the command doesn't finish successfully, any partial
output captured before the interruption/failure is discarded, and only
an error message (or a generic cancellation message) is returned to the
LLM.

This change modifies the `run_command_limited` function in the terminal
tool to catch errors when awaiting the command's status (which includes
interruptions). In the case of such an error, it now includes any
partial stdout/stderr captured up to that point within the error message
returned to the `ToolUseState`. This ensures the LLM receives the
partial context even when the command doesn't complete cleanly, framed
appropriately as part of an error/interruption message.

Closes #29101

Release Notes:

- N/A
2025-04-28 12:25:11 -03:00
..
src Agent: Include partial output if terminal tool fails (#29115) 2025-04-28 12:25:11 -03:00
Cargo.toml agent: Render path search results with ToolCard (#28894) 2025-04-25 14:42:51 -03:00
LICENSE-GPL Factor tool definitions out of assistant (#21189) 2024-11-25 18:26:34 -05:00