镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

refactor(agents): derive agent engine identity from one source of truth - #503

Open
Amel-Hafi wants to merge 1 commit into
theam:mainfrom
Amel-Hafi:refactor/agent-engine-source-of-truth
Open

Amel-Hafi wants to merge 1 commit into
theam:mainfrom
Amel-Hafi:refactor/agent-engine-source-of-truth

Conversation

@Amel-Hafi

Copy link
Copy Markdown

What changed

Introduce AGENT_ENGINES as the single source of truth for the agent engines
Facility can run, plus a derived AgentEngineId type. The manifest schema enum,
the UpdateAgent route schema, and the engine registry/event unions now follow
from this list instead of repeating the "claude_code" | "codex" literal in
several files.

Why

First step toward provider portability (per ROADMAP). Adding an engine becomes a
one-line catalog change plus an engine implementation and runner CLI, rather than
editing scattered literals that can drift.

User-visible behaviour

None. The same engine values are accepted and rejected as before. Internal
refactor only.

Files / subsystems affected

  • packages/agents — AGENT_ENGINES, AgentEngineId, schema enum
  • services/api/src/turns/engines.ts — engine identity unions
  • services/api/src/routes/v1/story-workspaces.ts — UpdateAgent schema enum

Persistence / migration / compatibility

None.

Security / permission implications

None.

Cost / budget / observability / mirror effects

None.

Tests

Added regression tests in packages/agents/test/agents.test.ts:

  • derivation of the manifest engine enum from the catalog
  • rejection of an unknown engine (error names the engine field)
  • continued support for claude_code and codex

Verification commands run

  • pnpm --filter @facility/agents test → 13/13 pass
  • pnpm typecheck → 14/14 pass
  • pnpm guards → 2/2 pass
  • biome check on changed files → clean

Note: the full pnpm verify and the Docker-backed workspace tests were not run
locally (no Docker/Postgres in my environment); they should run in CI.

Release classification

Not user-visible, not breaking (refactor: → no release on its own).

Introduce AGENT_ENGINES as the canonical list of runnable agent engines and a derived AgentEngineId type. The manifest schema enum, the UpdateAgent route schema, and the engine registry/event unions now follow from this list instead of repeating the `claude_code` | `codex` literal in several files.

This is the first provider-portability step: adding an engine becomes a one-line catalog change plus an engine implementation and runner CLI, rather than editing scattered literals. No user-visible behaviour changes; the same engine values are accepted.

Add regression tests covering derivation from the catalog, rejection of an unknown engine (naming the engine field), and continued support for claude_code and codex.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant