Skip to content

Codex resume replays canonical tool names (Bash/Edit) instead of exec_command/apply_patch #59

Description

@Drix10

What happened?

Exporting a session to Codex (txcript continue <id> --with codex) writes the canonical tool names (Bash, Edit) into function_call lines. The
Codex runtime has no tools by those names — it expects exec_command (with {"cmd": ...}) and apply_patch (custom_tool_call) — so the replayed
history fails validation and the resumed session breaks. Same for results: patch calls need custom_tool_call_output, not function_call_output.

Expected: from_common emits the native Codex tool shapes, the exact reverse of what to_common normalizes (exec_command/shellBash,
apply_patchEdit/Write).

How to reproduce

let common = Transcript { /* contains Tool::Bash { command: "ls", .. } and Tool::Edit { .. } */ };
let native = codex::Codex::from_common(&common).unwrap();
// native lines contain {"type":"function_call","name":"Bash",...}
// and {"type":"function_call","name":"Edit",...} — both unknown to Codex.

Or via CLI: convert any session containing shell/edit calls to Codex and inspect the response_item lines for "name":"Bash" / "name":"Edit".

Automated repro (fails on main, 3 failed): cargo test -p txcript --test integration codex::from_common — the from_common_denormalizes_* tests in
tests/integration/codex.rs.

Versions

  • txcript: 0.14.4
  • Agents and their versions: Codex CLI (any)
  • Operating system: Windows (applies on all platforms)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions