gastownhall/beads · error

cannot use multiple conflict resolution flags

Error message

cannot use multiple conflict resolution flags

What it means

ADO sync conflict resolution accepts at most one strategy flag (--prefer-local, --prefer-ado, --prefer-newer, etc.). getADOConflictStrategy counts how many were set and refuses with this error when more than one is supplied, because a single unambiguous strategy must be chosen.

Source

Thrown at cmd/bd/ado.go:127

	// ADOConflictPreferADO always uses the Azure DevOps version.
	ADOConflictPreferADO ADOConflictStrategy = "prefer-ado"
)

// getADOConflictStrategy determines the conflict strategy from flag values.
// Returns error if multiple conflicting flags are set.
func getADOConflictStrategy(preferLocal, preferADO, preferNewer bool) (ADOConflictStrategy, error) {
	flagsSet := 0
	if preferLocal {
		flagsSet++
	}
	if preferADO {
		flagsSet++
	}
	if preferNewer {
		flagsSet++
	}
	if flagsSet > 1 {
		return "", fmt.Errorf("cannot use multiple conflict resolution flags")
	}

	if preferLocal {
		return ADOConflictPreferLocal, nil
	}
	if preferADO {
		return ADOConflictPreferADO, nil
	}
	return ADOConflictPreferNewer, nil
}

func init() {
	// Add subcommands to ado
	adoCmd.AddCommand(adoSyncCmd)
	adoCmd.AddCommand(adoStatusCmd)
	adoCmd.AddCommand(adoProjectsCmd)

	// Add flags to sync command

View on GitHub (pinned to 71377f2769)

Solutions

  1. Pass exactly one conflict-resolution flag and rerun the command
  2. Remove the redundant flag from your alias/script wrapper
  3. Omit all strategy flags to use the default conflict behavior

Example fix

// before
bd ado sync --prefer-local --prefer-newer
// after
bd ado sync --prefer-newer
Defensive patterns

Strategy: validation

Validate before calling

flags := 0
for _, f := range []bool{preferLocal, preferADO, preferNewer} {
    if f { flags++ }
}
if flags > 1 { return errors.New("pass at most one conflict resolution flag") }

Try / catch

if err := runADOSync(cmd, args); err != nil && strings.Contains(err.Error(), "multiple conflict resolution flags") {
    cmd.Usage()
    return err
}

Prevention

When it happens

Trigger: Invoking an `bd ado sync`-family command with two or more mutually exclusive conflict-resolution flags set simultaneously (e.g. --prefer-local --prefer-newer).

Common situations: Copy-pasting command examples that each use a different flag; scripted wrappers accumulating flags across versions; aliases appending a default strategy on top of a user-supplied one.

Related errors


AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30). Data as JSON: /api/errors/c0bcd791d22011e9. Report an issue: GitHub.