MCPcopy Create free account
hub / github.com/1jehuang/jcode / run_debug_command

Function run_debug_command

scripts/benchmark_discovery.py:331–354  ·  view source on GitHub ↗
(
    args: argparse.Namespace,
    socket_path: Path,
    command: str,
    argument: str | None = None,
    session_id: str | None = None,
    timeout: float = 30,
)

Source from the content-addressed store, hash-verified

329
330
331def run_debug_command(
332 args: argparse.Namespace,
333 socket_path: Path,
334 command: str,
335 argument: str | None = None,
336 session_id: str | None = None,
337 timeout: float = 30,
338) -> str:
339 invocation = [args.jcode, "--socket", str(socket_path), "debug"]
340 if session_id:
341 invocation += ["-S", session_id]
342 invocation.append(command)
343 if argument is not None:
344 invocation.append(argument)
345 result = subprocess.run(
346 invocation,
347 capture_output=True,
348 text=True,
349 env=benchmark_environment(socket_path),
350 timeout=timeout,
351 )
352 if result.returncode != 0:
353 raise BenchmarkError(result.stderr.strip() or result.stdout.strip() or f"debug command failed: {command}")
354 return result.stdout.strip()
355
356
357def fetch_catalog_via_jcode(

Callers 1

fetch_catalog_via_jcodeFunction · 0.70

Calls 3

benchmark_environmentFunction · 0.85
BenchmarkErrorClass · 0.85
runMethod · 0.45

Tested by

no test coverage detected