fix: strip -p/--print flags in agentic mode so Claude can actually modify files

The agentic invocation path inherited -p (print mode) from _CLAUDE_BASE_ARGS
but only stripped the stdin sentinel "-". Print mode makes Claude a one-shot
text completer that cannot use tools or write files, resulting in zero diffs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
chungyeong
2026-03-13 23:00:40 +09:00
parent b19d174c98
commit ecf44b4c07

View File

@@ -419,8 +419,11 @@ def invoke_agent_agentic(
if agent.reasoning_effort and _supports_reasoning_effort(agent.command): if agent.reasoning_effort and _supports_reasoning_effort(agent.command):
cmd.extend(["-c", f'model_reasoning_effort="{agent.reasoning_effort}"']) cmd.extend(["-c", f'model_reasoning_effort="{agent.reasoning_effort}"'])
# Strip stdin sentinel ("-") from args for agentic mode # Strip print-mode flags and stdin sentinel from args for agentic mode.
args = [a for a in agent.args if a != "-"] # -p / --print makes Claude a one-shot text completer that cannot use tools
# or modify files, which defeats the entire purpose of agentic execution.
_STRIP_FOR_AGENTIC = {"-", "-p", "--print"}
args = [a for a in agent.args if a not in _STRIP_FOR_AGENTIC]
cmd.extend(args) cmd.extend(args)
# System prompt via flag if supported # System prompt via flag if supported