Fallback heuristic: commands likely to take > 30s.
(tool_name: str, tool_input: dict)
| 267 | |
| 268 | |
| 269 | def is_slow_operation(tool_name: str, tool_input: dict) -> bool: |
| 270 | """Fallback heuristic: commands likely to take > 30s.""" |
| 271 | if tool_name != "bash": |
| 272 | return False |
| 273 | cmd = tool_input.get("command", "").lower() |
| 274 | slow_keywords = ["install", "build", "test", "deploy", "compile", |
| 275 | "docker build", "pip install", "npm install", |
| 276 | "cargo build", "pytest", "make"] |
| 277 | return any(kw in cmd for kw in slow_keywords) |
| 278 | |
| 279 | |
| 280 | def should_run_background(tool_name: str, tool_input: dict) -> bool: |
no test coverage detected