(repo_name: str, repo_path: str, tool: str, queries: list[dict], log)
| 34 | |
| 35 | |
| 36 | def run_tool_fresh(repo_name: str, repo_path: str, tool: str, queries: list[dict], log) -> None: |
| 37 | cli = McpClient(repo_path) |
| 38 | try: |
| 39 | for query in queries: |
| 40 | resp, dt = cli.call(tool, query, timeout=TIMEOUT) |
| 41 | st, detail = classify(resp, dt) |
| 42 | log.write(f"{repo_name}\t{tool}\t{json.dumps(query)[:120]}\t{st}\t{detail}\n") |
| 43 | log.flush() |
| 44 | if st == "TIMEOUT": |
| 45 | # The server is busy with the timed-out call; no point queuing more. |
| 46 | break |
| 47 | finally: |
| 48 | cli.close() |
| 49 | |
| 50 | |
| 51 | def main() -> int: |