stablyai/orca · error

Setup decision required for this repository

Error message

Setup decision required for this repository

What it means

Thrown by shouldRunSetupForCreate when the caller passes decision 'inherit' (the default) but the repository's effective setupRunPolicy is 'ask' — meaning setup must not run or skip automatically. The function refuses to guess because running setup scripts (which can execute arbitrary commands) without explicit consent is a security/trust hazard. The caller must supply an explicit 'run' or 'skip' decision.

Source

Thrown at src/main/hooks.ts:266

  const hooksRoot = worktreePath ?? repo.path
  return getEffectiveHooksFromConfig(repo, loadHooks(hooksRoot))
}

export function getEffectiveSetupRunPolicy(repo: Repo): SetupRunPolicy {
  return repo.hookSettings?.setupRunPolicy ?? getDefaultRepoHookSettings().setupRunPolicy!
}

export function shouldRunSetupForCreate(repo: Repo, decision: SetupDecision = 'inherit'): boolean {
  if (decision === 'run') {
    return true
  }
  if (decision === 'skip') {
    return false
  }

  const policy = getEffectiveSetupRunPolicy(repo)
  if (policy === 'ask') {
    throw new Error('Setup decision required for this repository')
  }

  return policy === 'run-by-default'
}

export function getDefaultTabCommandTrustContent(hooks: OrcaHooks | null): string {
  const commands = (hooks?.defaultTabs ?? [])
    .map((tab, index) => {
      const command = tab.command?.trim()
      if (!command) {
        return null
      }
      const label = tab.title ? ` ${tab.title}` : ''
      return `# defaultTabs[${index + 1}]${label}\n${command}`
    })
    .filter((entry): entry is string => entry !== null)
  return [hooks?.scripts.setup?.trim(), ...commands].filter(Boolean).join('\n\n')
}

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Pass an explicit decision: shouldRunSetupForCreate(repo, 'run') or shouldRunSetupForCreate(repo, 'skip').
  2. If the caller has a UI, prompt the user for the setup decision whenever getEffectiveSetupRunPolicy(repo) === 'ask' before calling.
  3. Change the repo's setupRunPolicy to 'run-by-default' or 'skip-by-default' if 'ask' is undesired.

Example fix

// before
const runSetup = shouldRunSetupForCreate(repo) // decision defaults to 'inherit'
// after
const policy = getEffectiveSetupRunPolicy(repo)
const decision: SetupDecision = policy === 'ask' ? await promptUserForSetupDecision(repo) : 'inherit'
const runSetup = shouldRunSetupForCreate(repo, decision)
Defensive patterns

Strategy: validation

Validate before calling

function resolveSetupDecision(repo: Repo, uiDecision?: SetupDecision): SetupDecision {
  if (uiDecision === 'run' || uiDecision === 'skip') return uiDecision
  const policy = getEffectiveSetupRunPolicy(repo)
  if (policy === 'ask' && !uiDecision) {
    throw new Error('UI must collect a setup decision before create')
  }
  return 'inherit'
}

Type guard

function isExplicitDecision(decision: unknown): decision is 'run' | 'skip' {
  return decision === 'run' || decision === 'skip'
}

Try / catch

let decision: SetupDecision = 'inherit'
if (getEffectiveSetupRunPolicy(repo) === 'ask') {
  decision = await ui.promptSetupDecision() // returns 'run' | 'skip'
}
const runSetup = shouldRunSetupForCreate(repo, decision)

Prevention

When it happens

Trigger: Creating a workspace/repo with decision defaulted to 'inherit' while repo.hookSettings.setupRunPolicy (or the global default) resolves to 'ask'. Happens when an automated caller (e.g. an automation/loop driver) invokes shouldRunSetupForCreate without first prompting the user for a setup decision.

Common situations: User configured a repo to 'ask' before running setup; an automation flow calling repo-create without a UI prompt; fresh install where the global default policy is 'ask'; a script that批量 creates workspaces but doesn't thread a decision through.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/54dda3dd1a260327. Report an issue: GitHub.