gastownhall/beads · error

resolving issue ID %s: %w

Error message

resolving issue ID %s: %w

What it means

proxiedTreeTarget resolves a user-supplied issue reference (possibly a partial ID) to a full root ID using utils.ResolvePartialID inside an opened unit of work. When resolution fails — the reference is ambiguous, malformed, or matches no issue — the error is wrapped as 'resolving issue ID %s: %w' and returned to resolveTreeTarget.

Source

Thrown at cmd/bd/dep_tree.go:67

	}
	return treeTarget{rootID: rootID, walker: walker, cleanup: cleanup}, nil
}

// proxiedTreeTarget resolves the argument against the proxied server and hands
// back the provider's tree surface.
//
// THIS ROUTE GAINS PARTIAL-ID RESOLUTION, which it has never had: it passed the
// argument to the use case verbatim, so `bd dep tree a1b2` worked on a direct
// workspace and failed on a team server.
func proxiedTreeTarget(ctx context.Context, arg string) (treeTarget, error) {
	uw, err := proxiedOpenReadUOW(ctx)
	if err != nil {
		return treeTarget{}, err
	}
	rootID, err := utils.ResolvePartialID(ctx, uowMolReader{uw: uw}, arg)
	uw.Close(ctx)
	if err != nil {
		return treeTarget{}, fmt.Errorf("resolving issue ID %s: %w", arg, err)
	}
	if uowProvider == nil {
		return treeTarget{}, errors.New("proxied-server UOW provider not initialized")
	}
	src, ok := uowProvider.(uow.TreeWalkerSource)
	if !ok {
		return treeTarget{}, fmt.Errorf("proxied-server provider %T does not offer the dependency-tree surface", uowProvider)
	}
	walker, err := src.TreeWalker()
	if err != nil {
		return treeTarget{}, err
	}
	return treeTarget{rootID: rootID, walker: walker, cleanup: func() {}}, nil
}

// runDepTree is the whole of `bd dep tree` on both routes.
func runDepTree(cmd *cobra.Command, ctx context.Context, args []string) error {
	maxDepth, _ := cmd.Flags().GetInt("max-depth")

View on GitHub (pinned to 71377f2769)

Solutions

  1. Run 'bd list' or search to find the exact issue ID and pass the full ID.
  2. Lengthen the partial ID prefix so it matches exactly one issue.
  3. Confirm you are in the correct workspace (.beads directory) containing the target issue.
  4. Check the wrapped cause to distinguish 'not found' from 'ambiguous' resolution errors.

Example fix

// before
bd dep tree bd-a1
// after (use a disambiguating, or full, prefix)
bd dep tree bd-a1b2c3d4
Defensive patterns

Strategy: validation

Validate before calling

// verify the issue exists before invoking tree commands
if err := exec.Command("bd", "show", arg).Run(); err != nil {
    return fmt.Errorf("issue %q not found; run 'bd list' for valid IDs", arg)
}

Try / catch

target, err := resolveTreeTarget(ctx, arg)
if err != nil {
    return fmt.Errorf("cannot resolve %q: %w; use a longer prefix or full ID", arg, err)
}

Prevention

When it happens

Trigger: Passing an argument to a tree command (bd dep tree <arg>) where ResolvePartialID cannot find a unique match: a nonexistent prefix, an ambiguous prefix matching multiple issues, or an empty/closed database returning no candidates.

Common situations: Typing a partial ID that no longer exists (issue deleted or imported with different hash prefix); ambiguous prefixes when many issues share a prefix; running in the wrong workspace directory so the target issue is not in this database.

Related errors


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