{"record":{"id":"b6a7008e976c71c7","repo":"gastownhall/beads","slug":"running-contributor-wizard-v","errorCode":null,"errorMessage":"running contributor wizard: %v","messagePattern":"running contributor wizard: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/init.go","lineNumber":1881,"sourceCode":"\t\t\t\t// Explicit --role flag overrides existing role\n\t\t\t\tif err := setBeadsRole(role); err != nil && !quiet {\n\t\t\t\t\tfmt.Fprintf(os.Stderr, \"Warning: failed to set beads.role: %v\\n\", err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Run contributor wizard if --contributor flag is set or user chose contributor\n\t\tif contributor {\n\t\t\tif err := runContributorWizard(ctx, store); err != nil {\n\t\t\t\tcanceled := isCanceled(err)\n\t\t\t\tif canceled {\n\t\t\t\t\tfmt.Fprintln(os.Stderr, \"Setup canceled.\")\n\t\t\t\t}\n\t\t\t\t_ = store.Close()\n\t\t\t\tif canceled {\n\t\t\t\t\treturn errCanceled()\n\t\t\t\t}\n\t\t\t\treturn fmt.Errorf(\"running contributor wizard: %v\", err)\n\t\t\t}\n\n\t\t\t// Contributor setup must also pin role detection to contributor.\n\t\t\t// Without this, SSH remotes can be inferred as maintainer and bypass routing.\n\t\t\tif isGitRepo() {\n\t\t\t\tif err := setBeadsRole(\"contributor\"); err != nil && !quiet {\n\t\t\t\t\tfmt.Fprintf(os.Stderr, \"Warning: failed to set beads.role=contributor: %v\\n\", err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Run team wizard if --team flag is set\n\t\tif team {\n\t\t\tif err := runTeamWizard(ctx, store); err != nil {\n\t\t\t\tcanceled := isCanceled(err)\n\t\t\t\tif canceled {\n\t\t\t\t\tfmt.Fprintln(os.Stderr, \"Setup canceled.\")\n\t\t\t\t}","sourceCodeStart":1863,"sourceCodeEnd":1899,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/init.go#L1863-L1899","documentation":"In contributor mode, `bd init` runs an interactive setup wizard (contributor wizard) that configures the repo for contributing (remotes, auth, role). If the wizard returns a non-cancellation error, bd closes the store and wraps it with this message; an explicit user cancellation is reported as errCanceled instead.","triggerScenarios":"promptContributorMode leads to running the contributor wizard; the wizard function returns err where canceled == false during `bd init`.","commonSituations":"Non-interactive terminal (no TTY) when bd init is run in CI or piped, user aborts an auth step, git remote missing or unreachable while the wizard probes it, or SSH keys not set up so setup steps fail.","solutions":["Re-run bd init in an interactive terminal with a TTY","Check the wrapped %v error — fix the specific setup step (e.g. add a git remote, set up SSH)","If run non-interactively, skip wizard mode or pre-configure the remote/role manually","Press the proper cancel key if you intended to abort (yields errCanceled, not this error)"],"exampleFix":"// before (fails in CI, no TTY)\n$ ci-runner exec bd init --contributor\n// after\n$ bd init --contributor   # run locally in an interactive shell\n# or pre-set: bd config set beads.role contributor","handlingStrategy":"try-catch","validationCode":"[ -t 0 ] && [ -t 1 ] || echo \"no TTY — contributor wizard will fail; run interactively\"\ngit remote -v | grep -q origin || echo \"no git remote configured\"","typeGuard":null,"tryCatchPattern":"if ! bd init --contributor; then\n  case $? in 0) ;; *) echo \"wizard failed — run interactively or configure remote/role manually\";; esac\nfi","preventionTips":["Run init in an interactive terminal with a TTY","Configure git remote and SSH keys before the wizard","Pre-set beads.role when automating (bd config set beads.role contributor)","Distinguish cancellation (intentional) from real wizard failures in scripts"],"tags":["init","wizard","interactive","setup"],"backgroundTag":"setup-wizard-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}