Skip to content

Re-arm needs-input after a settle clear when a new prompt appears - #1065

Open
anutron wants to merge 1 commit into
masterfrom
argus/hera-askUserQuestion/fix-needs-input-miss
Open

anutron wants to merge 1 commit into
masterfrom
argus/hera-askUserQuestion/fix-needs-input-miss

Conversation

@anutron

@anutron anutron commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Problem

Workers parked on a Claude Code permission prompt or AskUserQuestion widget often showed no needs-input indicator.

Root cause (from real session logs)

Replaying a Sketch worker's real session log (permission prompt with a "Tab to amend" footer) through the production detector showed the detection was correct: the selection shape matched, there was no working affordance, and the fingerprint was stable. The flag was swallowed by state. An earlier prompt in the same session had been cleared by the BUG-072 settle path. That clear records a cleared marker with no content fingerprint, because the tail had no prompt on it by then. The stale-re-detection guard then fell back to timestamp-only suppression. With nobody typing, the last-input timestamp never advanced, so every later prompt was suppressed until a keystroke.

Fix

ClearedMarker gains Settled. A settled, fingerprint-less marker re-arms when the new candidacy has a fingerprint, because the signal was absent from a genuinely idle tail first. Other fingerprint-less markers keep the old suppression, so BUG-063 stays covered. The change is in the shared agent.NeedsInputClear, so the TUI, the daemon push watcher, and the web and macOS clients all get it.

Tests

  • TestDetectNeedsInputSticky_SettledClearDoesNotSwallowLaterPermissionPrompt replays trimmed real bytes (internal/tui/testdata/needsinput). It fails without the fix and passes with it.
  • Unit subtest in NeedsInputClear.
  • make pre-pr: build, vet, fmt-check, lint-pr and test-cover-gate pass. make vuln fails on stdlib CVEs, which CI treats as advisory. The cover gate was run with the worker's ARGUS_* env unset because of the known internal/agent profile-env test contamination.

Spec delta archived in this PR (idle-detection); gotcha added to events.md.

🤖 Generated with Claude Code

A settle clear records a cleared marker with no fingerprint, so the
timestamp-only guard swallowed every later permission/AskUserQuestion prompt
until a keystroke. Mark the marker Settled and re-arm when a fingerprint is
available. Real-bytes regression test, spec delta archived, gotcha added.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/drn/argus/internal/agent 90.64% (+0.01%) 👍
github.com/drn/argus/internal/tui 84.07% (+0.01%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/drn/argus/internal/agent/needsinput.go 93.31% (+0.06%) 344 (+3) 321 (+3) 23 👍

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/drn/argus/internal/agent/needsinput_test.go
  • github.com/drn/argus/internal/tui/needsinput_realbytes_test.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant