Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.
TypeScript adeagent-ideai-agentsautomationbotclaude-codecodexghosttygrok-bothermes-agentmobile-appmuseopenclawopencodeorchestrationpiruntimeterminalworktreesyc-backed
// Fetch fork PR/MR heads from hosting origin; otherwise accept only a lone remote rather than guessing a contributor fork.
export function pickPreferredGitRemote(remotes: readonly string[]): string {
const cleaned = remotes.map((line) => line.trim()).filter(Boolean)
if (cleaned.includes('origin')) {
return 'origin'
}
if (cleaned.length === 1) {
return cleaned[0]!
}
if (cleaned.length === 0) {
throw new Error('Repo has no configured git remotes.')
}
throw new Error(`Repo has multiple remotes (${cleaned.join(', ')}) and no default is configured.`)
}