{"record":{"id":"f16f95aa16cd1ea6","repo":"gastownhall/beads","slug":"ambiguous-id-s-matches-d-issues","errorCode":null,"errorMessage":"ambiguous ID: %s matches %d issues","messagePattern":"ambiguous ID: (.+?) matches (.+?) issues","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/wisp.go","lineNumber":383,"sourceCode":"\n// resolvePartialIDDirect resolves a partial ID directly from store\nfunc resolvePartialIDDirect(ctx context.Context, partial string) (string, error) {\n\t// Try direct lookup first\n\tif issue, err := store.GetIssue(ctx, partial); err == nil {\n\t\treturn issue.ID, nil\n\t}\n\t// Search by prefix\n\tissues, err := store.SearchIssues(ctx, \"\", types.IssueFilter{\n\t\tIDs: []string{partial + \"*\"},\n\t})\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif len(issues) == 1 {\n\t\treturn issues[0].ID, nil\n\t}\n\tif len(issues) > 1 {\n\t\treturn \"\", fmt.Errorf(\"ambiguous ID: %s matches %d issues\", partial, len(issues))\n\t}\n\treturn \"\", fmt.Errorf(\"not found: %s\", partial)\n}\n\nvar wispListCmd = &cobra.Command{\n\tUse:   \"list\",\n\tShort: \"List all wisps in current context\",\n\tLong: `List all wisps (ephemeral molecules) in the current context.\n\nWisps are issues with Ephemeral=true in the main database. They are stored\nlocally but not synced via git.\n\nThe list shows:\n  - ID: Issue ID of the wisp\n  - Title: Wisp title\n  - Status: Current status (open, in_progress, closed)\n  - Started: When the wisp was created\n  - Updated: Last modification time","sourceCodeStart":365,"sourceCodeEnd":401,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/wisp.go#L365-L401","documentation":"resolvePartialIDDirect resolves a partial wisp ID by prefix search. If the prefix matches more than one issue, bd refuses to guess and reports the match count so the caller can supply a longer, unambiguous prefix.","triggerScenarios":"`bd wisp create <prefix>` (via runWispCreateCore) where the given prefix matches ≥2 issue IDs.","commonSituations":"Very short prefixes in a database with many similarly-prefixed IDs (e.g. many wisps from the same proto); copy-pasting only the first few characters of an ID.","solutions":["Use a longer ID prefix that matches exactly one issue","Use the full issue ID","Run `bd wisp list` (or bd list) to find the exact ID first"],"exampleFix":"// before\nbd wisp create bd-w1\n// after\nbd wisp create bd-w1a2b3c","handlingStrategy":"validation","validationCode":"matches, err := store.SearchIssues(ctx, \"\", types.IssueFilter{IDs: []string{prefix + \"*\"}})\nif err != nil { return err }\nif len(matches) > 1 {\n    return fmt.Errorf(\"prefix %q is ambiguous (%d matches); use a longer ID\", prefix, len(matches))\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use full IDs in scripts; reserve short prefixes for interactive use","Lengthen the prefix until exactly one issue matches","Resolve IDs via `bd list` before passing them to commands"],"tags":["cli","id-resolution","ambiguity"],"backgroundTag":"ambiguous-id","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}