codexwright rebuilds the workflow on the Codex SDK. The Codex SDK is the only target runtime: the migrated workflow does not keep CrewAI, a Crew/Task shim, or a second agent runtime running beside it.
Migrate a CrewAI crew when:
Do not migrate yet when the crew depends on behavior you have not captured, or when you cannot run enough representative inputs to compare results.
The migration keeps the external behavior contract:
{"ticket": "..."};{"priority": ..., "reason": ...};CrewAI classes, kickoff, and the CrewAI dependency are retired only after the
new workflow passes its checks. Captured inputs, outputs, errors, permissions,
side effects, and recovery criteria belong in the migration evidence.
Register the selected project, then invoke migrate. invoke prepares a
proposal; it does not modify the target.
codexwright_preflight({})
codexwright_register({"path": "/absolute/path/to/project"})
codexwright_invoke({"envelope": {
"workspace_id": "ws_RETURNED_ID",
"goal": "Migrate the ticket-triage crew to a Codex SDK workflow. Preserve the {priority, reason} output shape, the priority vocabulary, keyword precedence, and the empty-ticket default.",
"operation": "migrate",
"idempotency_key": "crewai-triage-migrate-v1",
"inputs": [
{"kind": "file", "path": "crew.py", "source": "user"},
{"kind": "file", "path": "tests/test_crew.py", "source": "user"}
]
}})
Read every page of the returned proposal with codexwright_read, then call
codexwright_apply only after the user approves the exact diff.
The example lives at
examples/migrations/crewai
and contains:
old.py: a CrewAI-shaped crew using plain classes, with no CrewAI dependency;golden.py: the migrated behavior adapter, with no codexwright import;cases.json: inputs and expected outputs.Run it:
python -m pytest tests/test_migration_examples.py -q -k crewai
The test loads both files by path and asserts that every case matches the expected output. It is an adapter-agreement check, not a real CrewAI run.
old.py simulates the crew. CrewAI was not installed or executed for this
fixture.old.py and golden.py agree on the captured
contract. They do not prove original-runtime parity.parity_claim unverified until that execution exists.