Skip to content

fix(install): declare a transport in generated Codex agent role TOMLs - #1408

Merged
DeusData merged 2 commits into
DeusData:mainfrom
dergachoff:fix/codex-agent-toml-transport
Aug 4, 2026
Merged

fix(install): declare a transport in generated Codex agent role TOMLs#1408
DeusData merged 2 commits into
DeusData:mainfrom
dergachoff:fix/codex-agent-toml-transport

Conversation

@dergachoff

Copy link
Copy Markdown
Contributor

Problem

Codex CLI startup prints Ignoring malformed agent role definition: failed to deserialize agent role file at ~/.codex/agents/codebase-memory[-scout|-auditor].toml: invalid transport and drops all three generated roles. Fixes #1391.

Root cause

The Codex profile renderer emits [mcp_servers.codebase-memory-mcp] with only enabled_tools. Codex deserializes role files standalone and requires command or url, so every direct Codex profile since v0.9.1-rc.1 is rejected.

Fix

  • Direct Codex profiles render command = "<installed binary>" and args = ["--tool-profile=scout|analysis"], mirroring the Kiro renderer; enabled_tools kept.
  • The rc.1 transport-less rendering is kept as a released shape (cbm_render_graph_profile_codex_rc1), so install migrates rc.1-written files in place and uninstall removes them.
  • The Codex uninstall set passes the installed binary path so exact-content ownership matching keeps working (as Kiro already does).

Validation

  • test-runner: agent_profiles 10/10, cli 257/257, agent_clients 26/26, config_toml_edit 34/34 (cli lifecycle tests require no live daemon; a running one blocks uninstall quiesce)
  • lint-format, lint-cppcheck, lint-no-suppress clean
  • Copied the three rc.1-generated TOMLs from a real machine into a sandbox HOME: patched install -y migrated all three in place. Codex CLI 0.146.0: three invalid transport warnings before, zero after.
  • Live Codex 0.146.0 session against the migrated roles: no startup warnings, the server spawned as codebase-memory-mcp --tool-profile=scout from the role's rendered transport, and the exposed tool surface was exactly the seven scout-tier tools (no query_graph/search_code/detect_changes/get_graph_schema, no mutators).

Known limit: custom --dir installs still cannot be exact-matched at uninstall (path reconstruction assumes ~/.local/bin); same pre-existing limitation as Kiro's profiles.

Codex deserializes ~/.codex/agents/*.toml standalone: an
[mcp_servers.codebase-memory-mcp] table with only enabled_tools fails
with "invalid transport" and the whole role is dropped, so all three
generated roles have been dead on Codex since they first shipped in
v0.9.1-rc.1.

Render command = <installed binary> plus
args = ["--tool-profile=scout|analysis"] in direct Codex profiles,
mirroring the Kiro renderer, and keep enabled_tools. Recognize the
rc.1 transport-less rendering as a released shape so install migrates
those files in place and uninstall still removes them; pass the
installed binary path in the Codex uninstall set so exact-content
ownership keeps matching.

Fixes DeusData#1391

Signed-off-by: Ivan Dergachev <dergachoff@gmail.com>
@dergachoff
dergachoff requested a review from DeusData as a code owner August 1, 2026 20:12
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

Thanks for opening this — it has been seen, and it is queued.

This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence.

Current review status: working through a backlog. 0.9.1-rc.1 is out, so the release freeze that held reviews is over — but it left a large queue of open pull requests behind it, and we are reading through them oldest-first. The background is in discussion #1144.

What that means for this PR, concretely:

  • It will not be closed for inactivity. No stale bot touches pull requests here.
  • It may still sit a while before a human reads it. That is on us, not on you.
  • Older PRs are read first, so a recent one is not being skipped — it is behind a queue.

Things that will genuinely speed it up whenever review does happen:

  • Keep it rebased on main — the tree is moving quickly right now, and a conflicting branch cannot be reviewed as the diff you intended.
  • Get CI green, or say which failures you believe are pre-existing.
  • Keep the change to one claim. Bundled features and refactors get split before they get merged, which costs you a round trip.
  • Every commit needs a sign-off (git commit -s) — CI enforces DCO.

If this fixes a bug, a reproduction we can run is worth more than a description of the symptom.

Thanks for contributing, and sorry in advance for the wait.

@adfjadfj16-a11y

adfjadfj16-a11y commented Aug 1, 2026 via email

Copy link
Copy Markdown

@adfjadfj16-a11y

adfjadfj16-a11y commented Aug 1, 2026 via email

Copy link
Copy Markdown

… test

cbm_agent_installed_binary_path renders the expected uninstall content
with ~/.local/bin/codebase-memory-mcp.exe on Windows, so installing the
test fixture with a suffix-less path made exact-content removal of the
migrated auditor profile miss and fail test-windows shard 2/2.

Signed-off-by: Ivan Dergachev <dergachoff@gmail.com>
@DeusData DeusData added bug Something isn't working editor/integration Editor compatibility and CLI integration ux/behavior Display bugs, docs, adoption UX priority/high Needs near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker. labels Aug 3, 2026
@DeusData DeusData added this to the 0.9.1-rc milestone Aug 3, 2026
@DeusData

DeusData commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Thank you for turning the Codex transport failure in #1391 into a focused installer change. It is now routed at high priority in 0.9.1-rc. This is an intake acknowledgement rather than approval or a merge decision; our review queue is full, so the detailed review may take a little time. For clarity, the earlier comment instructing a merge was not posted by the maintainer account or project team and should be disregarded.

@DeusData

DeusData commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Thank you — this is an outstanding fix, and honestly a model for what an installer PR should look like. Root cause nailed (Codex deserializes role files standalone, so a server table without a transport drops the whole role), the fix mirrors the Kiro renderer instead of inventing a new shape, and above all: keeping the rc.1 transport-less rendering as a recognized released shape so install migrates broken files in place and uninstall still owns them — that's the lifecycle detail that separates a patch from a fix. The live Codex validation against real rc.1-generated files seals it.

And thank you for the whole #1387/#1388/#1391 report trio — the before/after evidence in each one made this release-blocking cluster far easier to work. This lands in 0.9.1.

@DeusData
DeusData merged commit e512c80 into DeusData:main Aug 4, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working editor/integration Editor compatibility and CLI integration priority/high Needs near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker. ux/behavior Display bugs, docs, adoption UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

install writes Codex agent role TOMLs that Codex rejects as "invalid transport" (0.9.1-rc.1)

3 participants