fix: agent_run nudges unnecessarily when worktree is clean and no push expected #219
Labels
No labels
action
backlog
blocked
bug-report
in-progress
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
tech-debt
underspecified
vision
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#219
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Problem
In lib/agent-sdk.sh agent_run (lines 74-82), when no push is detected after the claude session, the nudge fires regardless of whether the worktree has changes:
The second case is a false positive for agents that work via API (architect, planner) or sessions that correctly determined there's nothing to do. The nudge costs tokens and Claude just explains why there's nothing to push.
Observed
Architect run: no vision issues to decompose, worktree clean, claude correctly finished. Got nudged anyway, spent 12 extra turns at $0.28 explaining why there's nothing to push.
Proposed solution
Skip the nudge when the worktree is completely clean (no changes, no untracked files):
Affected files
Acceptance criteria