fix: capture_diff uses base commit to handle agent self-commits
Claude in agentic mode (interactive, no -p flag) commits its own changes, advancing HEAD. This made `git diff --cached HEAD` return empty, triggering false EMPTY_DIFF errors every time. Now capture_diff diffs against the base commit SHA recorded at worktree creation, so changes are captured regardless of whether the agent committed them. Also adds UX_IMPROVEMENT_PLAN.md for guided message improvements. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -414,6 +414,7 @@ def invoke_agent_agentic(
|
||||
env: Optional[dict[str, str]] = None,
|
||||
timeout: int | None = None,
|
||||
quiet: bool = False,
|
||||
base_commit: str | None = None,
|
||||
) -> AgentResult:
|
||||
"""Invoke an agent in agentic mode using the worktree as the source of truth."""
|
||||
from cross_eval.worktree import capture_diff
|
||||
@@ -506,8 +507,8 @@ def invoke_agent_agentic(
|
||||
suggested_action=suggested_action,
|
||||
)
|
||||
|
||||
# Capture git diff as the output (changes since last commit on the branch)
|
||||
diff_output = capture_diff(worktree_path)
|
||||
# Capture git diff as the output (changes since the base commit)
|
||||
diff_output = capture_diff(worktree_path, base_commit=base_commit)
|
||||
|
||||
if not diff_output:
|
||||
stdout_excerpt = (result.stdout or "").strip()
|
||||
|
||||
Reference in New Issue
Block a user