From 2ee0995f513bc3ec032c0e61a323d0fdaec23eec Mon Sep 17 00:00:00 2001 From: beads/crew/dave Date: Fri, 9 Jan 2026 00:42:13 -0800 Subject: [PATCH] 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 Executed-By: beads/crew/dave Rig: beads Role: crew --- cmd/bd/list.go | 3 +++ internal/rpc/protocol.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/cmd/bd/list.go b/cmd/bd/list.go index 0127e585..565823ad 100644 --- a/cmd/bd/list.go +++ b/cmd/bd/list.go @@ -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) diff --git a/internal/rpc/protocol.go b/internal/rpc/protocol.go index 347f15ef..362292cb 100644 --- a/internal/rpc/protocol.go +++ b/internal/rpc/protocol.go @@ -255,6 +255,9 @@ type ListArgs struct { DueAfter string `json:"due_after,omitempty"` // ISO 8601 format DueBefore string `json:"due_before,omitempty"` // ISO 8601 format Overdue bool `json:"overdue,omitempty"` // Filter issues where due_at < now + + // Staleness control (bd-dpkdm) + AllowStale bool `json:"allow_stale,omitempty"` // Skip staleness check, return potentially stale data } // CountArgs represents arguments for the count operation