{"record":{"id":"6b1be1a62465a89c","repo":"gastownhall/beads","slug":"remote-adoption-declined-nothing-was-written-and","errorCode":null,"errorMessage":"remote adoption declined; nothing was written and nothing was pushed","messagePattern":"remote adoption declined; nothing was written and nothing was pushed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/bd/dolt_remote_adopt.go","lineNumber":155,"sourceCode":"// applyAdoptionConsent is the gate as the push path uses it: given a derived\n// URL and a policy, either return proceed=true (everything after this may\n// write) or stop. It is separated from adoptGitOriginRemoteForPush so the\n// fail-closed behavior can be asserted without resolving a workspace — that\n// resolution mutates whatever repo the test binary runs in, which is exactly\n// what the syncAdoptGitOrigin seam comment in sync.go warns about.\n//\n// proceed=false with err=nil is the deliberate --no-adopt case: the caller\n// falls through to its ordinary no-remote handling rather than failing.\nfunc applyAdoptionConsent(remoteURL string, policy adoptPolicy, optIn adoptOptIn) (bool, error) {\n\tswitch decision, refusal := decideRemoteAdoption(policy); decision {\n\tcase adoptRefuse:\n\t\tif refusal == adoptRefusedNonInteractive {\n\t\t\treturn false, adoptionRefusedError(remoteURL, optIn)\n\t\t}\n\t\treturn false, nil\n\tcase adoptAsk:\n\t\tif !confirmRemoteAdoption(remoteURL, optIn) {\n\t\t\treturn false, fmt.Errorf(\"remote adoption declined; nothing was written and nothing was pushed\")\n\t\t}\n\t\treturn true, nil\n\tdefault: // adoptProceed\n\t\t// --yes: consent given ahead of time. Still announce the target, so a\n\t\t// scripted run leaves a record of where it uploaded.\n\t\tfmt.Fprintf(os.Stderr, \"Adopting Dolt remote origin from git origin: %s\\n\", remoteURL)\n\t\treturn true, nil\n\t}\n}\n\n// confirmRemoteAdoption asks, showing the URL and every side effect that\n// follows a yes. The config.yaml commit is named here because it is made under\n// the user's git identity in their repo, which is a surprise worth disclosing\n// before the fact rather than in a line printed after it happened (#5068\n// acceptance item 4).\nfunc confirmRemoteAdoption(remoteURL string, optIn adoptOptIn) bool {\n\tfmt.Fprintln(os.Stderr, \"\")\n\tfmt.Fprintln(os.Stderr, \"No Dolt remote is configured for this rig.\")","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/dolt_remote_adopt.go#L137-L173","documentation":"This error is returned when the user explicitly declines the interactive prompt to adopt the git-origin-derived Dolt remote. Nothing was written or pushed, so it is a clean abort rather than a fault — but it is surfaced as an error so callers stop the push flow. The message reassures that no state changed.","triggerScenarios":"applyAdoptionConsent with optIn == adoptAsk (e.g. --yes not passed, interactive TTY present), confirmRemoteAdoption prompts, and the user answers no.","commonSituations":"User accidentally triggered push, hesitates at the consent prompt, and declines; automation wrapping an interactive session that feeds a non-affirmative answer to the prompt.","solutions":["If declining was intentional, configure the remote explicitly with bd dolt remote add origin <url> and retry","If declining was accidental, re-run the push and answer yes at the adoption prompt, or use --yes","Suppress the prompt entirely for scripts by passing --yes or setting BD_NO_REMOTE_ADOPT=1 with a pre-configured remote"],"exampleFix":"// before\nbd push  # prompt: adopt origin? -> no\n// after\nbd push  # answer yes, or: bd push --yes","handlingStrategy":"try-catch","validationCode":"if !interactive() && optIn == adoptAsk {\n    return errors.New(\"cannot prompt for remote adoption in non-interactive mode; pass --yes or configure a remote\")\n}","typeGuard":null,"tryCatchPattern":"ok, err := applyAdoptionConsent(...)\nif err != nil && strings.Contains(err.Error(), \"remote adoption declined\") {\n    // clean abort: no state changed; prompt user again or exit gracefully\n}","preventionTips":["Treat the decline exit as a clean abort — nothing was pushed or written","Pre-answer the prompt via --yes in automation to avoid ambiguous prompts","Document the adoption consent flow for team members before they first push"],"tags":["dolt","remote","consent","user-declined"],"backgroundTag":"remote-adoption-declined","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}