MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / _bash_validate_input

Function _bash_validate_input

src/tool_system/tools/bash/bash_tool.py:217–231  ·  view source on GitHub ↗
(
    tool_input: dict[str, Any],
    context: ToolContext,
)

Source from the content-addressed store, hash-verified

215
216
217def _bash_validate_input(
218 tool_input: dict[str, Any],
219 context: ToolContext,
220) -> ValidationResult:
221 command = (tool_input or {}).get("command", "")
222 sleep_pattern = detect_blocked_sleep_pattern(command)
223 if sleep_pattern is not None:
224 return ValidationResult.fail(
225 f"Blocked: {sleep_pattern}. Run blocking commands in the background "
226 "with run_in_background: true -- you'll get a completion notification "
227 "when done. If you genuinely need a delay (rate limiting, deliberate "
228 "pacing), keep it under 2 seconds.",
229 error_code=10,
230 )
231 return ValidationResult.ok()
232
233
234def _bash_call(tool_input: dict[str, Any], context: ToolContext) -> ToolResult:

Callers

nothing calls this directly

Calls 4

getMethod · 0.45
failMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected