{"record":{"id":"5f66a770973316f0","repo":"gastownhall/beads","slug":"no-active-beads-workspace","errorCode":null,"errorMessage":"no active beads workspace","messagePattern":"no active beads workspace","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/dolt.go","lineNumber":474,"sourceCode":"\t\treturn false, err\n\t}\n\t// Deriving the URL comes first and is read-only (`git remote get-url`).\n\t// Workspace resolution is deliberately NOT done yet: selectedDoltBeadsDir\n\t// calls prepareSelectedNoDBContext, which mutates process and on-disk\n\t// workspace state, and nothing may mutate before consent is established.\n\toriginURL, err := gitOriginGetURLForActiveRepo(ctx)\n\tif err != nil || originURL == \"\" {\n\t\treturn false, nil\n\t}\n\tremoteURL := normalizeRemoteURL(originURL)\n\n\tif proceed, err := applyAdoptionConsent(remoteURL, policy, optIn); err != nil || !proceed {\n\t\treturn false, err\n\t}\n\n\tbeadsDir := selectedDoltBeadsDir()\n\tif beadsDir == \"\" {\n\t\treturn false, fmt.Errorf(\"no active beads workspace\")\n\t}\n\n\tif err := st.AddRemote(ctx, \"origin\", remoteURL); err != nil {\n\t\treturn false, err\n\t}\n\n\tif err := config.SetYamlConfigInDir(beadsDir, \"sync.remote\", remoteURL); err != nil {\n\t\treturn false, fmt.Errorf(\"failed to persist sync.remote to config.yaml: %w\", err)\n\t}\n\tfmt.Fprintln(os.Stderr, \"Committing .beads/config.yaml (sync.remote) under your git identity.\")\n\tcommitBeadsConfigForActiveRepo(ctx, \"bd: update sync.remote\")\n\treturn true, nil\n}\n\n// printDivergedHistoryGuidance prints recovery guidance when push/pull fails\n// due to diverged local and remote histories.\nfunc printDivergedHistoryGuidance(operation string) {\n\tfmt.Fprintln(os.Stderr, \"\")","sourceCodeStart":456,"sourceCodeEnd":492,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/dolt.go#L456-L492","documentation":"adoptGitOriginAsRemoteForPush adopts the git 'origin' URL as a Dolt remote during `bd dolt push`. If selectedDoltBeadsDir() returns empty — no active .beads workspace for the current directory — it cannot attach the remote and returns this error. It guards against writing config outside a real workspace.","triggerScenarios":"Running `bd dolt push` (or push flows that call adoptGitOriginRemoteForPush) outside a bd-initialized repository, with a missing .beads directory, or with BD_BEADS_DIR unset and no discoverable workspace.","commonSituations":"Running the command from a subdirectory before workspace discovery applies, after deleting .beads/, or in CI where the repo wasn't checked out with .beads included.","solutions":["Run `bd init` in the repository to create the .beads workspace","cd to the repository root (where .beads lives) and retry","Restore the missing .beads directory (git checkout / restore .beads/config.yaml) if deleted","Set BD_BEADS_DIR to the correct workspace path if you use a non-standard location"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if _, err := os.Stat(filepath.Join(repoRoot, \".beads\")); err != nil {\n  return fmt.Errorf(\"no .beads workspace here; run `bd init` first\")\n}","typeGuard":null,"tryCatchPattern":"added, err := adoptGitOriginRemoteForPush(ctx, st, cfg)\nif err != nil {\n  if err.Error() == \"no active beads workspace\" {\n    // prompt/init workspace then retry push\n  }\n  return err\n}","preventionTips":["Run `bd init` before any dolt sync commands","Run bd from the repository root where .beads lives","Never delete .beads/ manually; use bd tooling","In CI, ensure the checkout includes .beads (not stripped by .gitignore tricks)"],"tags":["dolt","sync","workspace","config"],"backgroundTag":"no-active-beads-workspace","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}