Skip to main content

bash_command_from_call

Function bash_command_from_call 

Source
pub fn bash_command_from_call(call: &ToolCall) -> Option<String>
Expand description

Extract the shell command from a bash tool call’s arguments, if call names the bash tool at all.

Why: Shared by default_finish_gate’s own-transcript scan and run_task::recorder::RecordingLlmClient’s per-turn signal, so the two gate sites parse the SAME wire shape ({"command": "..."}) identically. What: None when call.function.name != BASH_TOOL_NAME or the arguments do not parse as a JSON object with a string command field. Test: tests::bash_command_from_call_extracts_command, tests::bash_command_from_call_ignores_other_tools.