From ecf44b4c07c307eb1fd59bb9f0bc9d6acebffb93 Mon Sep 17 00:00:00 2001 From: chungyeong Date: Fri, 13 Mar 2026 23:00:40 +0900 Subject: [PATCH] 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 --- cross_eval/agent.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cross_eval/agent.py b/cross_eval/agent.py index b52acf8..f97d1f7 100644 --- a/cross_eval/agent.py +++ b/cross_eval/agent.py @@ -419,8 +419,11 @@ def invoke_agent_agentic( if agent.reasoning_effort and _supports_reasoning_effort(agent.command): cmd.extend(["-c", f'model_reasoning_effort="{agent.reasoning_effort}"']) - # Strip stdin sentinel ("-") from args for agentic mode - args = [a for a in agent.args if a != "-"] + # Strip print-mode flags and stdin sentinel from args for agentic mode. + # -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) # System prompt via flag if supported