feat(rpc): add AllowStale option to List API (bd-dpkdm)

Add AllowStale field to ListArgs struct to support resilient hook detection.
When set, callers signal they accept potentially stale data rather than
failing on staleness check errors.

This enables gastown checkSlungWork() to fall back gracefully when the
beads database is out of sync with JSONL (common after concurrent agent syncs).

- Add AllowStale bool to ListArgs in internal/rpc/protocol.go
- Pass --allow-stale flag through to RPC in cmd/bd/list.go

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Executed-By: beads/crew/dave
Rig: beads
Role: crew
This commit is contained in:
beads/crew/dave
2026-01-09 00:42:13 -08:00
committed by Steve Yegge
parent 6331a9771a
commit 2ee0995f51
2 changed files with 6 additions and 0 deletions

View File

@@ -795,6 +795,9 @@ var listCmd = &cobra.Command{
}
listArgs.Overdue = filter.Overdue
// Pass through --allow-stale flag for resilient queries (bd-dpkdm)
listArgs.AllowStale = allowStale
resp, err := daemonClient.List(listArgs)
if err != nil {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)