feat(miner-hands): resolve concrete CLI/SDK providers in the CodingAgentDriver factory - #4593
Conversation
…entDriver factory
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4593 +/- ##
=======================================
Coverage 94.12% 94.13%
=======================================
Files 430 430
Lines 38178 38199 +21
Branches 13920 13929 +9
=======================================
+ Hits 35936 35957 +21
Misses 1585 1585
Partials 657 657
🚀 New features to boost your workflow:
|
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review result - reject/close recommendedReview updated: 2026-07-10 07:10:52 UTC
🛑 Suggested Action - Reject/Close
Review summary Blockers
Nits — 5 non-blocking
Why this is blocked
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
|
Gittensory is closing this pull request on the maintainer's behalf (AI reviewers agree on a likely critical defect: packages/gittensory-engine/src/miner/driver-factory.ts:211-224 — `runCodingAgentAttempt` calls `createCodingAgentDriver(...)` (which throws `unconfigured_coding_agent_driver_missing_spawn:` for claude-cli/codex-cli without `spawn`) before checking whether `mode` even executes; per the documented lifecycle in coding-agent-driver.md, a dry-run/paused attempt should just log a shadow event without spawning, but now it crashes if the caller omits `spawn` for a non-live attempt — construct the driver lazily inside the `codingAgentModeExecutes(mode)` branch (or pass mode-awareness into the factory) so dry-run/paused attempts for CLI providers don't require a real spawn dependency.). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
Closes #4289
What
The
CodingAgentDriverfactory (packages/gittensory-engine/src/miner/driver-factory.ts) now resolves the batch's two concrete implementations —claude-cli/codex-cli(the #4266 CLI-subprocess driver) andagent-sdk(the #4267 in-process driver) — alongside the existingnoopstub, structurally mirroringresolveConfiguredProviderNames/isConfiguredSelfHostProvider(src/selfhost/ai-config.ts:41-74).How it maps to the issue's deliverables
createCodingAgentDrivergains the three concrete arms. All provider names are locally-authenticated (no API-key requirement), so they are always-configured at the NAME level — mirroring howisConfiguredSelfHostProvidertreatsclaude-code/codex.CODING_AGENT_DRIVER_CONFIG_ENVmapsclaude-cli/codex-clitoMINER_CODING_AGENT_{CLAUDE,CODEX}_MODEL+MINER_CODING_AGENT_TIMEOUT_MS— and the factory actually reads them: the configured model is prefixed onto the CLI driver's exported default argv (defaultCliSubprocessArgs, exported rather than re-invented so the baseline argv can't silently drift), and the timeout (positive-integer-validated) lands on the driver'stimeoutMs. Deliberately NOT declared (documented in the map's comment): a max-turns key (that's task-level input,CodingAgentDriverTask.maxTurns) and anagent-sdkmodel key (the SDK session uses the account default; the driver exposes no model option today) — a declared-but-unread entry would be dead, misleading config-as-code surface.unconfigured_coding_agent_driver:<name>via thedefault: return falsearm; additionally, a CLI provider constructed without its requiredspawndependency throwsunconfigured_coding_agent_driver_missing_spawn:<name>(the engine ships no default spawn — never hand back a driver whose everyrun()would throw), matchingresolveAutonomy's deny-by-default precedent.resolveFirstConfiguredCodingAgentDriverNamegives primary-then-fallback resolution overMINER_CODING_AGENT_PROVIDER's comma-separated list (theAiRunOptions.fallbacksemantic at the resolution layer); an all-unknown list resolves toundefinedso callers fail closed. Per-repo overrides (.gittensory-miner.yml-sourced) are noted as a follow-up in code comments — that file sits outside the Worker's manifest plumbing today, so only the env layer is wired here (thefirstConfiguredvalue-priority helper is in place for it).runCodingAgentAttemptthreads the new provider deps (spawn/query/hooks/knownSecrets) end-to-end.Testing
13 new vitest cases in
test/unit/coding-agent-miner.test.ts(the codecov-measured path) + a mirrored set in the engine's ownnode:testsuite: every provider arm, model-env consumption asserted in the spawned argv (set, unset, whitespace-only), per-provider model keys isolated (codex ignores claude's), timeout consumption incl. all invalid-value fallbacks, missing-spawn fail-closed for both CLI providers, knownSecrets redaction pass-through, agent-sdk hooks forwarding + no-deps construction, name normalization, primary-then-fallback + fail-closed resolution, and an end-to-endrunCodingAgentAttemptrun. Changed-line coverage verified 100% (lines + branches) on both touched engine files; engine workspace suite 338/338, roottypecheckandgit diff --checkclean.