Problem
Currently daemon client operations may hang indefinitely if the daemon is stuck or unresponsive. This makes the CLI fragile for agentic use.
Pattern from Go CLI Books
From "Building Modern CLI Applications in Go" and "Powerful Command-Line Applications in Go":
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
result, err := client.Lease(ctx, secretName)
if errors.Is(err, context.DeadlineExceeded) {
return fmt.Errorf("daemon unresponsive (timeout after 5s)")
}
Action Items
Book References
- Search:
pdf-brain search "timeout context deadline" --fts --expand 2000
- Search:
pdf-brain search "graceful shutdown signal" --fts --expand 2000
Priority
P0 - Critical for robust agentic use
Problem
Currently daemon client operations may hang indefinitely if the daemon is stuck or unresponsive. This makes the CLI fragile for agentic use.
Pattern from Go CLI Books
From "Building Modern CLI Applications in Go" and "Powerful Command-Line Applications in Go":
Action Items
internal/daemon/--timeoutflag to CLI for user overrideBook References
pdf-brain search "timeout context deadline" --fts --expand 2000pdf-brain search "graceful shutdown signal" --fts --expand 2000Priority
P0 - Critical for robust agentic use