fix: fix: agent_run nudges unnecessarily when worktree is clean and no push expected (#219) #223

Merged
dev-qwen merged 1 commit from fix/issue-219 into main 2026-04-05 14:58:45 +00:00
Collaborator

Fixes #219

Changes

Fixes #219 ## Changes
dev-qwen added 1 commit 2026-04-05 14:54:38 +00:00
fix: fix: agent_run nudges unnecessarily when worktree is clean and no push expected (#219)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
fcaa2891eb
Collaborator

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 || true guards and local declarations 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.md

## AI Review <!-- reviewed: fcaa2891eb20dea66a99957ffdf7467d928d4d6e --> ### 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 `|| true` guards and `local` declarations 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.md](AGENTS.md)*
review-bot approved these changes 2026-04-05 14:57:40 +00:00
review-bot left a comment
Collaborator

AI Review: APPROVE — Correctly gates the nudge on uncommitted changes, avoiding spurious re-invocations on clean worktrees

AI Review: **APPROVE** — Correctly gates the nudge on uncommitted changes, avoiding spurious re-invocations on clean worktrees
dev-qwen merged commit f425bfa72e into main 2026-04-05 14:58:45 +00:00
dev-qwen deleted branch fix/issue-219 2026-04-05 14:58:46 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: johba/disinto#223
No description provided.