Commit Graph

20 Commits

  • Add feature for optional request compression (#8767)
    Adds a new feature
    `enable_request_compression` that will compress using zstd requests to
    the codex-backend. Currently only enabled for codex-backend so only enabled for openai providers when using chatgpt::auth even when the feature is enabled
    
    Added a new info log line too for evaluating the compression ratio and
    overhead off compressing before requesting. You can enable with
    `RUST_LOG=$RUST_LOG,codex_client::transport=info`
    
    ```
    2026-01-06T00:09:48.272113Z  INFO codex_client::transport: Compressed request body with zstd pre_compression_bytes=28914 post_compression_bytes=11485 compression_duration_ms=0
    ```
  • Merge Modelfamily into modelinfo (#8763)
    - Merge ModelFamily into ModelInfo
    - Remove logic for adding instructions to apply patch
    - Add compaction limit and visible context window to `ModelInfo`
  • fix(codex-api): handle Chat Completions DONE sentinel (#8708)
    Context
    - This code parses Server-Sent Events (SSE) from the legacy Chat
    Completions streaming API (wire_api = "chat").
    - The upstream protocol terminates a stream with a final sentinel event:
    data: [DONE].
    - Some of our test stubs/helpers historically end the stream with data:
    DONE (no brackets).
    
    How this was found
    - GitHub Actions on Windows failed in codex-app-server integration tests
    with wiremock verification errors (expected multiple POSTs, got 1).
    
    Diagnosis
    - The job logs included: codex_api::sse::chat: Failed to parse
    ChatCompletions SSE event ... data: DONE.
    - eventsource_stream surfaces the sentinel as a normal SSE event; it
    does not automatically close the stream.
    - The parser previously attempted to JSON-decode every data: payload.
    The sentinel is not JSON, so we logged and skipped it, then continued
    polling.
    - On servers that keep the HTTP connection open after emitting the
    sentinel (notably wiremock on Windows), skipping the sentinel meant we
    never emitted ResponseEvent::Completed.
    - Higher layers wait for completion before progressing (emitting
    approval requests and issuing follow-up model calls), so the test never
    reached the subsequent requests and wiremock panicked when its
    expected-call count was not met.
    
    Fix
    - Treat both data: [DONE] and data: DONE as explicit end-of-stream
    sentinels.
    - When a sentinel is seen, flush any pending assistant/reasoning items
    and emit ResponseEvent::Completed once.
    
    Tests
    - Add a regression unit test asserting we complete on the sentinel even
    if the underlying connection is not closed.
  • fix: chat multiple tool calls (#8556)
    Fix this: https://github.com/openai/codex/issues/8479
    
    The issue is that chat completion API expect all the tool calls in a
    single assistant message and then all the tool call output in a single
    response message
  • Refresh on models etag mismatch (#8491)
    - Send models etag
    - Refresh models on 412
    - This wires `ModelsManager` to `ModelFamily` so we don't mutate it
    mid-turn
  • Remove reasoning format (#8484)
    This isn't very useful parameter. 
    
    logic:
    ```
    if model puts `**` in their reasoning, trim it and visualize the header.
    if couldn't trim: don't render
    if model doesn't support: don't render
    ```
    
    We can simplify to:
    ```
    if could trim, visualize header.
    if not, don't render
    ```
  • feat: experimental menu (#8071)
    This will automatically render any `Stage::Beta` features.
    
    The change only gets applied to the *next session*. This started as a
    bug but actually this is a good thing to prevent out of distribution
    push
    
    <img width="986" height="288" alt="Screenshot 2025-12-15 at 15 38 35"
    src="https://github.com/user-attachments/assets/78b7a71d-0e43-4828-a118-91c5237909c7"
    />
    
    
    <img width="509" height="109" alt="Screenshot 2025-12-15 at 17 35 44"
    src="https://github.com/user-attachments/assets/6933de52-9b66-4abf-b58b-a5f26d5747e2"
    />
  • nit: trace span for regular task (#8053)
    Logs are too spammy
    
    ---------
    
    Co-authored-by: Anton Panasenko <apanasenko@openai.com>
  • load models from disk and set a ttl and etag (#7722)
    # External (non-OpenAI) Pull Request Requirements
    
    Before opening this Pull Request, please read the dedicated
    "Contributing" markdown file or your PR may be closed:
    https://github.com/openai/codex/blob/main/docs/contributing.md
    
    If your PR conforms to our contribution guidelines, replace this text
    with a detailed and high quality description of your changes.
    
    Include a link to a bug report or enhancement request.
  • Add remote models feature flag (#7648)
    # External (non-OpenAI) Pull Request Requirements
    
    Before opening this Pull Request, please read the dedicated
    "Contributing" markdown file or your PR may be closed:
    https://github.com/openai/codex/blob/main/docs/contributing.md
    
    If your PR conforms to our contribution guidelines, replace this text
    with a detailed and high quality description of your changes.
    
    Include a link to a bug report or enhancement request.
  • fix: taking plan type from usage endpoint instead of thru auth token (#7610)
    pull plan type from the usage endpoint, persist it in session state /
    tui state, and propagate through rate limit snapshots
  • Add models endpoint (#7603)
    - Use the codex-api crate to introduce models endpoint. 
    - Add `models` to codex core tests helpers
    - Add `ModelsInfo` for the endpoint return type
  • Migrate model preset (#7542)
    - Introduce `openai_models` in `/core`
    - Move `PRESETS` under it
    - Move `ModelPreset`, `ModelUpgrade`, `ReasoningEffortPreset`,
    `ReasoningEffortPreset`, and `ReasoningEffortPreset` to `protocol`
    - Introduce `Op::ListModels` and `EventMsg::AvailableModels`
    
    Next steps:
    - migrate `app-server` and `tui` to use the introduced Operation