feat: bd list defaults to non-closed issues with 50 limit (GH#788)

Changes:
- Default to excluding closed issues (use --all to include)
- Default limit of 50 issues (use --limit 0 for unlimited)
- --all flag now overrides the closed filter

This addresses agent context blowout from seeing hundreds of closed issues.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-29 17:53:57 -08:00
parent a7f34d8f89
commit 34e2548c86
6 changed files with 48 additions and 2 deletions

View File

@@ -1604,6 +1604,16 @@ func (s *SQLiteStorage) SearchIssues(ctx context.Context, query string, filter t
args = append(args, types.StatusTombstone)
}
// Status exclusion (for default non-closed behavior, GH#788)
if len(filter.ExcludeStatus) > 0 {
placeholders := make([]string, len(filter.ExcludeStatus))
for i, s := range filter.ExcludeStatus {
placeholders[i] = "?"
args = append(args, string(s))
}
whereClauses = append(whereClauses, fmt.Sprintf("status NOT IN (%s)", strings.Join(placeholders, ",")))
}
if filter.Priority != nil {
whereClauses = append(whereClauses, "priority = ?")
args = append(args, *filter.Priority)

View File

@@ -998,6 +998,16 @@ func (t *sqliteTxStorage) SearchIssues(ctx context.Context, query string, filter
args = append(args, types.StatusTombstone)
}
// Status exclusion (for default non-closed behavior, GH#788)
if len(filter.ExcludeStatus) > 0 {
placeholders := make([]string, len(filter.ExcludeStatus))
for i, s := range filter.ExcludeStatus {
placeholders[i] = "?"
args = append(args, string(s))
}
whereClauses = append(whereClauses, fmt.Sprintf("status NOT IN (%s)", strings.Join(placeholders, ",")))
}
if filter.Priority != nil {
whereClauses = append(whereClauses, "priority = ?")
args = append(args, *filter.Priority)