gastownhall/beads · error

invalid --waits-for-gate value %q (valid: all-children, any-

Error message

invalid --waits-for-gate value %q (valid: all-children, any-children)

What it means

The --waits-for-gate value is validated against types.IsValidWaitsForGate; only the two built-in gates, all-children and any-children, are accepted. Any other spelling is rejected with this error listing the valid options.

Source

Thrown at cmd/bd/create_deps.go:211

}

// buildWaitsFor validates and constructs a WaitsForSpec from the --waits-for
// and --waits-for-gate flag values. gateExplicit must be true when the caller
// explicitly passed --waits-for-gate (not relying on its default); in that case
// a missing spawnerID is rejected rather than silently ignored.
func buildWaitsFor(spawnerID, gate string, gateExplicit bool) (*domain.WaitsForSpec, error) {
	spawnerID = strings.TrimSpace(spawnerID)
	if spawnerID == "" {
		if gateExplicit {
			return nil, fmt.Errorf("--waits-for-gate requires --waits-for (no spawner ID specified)")
		}
		return nil, nil
	}
	if gate == "" {
		gate = types.WaitsForAllChildren
	}
	if !types.IsValidWaitsForGate(gate) {
		return nil, fmt.Errorf("invalid --waits-for-gate value %q (valid: all-children, any-children)", gate)
	}
	return &domain.WaitsForSpec{SpawnerID: spawnerID, Gate: gate}, nil
}

func discoveredFromParent(deps []string) string {
	for _, raw := range deps {
		raw = strings.TrimSpace(raw)
		if raw == "" || !strings.Contains(raw, ":") {
			continue
		}
		parts := strings.SplitN(raw, ":", 2)
		if len(parts) != 2 {
			continue
		}
		depType := types.DependencyType(strings.TrimSpace(parts[0]))
		target := strings.TrimSpace(parts[1])
		if depType == types.DepDiscoveredFrom && target != "" {
			return target

View on GitHub (pinned to 71377f2769)

Solutions

  1. Use exactly "all-children" or "any-children" (lowercase, hyphenated)
  2. Normalize the gate value in scripts: map "all"/"any" to the full names before invoking bd
  3. Omit the flag to get the default gate (all-children)

Example fix

// before
bd create "Child" --waits-for bd-parent --waits-for-gate all
// after
bd create "Child" --waits-for bd-parent --waits-for-gate all-children
Defensive patterns

Strategy: validation

Validate before calling

var validGates = map[string]bool{"all-children": true, "any-children": true}
if !validGates[gate] {
    return fmt.Errorf("gate %q invalid; use all-children or any-children", gate)
}

Prevention

When it happens

Trigger: `bd create ... --waits-for bd-x --waits-for-gate all` or `--waits-for-gate ANY_CHILDREN` or any typo like "all-childern" — buildWaitsFor (runCreateProxiedSingle path) with a non-empty spawnerID but a gate that fails IsValidWaitsForGate.

Common situations: Abbreviating gate names; using snake_case or enum-style spellings from internal APIs in the CLI flag; scripts parameterizing the gate with a free-form string.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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