Skip to content

bug(proxy): valid HTTP/1.1 h2c upgrade requests from JetBrains/Ktor are rejected with 400 #1757

Description

@NormanGeyerProdatis

Pre-flight checklist

  • I searched existing issues and confirmed this is not a duplicate.
  • I am running a supported codex-lb version (see Releases).
  • I can reproduce the problem with the steps below.

codex-lb version

1.23.0

Deployment method

Docker (ghcr.io/Soju06/codex-lb)

Client used against codex-lb

Other (describe below)

ChatGPT account plan(s) involved

Business

Model(s) involved

gpt-5.6-luna

What happened?

A direct OpenAI-compatible Responses API request from JetBrains/Ktor fails before request authentication or payload processing.

The client sends an HTTP/1.1 request with the standard cleartext HTTP/2 upgrade headers:

Connection: Upgrade, HTTP2-Settings
Upgrade: h2c
HTTP2-Settings: <base64url settings payload>
codex-lb responds:
HTTP/1.1 400 Bad Request
Invalid HTTP request received.
The same JSON request is otherwise valid and contains a normal Responses API payload, including model, input, and stream: true.

What did you expect to happen?

A server which does not elect to perform the h2c upgrade should continue to process the request as HTTP/1.1, or otherwise return a protocol-appropriate upgrade response. The presence of valid HTTP/1.1 upgrade headers should not cause the whole request to be rejected as an invalid HTTP request.
In particular, the OpenAI-compatible /v1/responses endpoint should remain usable by HTTP clients that opportunistically offer h2c.

Steps to reproduce

Run codex-lb 1.23.0 in Docker on port 2455.
Configure IntelliJ AI Assistant with an OpenAI-compatible provider: http://127.0.0.1:2455/v1
Select OpenAIAPI/gpt-5.6-luna for Core Features.
Trigger AI commit-message generation.
Observe POST /v1/responses returning HTTP 400.

Relevant logs

Configuration / environment

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageAwaiting triage

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions