[BUG] find fallback reports a cancelled walk as 'no matches found' #923

Closed
opened 2026-10-27 13:38:18 +00:00 by sam · 0 comments
Owner

runFindGoFallback's walk callback swallows every per-entry error (returns nil to skip inaccessible entries), so the only error that can escape filepath.WalkDir is ctx.Err() from the cancellation select. The guard 'if err != nil && !errors.Is(err, ctx.Err())' therefore never fires: on timeout or /stop the function falls through and returns whatever it had collected, or 'no matches found' when it had collected nothing. This is the same failure the grep exit-code bug had -- the model is told a search found nothing when the search did not finish. Behaviour predates 6d4e0be; the errors.Is autofix in that commit is behaviour-neutral here (errors.Is(err, nil) is false for non-nil err, matching the old err != ctx.Err() when the context is live).

Acceptance Criteria

A find whose context is cancelled mid-walk returns an error result naming the cancellation, not 'no matches found' and not a silently partial list. Regression test in the style of TestGrepReportsSearchFailureRatherThanNoMatches.


Imported from beads archie-core-1786637500149-395-b8fe5929 · GitHub #416 · type bug · priority P2 · created 2026-08-08 · closed 2026-08-08

runFindGoFallback's walk callback swallows every per-entry error (returns nil to skip inaccessible entries), so the only error that can escape filepath.WalkDir is ctx.Err() from the cancellation select. The guard 'if err != nil && !errors.Is(err, ctx.Err())' therefore never fires: on timeout or /stop the function falls through and returns whatever it had collected, or 'no matches found' when it had collected nothing. This is the same failure the grep exit-code bug had -- the model is told a search found nothing when the search did not finish. Behaviour predates 6d4e0be; the errors.Is autofix in that commit is behaviour-neutral here (errors.Is(err, nil) is false for non-nil err, matching the old err != ctx.Err() when the context is live). ### Acceptance Criteria A find whose context is cancelled mid-walk returns an error result naming the cancellation, not 'no matches found' and not a silently partial list. Regression test in the style of TestGrepReportsSearchFailureRatherThanNoMatches. --- _Imported from beads `archie-core-1786637500149-395-b8fe5929` · GitHub #416 · type bug · priority P2 · created 2026-08-08 · closed 2026-08-08_
sam added the mediumbug labels 2026-10-27 13:38:18 +00:00
sam self-assigned this 2026-10-27 13:38:18 +00:00
sam closed this issue 2026-10-27 13:38:18 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#923