Repository navigation
Open
Labels
area/towerArea: Tower server / agent farm CLI
Description
Problem
packages/codev/src/agent-farm/utils/harness.ts holds both the general-purpose harness layer and every built-in provider's CLI-specific details:
- The general-purpose part: the
HarnessProviderinterface, the resolver (resolveHarness,resolveInteractiveTaskLauncher), command detection, retirement handling, and custom-harness validation. - The CLI-specific part: each built-in provider (
CLAUDE_HARNESS,CODEX_HARNESS,OPENCODE_HARNESS) with what it knows about its own CLI. That covers Claude's--append-system-prompt,/clear, session jsonl paths, and the subcommand and blocking-flag lists added by Spec 1797, and codex'smodel_instructions_fileand subcommand list.
Mixing the two in one file makes CLI-specific knowledge look like shared vocabulary. Every new harness capability grows the shared module.
PR #1808 (Spec 1797) took the first small step: the interactive-launch blocker lists are no longer exported and now sit directly beside the provider that uses them.
Proposal
Split the built-in providers out, one file per harness, for example:
agent-farm/utils/harness.ts interface, resolver, detection, retirement, custom harness
agent-farm/utils/harnesses/claude.ts CLAUDE_HARNESS and its private CLI knowledge
agent-farm/utils/harnesses/codex.ts CODEX_HARNESS
agent-farm/utils/harnesses/opencode.ts OPENCODE_HARNESS
Constraints:
- The public API stays the same.
harness.tskeeps exporting the same names (BUILTIN_HARNESSES,getBuiltinHarness, the provider constants) so callers don't change. - Provider internals stay private. Each provider's private helpers and lists stay unexported. Tests go through the provider methods, not the constants.
- Shared helpers stay generic. Helpers several providers use (for example
flagName,findSubcommandandshellEscapeSingleQuote) live in a small shared module and never name a specific CLI. - No behavior change. The existing
harness.test.tssuite passes unchanged, apart from import paths.
Metadata
Metadata
Assignees
Labels
area/towerArea: Tower server / agent farm CLI
Activity
[Spec 1797] refactor: keep launch-blocker lists private to their harn…