Skip to content

c2rust-postprocess: support codex as an LLM provider #1903

Description

@thedataking

Tractor-Crisp has a --codex-login mode where LLM access goes through the codex CLI instead of an API key. c2rust-postprocess only supports API key providers, so CRISP currently skips postprocessing in that mode (GaloisInc/Tractor-Crisp#131).

Plan: shell out to codex exec (final response on stdout, progress on stderr; https://developers.openai.com/codex/noninteractive). The official Python SDK would also work but bundles its own pinned codex runtime, and the CRISP sandbox already ships a codex CLI, so subprocess seems to make the most sense.

Things to consider:

  • Explicit provider selection (e.g. --llm-provider codex --llm-model gpt-5.4); gpt-* ids are ambiguous between the OpenAI API and codex until the gpt-5.6 release series.
  • Replace the api_key_from_env() check in postprocess/transforms/base.py:146 with a model capability. It already misfires for CRISP: with CRISP_API_MODEL set and OPENAI_API_KEY unset, generation is skipped even though credentials are configured.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions