gastownhall/beads · warning

open unit of work: %w

Error message

open unit of work: %w

What it means

depEdgeFeedback opens a unit of work (transaction) via uowProvider.NewUOW to look up issue titles after dependency edges were written. If opening the UOW fails, the error is wrapped as 'open unit of work: %w' and stored on depAddResult.cycleErr. Because the edges are already durable at this point, this is a post-write feedback failure: the write succeeded, but cycle sweep results or confirmation titles could not be gathered.

Source

Thrown at cmd/bd/dep_proxied_server.go:118

		return res
	}
	if checkCycles {
		res.cycles, res.cycleErr = proxiedCycleReport(ctx)
	}
	if fromID == "" && toID == "" {
		return res
	}

	if uowProvider == nil {
		if res.cycleErr == nil {
			res.cycleErr = errors.New("proxied-server UOW provider not initialized")
		}
		return res
	}
	uw, err := uowProvider.NewUOW(ctx)
	if err != nil {
		if res.cycleErr == nil {
			res.cycleErr = fmt.Errorf("open unit of work: %w", err)
		}
		return res
	}
	defer uw.Close(ctx)

	if fromID != "" {
		res.fromTitle = proxiedLookupTitle(ctx, uw, fromID)
	}
	if toID != "" {
		res.toTitle = proxiedLookupTitle(ctx, uw, toID)
	}
	return res
}

// proxiedCycleReport runs the post-write sweep on the proxied route through the
// cycle role, which opens its own read-only unit of work.
func proxiedCycleReport(ctx context.Context) ([]issueops.Cycle, error) {
	detector, err := proxiedCycleDetector()

View on GitHub (pinned to 71377f2769)

Solutions

  1. Inspect the wrapped cause (%w) for the underlying NewUOW failure — usually a connection or storage error.
  2. Re-run 'bd doctor' or check that the Dolt database / proxied server is reachable.
  3. Verify the dependency edges actually landed with 'bd show <issue>' before treating the command as failed — the write is durable.
  4. If this recurs, check store initialization and rebuild/repair the workspace database.

Example fix

null
Defensive patterns

Strategy: try-catch

Validate before calling

if uowProvider == nil {
    return errors.New("UOW provider not initialized before feedback")
}

Try / catch

res := depEdgeFeedback(ctx, fromID, toID, checkCycles)
if res.cycleErr != nil {
    // edges are already durable; log and continue
    log.Printf("post-write feedback failed: %v", res.cycleErr)
}

Prevention

When it happens

Trigger: Calling any proxied-server dependency command (bd dep add/remove/blocks, bd link) where uowProvider.NewUOW(ctx) returns an error — e.g. the backing database connection is broken, the server is unreachable, or the store was closed before feedback gathering.

Common situations: Database/server connection dropped between the edge write and the feedback read; corrupted or locked Dolt database; running against a proxied server that went down mid-command; unit tests with a provider whose NewUOW always fails.

Related errors


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