fix: fix: agent_run nudges unnecessarily when worktree is clean and no push expected (#219) #223
No reviewers
Labels
No labels
action
backlog
blocked
in-progress
priority
tech-debt
underspecified
vision
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: johba/disinto#223
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-219"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #219
Changes
AI Review
Summary\n\nThis PR fixes #219 by only nudging the agent when there are actual uncommitted changes to commit and push. Previously, the nudge was unconditionally fired whenever no push was detected — including on a clean worktree — resulting in a wasted claude invocation that told the agent to "Complete the implementation, commit, and push" when there was nothing to do.\n\n### Review\n\nThe logic change is correct:\n\n- Before:
if [ -z "$has_pushed" ]→ always nudge (two message variants), regardless of whether the tree was clean.\n- After:if [ -z "$has_pushed" ] && [ -n "$has_changes" ]→ nudge only when uncommitted changes exist; log and skip otherwise.\n\nThe clean-worktree / no-push case is now silently skipped with a log line, which is the right call — the agent may have completed a read-only task, or the branch is simply up-to-date with no code changes needed.\n\nNo bash quoting issues, no ShellCheck violations, no dead code left behind. The|| trueguards andlocaldeclarations are consistent with the rest of the file. CI passed.Verdict
APPROVE — Correctly gates the nudge on uncommitted changes, avoiding spurious re-invocations on clean worktrees
Reviewed at
fcaa289| AGENTS.mdAI Review: APPROVE — Correctly gates the nudge on uncommitted changes, avoiding spurious re-invocations on clean worktrees