Once the CodingAgentDriver interface (#4262) and at least the CLI-subprocess implementation (#4266) exist, something needs to pick WHICH concrete driver to instantiate for a given attempt — mirroring how src/selfhost/ai-config.ts resolves AI_PROVIDER into a concrete SelfHostAi today. That file's resolveConfiguredProviderNames/isConfiguredSelfHostProvider (lines 41-74) parse a comma-separated provider-name env var and validate each name against what's actually configured (e.g. claude-code/codex are always "configured" since they're locally-authenticated CLIs with no required API key; openai/anthropic require their respective API key env var), and SELF_HOST_REVIEWER_MODEL_ENV (lines 15-22) maps each provider name to its model-override env var. This issue builds the equivalent resolution layer for coding-agent drivers.
Deliverables
References
Once the
CodingAgentDriverinterface (#4262) and at least the CLI-subprocess implementation (#4266) exist, something needs to pick WHICH concrete driver to instantiate for a given attempt — mirroring howsrc/selfhost/ai-config.tsresolvesAI_PROVIDERinto a concreteSelfHostAitoday. That file'sresolveConfiguredProviderNames/isConfiguredSelfHostProvider(lines 41-74) parse a comma-separated provider-name env var and validate each name against what's actually configured (e.g.claude-code/codexare always "configured" since they're locally-authenticated CLIs with no required API key;openai/anthropicrequire their respective API key env var), andSELF_HOST_REVIEWER_MODEL_ENV(lines 15-22) maps each provider name to its model-override env var. This issue builds the equivalent resolution layer for coding-agent drivers.Deliverables
packages/gittensory-engine/src/miner/driver-factory.ts(path coordinated with feat(miner-hands): define the CodingAgentDriver interface seam #4262) exporting a provider-name →CodingAgentDriverfactory, structurally mirroringresolveConfiguredProviderNames/isConfiguredSelfHostProvider(src/selfhost/ai-config.ts:41-74) but over the driver set from this batch (CLI-subprocess from feat(miner-hands): CLI-subprocess CodingAgentDriver (reuse SpawnFn/redactSecrets/EFFORT_TIMEOUT_MS pattern) #4266, Agent-SDK from feat(miner-hands): Agent-SDK CodingAgentDriver (query() loop) #4267) rather than the six review providers.SELF_HOST_REVIEWER_MODEL_ENV(src/selfhost/ai-config.ts:15-22) for whatever a coding-agent driver needs configured beyond a model name (e.g. effort/turn budget, worktree base path) — reuse thefirstConfigured/repo-override-over-env-var priority pattern fromsrc/selfhost/ai.ts:117-134if a per-repo override (.gittensory-miner.yml-sourced, mirroringreview.ai_model's.gittensory.ymlprecedent) makes sense here too.resolveAutonomy's deny-by-default insrc/settings/autonomy.ts:25-27,isConfiguredSelfHostProvider'sdefault: return falseinsrc/selfhost/ai-config.ts:64-65) rather than silently falling through to some default driver.AiRunOptions'fallbackfield does for reviewers — a primary-then-fallback resolution case.References
src/selfhost/ai-config.ts:15-22(SELF_HOST_REVIEWER_MODEL_ENV)src/selfhost/ai-config.ts:41-74(parseProviderNames,isConfiguredSelfHostProvider,resolveConfiguredProviderNames)src/selfhost/ai.ts:117-134(firstConfigured,configuredClaudeModel,configuredCodexModel— the repo-override-over-env-var priority pattern)src/settings/autonomy.ts:25-27(resolveAutonomy— deny-by-default precedent this factory's unknown-provider handling should match)CodingAgentDriverinterface this factory resolves to