oliver-zehentleitner / maity

runner: interactive Claude Code exits at once, the start prompt is read as an MCP config path

Sign in to report

tsk-brmfpj0mc5w0 Done An agent

First runner test, 2026-11-09 (home-vm, CLI 0.1.0a6, Claude Code 2.1.319, placement plc-7kpdvc6359ng, mode interactive). Claude Code exits with code 1 within ~10 s, in a restart loop. maity runner logs shows:
Error: Invalid MCP configuration: MCP config file not found: <workspace>/This clone is a Maity project. Run maity resume now …

Cause (from the code, confirm with a test): cli/src/maity/runner/adapters.py _claude_code builds [..., "--strict-mcp-config", "--mcp-config", str(mcp), START_PROMPT]. Claude Code's --mcp-config takes several values, so the trailing prompt is read as a second config file. Supervised mode is not hit, because -p follows and ends the list.

Fix:

  • End the option list before the prompt: --mcp-config=<path>, or -- before START_PROMPT. Check which form the supported Claude Code versions accept.
  • Add a test that the interactive argv ends the variadic option before the prompt. Better still, a smoke test against a real claude --help, if one is on the runner probe path.

Priority: before tsk-sx6wt2yjqzjx. It blocks Oliver's first runner agent. Ship in the next CLI release (0.1.0a7 is not tagged yet, so check with me whether it goes into that release).