gastownhall/beads · error

a resolution strategy is required: --ours or --theirs

Error message

a resolution strategy is required: --ours or --theirs

What it means

After checking --ours, --theirs, and --strategy, resolveStrategy requires at least one of them. If none was supplied, picked remains empty and this error tells the user that a resolution strategy is mandatory for conflict resolution. It is the 'missing required argument' guard of the conflicts resolve command.

Source

Thrown at cmd/bd/conflicts.go:677

// resolveStrategy reads the strategy from --ours/--theirs/--strategy.
func resolveStrategy() (string, error) {
	picked := ""
	switch {
	case conflictsResolveOurs && conflictsResolveTheirs:
		return "", fmt.Errorf("pass --ours or --theirs, not both")
	case conflictsResolveOurs:
		picked = versioncontrolops.ConflictStrategyOurs
	case conflictsResolveTheirs:
		picked = versioncontrolops.ConflictStrategyTheirs
	}
	if conflictsResolveStrat != "" {
		if picked != "" && picked != conflictsResolveStrat {
			return "", fmt.Errorf("--strategy %s contradicts --%s", conflictsResolveStrat, picked)
		}
		picked = conflictsResolveStrat
	}
	if picked == "" {
		return "", fmt.Errorf("a resolution strategy is required: --ours or --theirs")
	}
	if err := versioncontrolops.ValidateConflictStrategy(picked); err != nil {
		return "", err
	}
	return picked, nil
}

// filterShownFields drops the agreeing fields from JSON output unless the
// caller asked for all of them, so a conflict reads as its handful of
// diverged fields rather than the whole row.
func filterShownFields(rows []storage.ConflictRow, allFields bool) []storage.ConflictRow {
	if allFields {
		return rows
	}
	out := make([]storage.ConflictRow, 0, len(rows))
	for _, r := range rows {
		trimmed := r
		trimmed.Fields = differingFields(r.Fields)

View on GitHub (pinned to 71377f2769)

Solutions

  1. Add --ours or --theirs to the resolve command
  2. Or add --strategy ours|theirs to the resolve command
  3. Fix typos in the flag name so one of the recognized flags is actually parsed

Example fix

// before
bd conflicts resolve bd-123
// after
bd conflicts resolve bd-123 --strategy theirs
Defensive patterns

Strategy: validation

Validate before calling

# ensure exactly one strategy flag is present before invoking
[ -n "$OURS" ] || [ -n "$THEIRS" ] || [ -n "$STRAT" ] || { echo "a resolution strategy is required: --ours or --theirs" >&2; exit 2; }

Try / catch

if err := resolveStrategy(); err != nil {
  if strings.Contains(err.Error(), "resolution strategy is required") {
    return fmt.Errorf("usage: bd conflicts resolve <id> --ours|--theirs|--strategy <s>: %w", err)
  }
  return err
}

Prevention

When it happens

Trigger: Running `bd conflicts resolve` (or the code path calling resolveStrategy) without any of --ours, --theirs, or --strategy, so all three flag variables are empty and picked == "" at the final check.

Common situations: Interactive users omitting flags expecting a prompt that does not happen; scripts built before a strategy flag became required; accidental flag typo like --stratey that silently yields no strategy.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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