Invalid text/event-stream processing from OpenWeb-UI

Resolved 💬 0 comments Opened Jun 6, 2025 by dontepanlin Closed Jun 6, 2025

What version of Codex is running?

0.1.2505172129

Which model were you using?

qwen3:32b

What platform is your computer?

Linux 6.11.0-26-generic x86_64 x86_64

What steps can reproduce the bug?

Invalid text/event-stream. OpenWEB-UI api fully valid. Codex can extact all models from it.
I send prompt, codex start's thinking process and return 0 byte answer.
Tried DEBUG=true and got this:

OpenAI:DEBUG:response 200 https://jupyterhub.ah64.intra.ispras.ru:3001/api/chat/completions e [Headers] {
  [Symbol(map)]: [Object: null prototype] {
    'content-type': [ 'text/event-stream' ],
    date: [ 'Fri, 06 Jun 2025 12:08:51 GMT, Fri, 06 Jun 2025 12:09:01 GMT' ],
    server: [ 'uvicorn' ],
    'x-process-time': [ '10' ],
    'transfer-encoding': [ 'chunked' ]
  }
} PassThrough {
  _events: {
    close: [Function: bound onceWrapper] { listener: [Function: onclose] },
    error: [ [Function: onerror], [Function (anonymous)] ],
    prefinish: [Function: prefinish],
    finish: [Function: bound onceWrapper] { listener: [Function: onfinish] },
    drain: undefined,
    data: undefined,
    end: undefined,
    readable: undefined,
    unpipe: [Function: onunpipe]
  },
  _readableState: ReadableState {
    highWaterMark: 65536,
    buffer: [],
    bufferIndex: 0,
    length: 0,
    pipes: [],
    awaitDrainWriters: null,
    [Symbol(kState)]: 1048844
  },
  _writableState: WritableState {
    highWaterMark: 65536,
    length: 0,
    corked: 0,
    onwrite: [Function: bound onwrite],
    writelen: 0,
    bufferedIndex: 0,
    pendingcb: 0,
    [Symbol(kState)]: 17580812,
    [Symbol(kBufferedValue)]: null
  },
  allowHalfOpen: true,
  _maxListeners: undefined,

Curl request return valid text/event-stream:

curl -N -H "Accept: text/event-stream" -H "Content-Type: application/json" -H "Authorization: Bearer ${OPENAI_TOKEN}" -X POST https://jupyterhub.ah64.intra.ispras.ru:3001/api/chat/completions  -d '{"model": "qwen3:32b", "messages": [{"role": "user", "content": "Привет"}], "stream": true}'
data: {"id": "qwen3:32b-939b89fa-69ec-49d3-93bf-b5a6c12de474", "created": 1749214222, "model": "qwen3:32b", "choices": [{"index": 0, "logprobs": null, "finish_reason": null, "delta": {"content": "\u044c"}}], "object": "chat.completion.chunk"}

data: {"id": "qwen3:32b-ebe29bb8-0755-434f-bbd4-5288469acfb7", "created": 1749214222, "model": "qwen3:32b", "choices": [{"index": 0, "logprobs": null, "finish_reason": null, "delta": {"content": "?"}}], "object": "chat.completion.chunk"}

data: {"id": "qwen3:32b-e56eb1b1-eb46-46a4-8a71-12fb2f60a290", "created": 1749214222, "model": "qwen3:32b", "choices": [{"index": 0, "logprobs": null, "finish_reason": "stop", "delta": {}}], "object": "chat.completion.chunk", "usage": {"response_token/s": 37.87, "prompt_token/s": 21.67, "total_duration": 11594510378, "load_duration": 5777308112, "prompt_eval_count": 11, "prompt_tokens": 11, "prompt_eval_duration": 507642946, "eval_count": 201, "completion_tokens": 201, "eval_duration": 5307354317, "approximate_total": "0h0m11s", "total_tokens": 212, "completion_tokens_details": {"reasoning_tokens": 0, "accepted_prediction_tokens": 0, "rejected_prediction_tokens": 0}}}

data: [DONE]

What is the expected behavior?

Normal behavior.

What do you see instead?

_No response_

Additional information

_No response_

View original on GitHub ↗