Repository navigation
Description
Summary
Remove the codev afx, codev agent-farm, and codev af invocation paths. Going forward, afx is the only supported entrypoint for agent-farm commands. The standalone afx global bin already exists and is what every doc, skill, and prompt already tells users to call — the codev-wrapped variants are a leftover that adds a cross-cutting fragility we'd rather not pay for.
Motivation
Two reasons, in order:
-
Cross-cutting fragility. A recent integration review on PR [#829] afx workspace recover: revive builders and main architect after machine reboot #833 surfaced that
workspace-recover.tsrespawns viaspawn(process.execPath, [process.argv[1], 'spawn', ...]). That works when invoked asafxbut breaks when invoked ascodev afxbecauseprocess.argv[1]is then thecodeventrypoint andcodev spawn ...is not a top-level command. This is the kind of bug we'll keep paying for as long as the same logical command has two invocation surfaces with differentprocess.argv[1]semantics. The cheaper fix is to remove the alternate surface. -
No one uses it. Every doc (CLAUDE.md, AGENTS.md, the README, the skills, the prompts) tells users to invoke
afx <subcommand>directly. Thecodev afxwrapper has been "supported but unused" for the entire 3.x line;codev afwas already deprecated with a stderr warning atcli.ts:402. We're just acknowledging the de-facto state.
What changes
packages/codev/src/cli.ts(the surface)- Remove the
.command('agent-farm', { hidden: false }).aliases(['afx', 'af'])registration (aroundcli.ts:355-365). - Remove the
args[0] === 'agent-farm'early-dispatch branch in the exportedrunWithArgsfunction (aroundcli.ts:381-395). - Remove the
args[0] === 'agent-farm' || args[0] === 'afx' || args[0] === 'af'early-dispatch branch at the top-level argv parsing (aroundcli.ts:398-405), including thecodev afdeprecation warning. - Keep
runAgentFarmitself imported — it's still used by the standaloneafxbin shim (packages/codev/bin/afx.js).
- Remove the
- Deprecation messaging for anyone who tries the old path: print a clear stderr line ("
codev afxis no longer supported; useafx <subcommand>directly") and exit non-zero. Don't silently misroute or fall through. - Docs sweep — search the repo for
codev afx,codev agent-farm,codev afoccurrences and update / remove. Spot-checks suggest there are very few but verify:CLAUDE.mdandAGENTS.md(kept in sync)README.md,INSTALL.mdcodev-skeleton/equivalentscodev/resources/commands/*.md- Any
.claude/skills/skill files
- No new tests required for absence, but a small test that the old invocations exit non-zero with the expected stderr would be a nice touch.
Acceptance criteria
-
afx <anything>still works exactly as before (the standalone bin path is unchanged). -
codev afx <anything>,codev agent-farm <anything>,codev af <anything>all exit non-zero with a one-line stderr explaining the removal and pointing atafx. - No callsite in the repo (docs, scripts, skills, prompts) still says
codev afxetc. — those are all rewritten toafx. -
codev tower,codev init,codev adopt,codev doctor,codev update,team,porch,consultare all untouched. This change is scoped to the agent-farm wrapper. - PR description notes that this is technically a breaking change for any external script that hardcoded
codev afx <…>, but in practice the workaround is a one-character edit (drop thecodevprefix).
References
- Triggering observation: PR [#829] afx workspace recover: revive builders and main architect after machine reboot #833 CMAP — Codex flagged the
process.argv[1]invocation-style split as a real integration bug. We're addressing the underlying surface, not patching the spawn child. - Existing CLI surface to remove:
packages/codev/src/cli.ts:353-365, 381-405. - Standalone bin that stays:
packages/codev/bin/afx.js.
Activity
[Issue #846] Remove `codev afx` / `codev agent-farm` / `codev af` inv…
[Issue #846] iter-2: also remove standalone `af` bin
Merge pull request #847 from cluesmith/builder/air-846