MCPcopy
hub / github.com/shareAI-lab/learn-claude-code / should_run_background

Function should_run_background

s13_background_tasks/code.py:329–333  ·  view source on GitHub ↗

Model explicit request takes priority; fallback to heuristic.

(tool_name: str, tool_input: dict)

Source from the content-addressed store, hash-verified

327
328
329def should_run_background(tool_name: str, tool_input: dict) -> bool:
330 """Model explicit request takes priority; fallback to heuristic."""
331 if tool_input.get("run_in_background"):
332 return True
333 return is_slow_operation(tool_name, tool_input)
334
335
336def execute_tool(block) -> str:

Callers 1

agent_loopFunction · 0.70

Calls 2

is_slow_operationFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected