(
tool_input: dict[str, Any],
context: ToolContext,
)
| 215 | |
| 216 | |
| 217 | def _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 | |
| 234 | def _bash_call(tool_input: dict[str, Any], context: ToolContext) -> ToolResult: |
nothing calls this directly
no test coverage detected