{"record":{"id":"c72c94a4d6096bbd","repo":"gastownhall/beads","slug":"resolving-issue-id-s-w-c72c94","errorCode":null,"errorMessage":"resolving issue ID %s: %w","messagePattern":"resolving issue ID (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/dep_tree.go","lineNumber":67,"sourceCode":"\t}\n\treturn treeTarget{rootID: rootID, walker: walker, cleanup: cleanup}, nil\n}\n\n// proxiedTreeTarget resolves the argument against the proxied server and hands\n// back the provider's tree surface.\n//\n// THIS ROUTE GAINS PARTIAL-ID RESOLUTION, which it has never had: it passed the\n// argument to the use case verbatim, so `bd dep tree a1b2` worked on a direct\n// workspace and failed on a team server.\nfunc proxiedTreeTarget(ctx context.Context, arg string) (treeTarget, error) {\n\tuw, err := proxiedOpenReadUOW(ctx)\n\tif err != nil {\n\t\treturn treeTarget{}, err\n\t}\n\trootID, err := utils.ResolvePartialID(ctx, uowMolReader{uw: uw}, arg)\n\tuw.Close(ctx)\n\tif err != nil {\n\t\treturn treeTarget{}, fmt.Errorf(\"resolving issue ID %s: %w\", arg, err)\n\t}\n\tif uowProvider == nil {\n\t\treturn treeTarget{}, errors.New(\"proxied-server UOW provider not initialized\")\n\t}\n\tsrc, ok := uowProvider.(uow.TreeWalkerSource)\n\tif !ok {\n\t\treturn treeTarget{}, fmt.Errorf(\"proxied-server provider %T does not offer the dependency-tree surface\", uowProvider)\n\t}\n\twalker, err := src.TreeWalker()\n\tif err != nil {\n\t\treturn treeTarget{}, err\n\t}\n\treturn treeTarget{rootID: rootID, walker: walker, cleanup: func() {}}, nil\n}\n\n// runDepTree is the whole of `bd dep tree` on both routes.\nfunc runDepTree(cmd *cobra.Command, ctx context.Context, args []string) error {\n\tmaxDepth, _ := cmd.Flags().GetInt(\"max-depth\")","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/dep_tree.go#L49-L85","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Run 'bd list' or search to find the exact issue ID and pass the full ID.","Lengthen the partial ID prefix so it matches exactly one issue.","Confirm you are in the correct workspace (.beads directory) containing the target issue.","Check the wrapped cause to distinguish 'not found' from 'ambiguous' resolution errors."],"exampleFix":"// before\nbd dep tree bd-a1\n// after (use a disambiguating, or full, prefix)\nbd dep tree bd-a1b2c3d4","handlingStrategy":"validation","validationCode":"// verify the issue exists before invoking tree commands\nif err := exec.Command(\"bd\", \"show\", arg).Run(); err != nil {\n    return fmt.Errorf(\"issue %q not found; run 'bd list' for valid IDs\", arg)\n}","typeGuard":null,"tryCatchPattern":"target, err := resolveTreeTarget(ctx, arg)\nif err != nil {\n    return fmt.Errorf(\"cannot resolve %q: %w; use a longer prefix or full ID\", arg, err)\n}","preventionTips":["Pass full issue IDs in scripts; reserve partial IDs for interactive use.","Use 'bd list' to confirm the exact ID before tree operations.","Run commands from inside the workspace that contains the target issue.","Prefer unambiguous prefixes (8+ chars) when partial IDs are unavoidable."],"tags":["go","issue-resolution","cli-input","partial-id"],"backgroundTag":"partial-id-resolution-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}