Skip to content

Remove 'codev afx' / 'codev agent-farm' / 'codev af' as supported invocation paths #846

@waleedkadous

Description

@waleedkadous

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:

  1. 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.ts respawns via spawn(process.execPath, [process.argv[1], 'spawn', ...]). That works when invoked as afx but breaks when invoked as codev afx because process.argv[1] is then the codev entrypoint and codev 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 different process.argv[1] semantics. The cheaper fix is to remove the alternate surface.

  2. No one uses it. Every doc (CLAUDE.md, AGENTS.md, the README, the skills, the prompts) tells users to invoke afx <subcommand> directly. The codev afx wrapper has been "supported but unused" for the entire 3.x line; codev af was already deprecated with a stderr warning at cli.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 (around cli.ts:355-365).
    • Remove the args[0] === 'agent-farm' early-dispatch branch in the exported runWithArgs function (around cli.ts:381-395).
    • Remove the args[0] === 'agent-farm' || args[0] === 'afx' || args[0] === 'af' early-dispatch branch at the top-level argv parsing (around cli.ts:398-405), including the codev af deprecation warning.
    • Keep runAgentFarm itself imported — it's still used by the standalone afx bin shim (packages/codev/bin/afx.js).
  • Deprecation messaging for anyone who tries the old path: print a clear stderr line ("codev afx is no longer supported; use afx <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 af occurrences and update / remove. Spot-checks suggest there are very few but verify:
    • CLAUDE.md and AGENTS.md (kept in sync)
    • README.md, INSTALL.md
    • codev-skeleton/ equivalents
    • codev/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 at afx.
  • No callsite in the repo (docs, scripts, skills, prompts) still says codev afx etc. — those are all rewritten to afx.
  • codev tower, codev init, codev adopt, codev doctor, codev update, team, porch, consult are 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 the codev prefix).

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions