gastownhall/beads · error

determining blocked wisps for age GC

Error message

determining blocked wisps for age GC: %w

What it means

Wisp age GC must exclude blocked wisps from abandonment detection. If querying the blocked-issue set via r.GetBlockedIssues fails, findAbandonedWisps aborts with this wrapped error instead of proceeding with an incomplete picture that could GC live, blocked wisps.

Solutions

  1. Check database connectivity and retry `bd wisp gc`
  2. Investigate the wrapped inner error for the storage/driver root cause
  3. Run GC when the database is not under heavy write load
Defensive patterns

Strategy: retry

Validate before calling

if err := ctx.Err(); err != nil { return err }
if _, err := r.GetBlockedIssues(ctx, types.WorkFilter{}); err != nil {
    return fmt.Errorf("cannot determine blocked set; aborting GC: %w", err)
}

Try / catch

if err := runWispGC(ctx); err != nil {
    if strings.Contains(err.Error(), "determining blocked wisps for age GC") {
        // back off and retry; do not GC with an incomplete blocked set
    }
}

Prevention

When it happens

Trigger: runWispGC or runWispGCProxiedServer → findAbandonedWisps → r.GetBlockedIssues(ctx, types.WorkFilter{}) returns a driver/store error.

Common situations: Database unavailable or locked during scheduled GC; large dependency graphs timing out the blocked-issues query; proxied-server storage errors.

Related errors


AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30). Data as JSON: /api/errors/9de215ea146712ec. Report an issue: GitHub.

Appendix: source

Thrown at cmd/bd/wisp.go:838

	}
	return nil
}

func findAbandonedWisps(ctx context.Context, r molReader, cleanAll bool, ageThreshold time.Duration, excludeTypes []types.IssueType) ([]*types.Issue, error) {
	ephemeralFlag := true
	filter := types.IssueFilter{
		Ephemeral:    &ephemeralFlag,
		ExcludeTypes: excludeTypes,
		Limit:        5000,
	}
	issues, err := r.SearchIssues(ctx, "", filter)
	if err != nil {
		return nil, err
	}

	blocked, err := r.GetBlockedIssues(ctx, types.WorkFilter{})
	if err != nil {
		return nil, fmt.Errorf("determining blocked wisps for age GC: %w", err)
	}
	blockedSet := make(map[string]bool, len(blocked))
	for _, b := range blocked {
		blockedSet[b.ID] = true
	}

	protectedStatuses, err := protectedWispStatuses(ctx, r)
	if err != nil {
		return nil, err
	}

	now := time.Now()
	var abandoned []*types.Issue
	for _, issue := range issues {
		if r.IsInfraTypeCtx(ctx, issue.IssueType) {
			continue
		}
		if issue.Status == types.StatusClosed && !cleanAll {

View on GitHub (pinned to 71377f2769)