Skip to content

Codex stream failures can still suggest CLI upgrades #1168

Description

@bcdonadio

Observed behavior

Source inspection during #1154 found a remaining pre-existing diagnostic gap: a Codex Responses request that receives HTTP 200 but then has an absent/invalid body, wrong content type, failed/malformed SSE, or a stream-read error can still be reported as a CLI compatibility problem with upgrade advice.

The #1154 candidate fixes the observed Spark dialect failure, normal [DONE] completion, and categories for non-success HTTP responses and initial fetch rejection. This report tracks the distinct accepted-HTTP/midstream diagnostic boundary; it is not a demonstrated regression in that candidate.

Expected behavior

An observed upstream protocol/stream failure should produce a fixed, safe upstream-failure message, without raw provider diagnostics, user content, credentials, or private capability URLs. Reserve CLI upgrade guidance for a known CLI rejection.

Root cause

Owner source inspection of src/llm/codex-responses-gateway.ts found that the HTTP-200 body/content-type/stream failure paths can reach the generic error response without setting upstreamFailureCategory. In src/llm/codex-process.ts, a resulting nonzero child exit whose stderr contains only the generic gateway message has no recognized category and falls back to createProcessCompatibilityError.

Original baseline: df3b3a04fd00768e8a1d85840e1cfbd2b8a0995e. This remaining path was observed during read-only review of candidate fcc91bc8984ee4a653593ef47ed0c51a4311ced0. No production change or real-provider reproduction of these additional cases has been performed for this report.

Reproduction / validation to add

Use deterministic public gateway and fake Codex-child seams with synthetic text:

  1. Return HTTP 200 with an invalid content type or a body that errors while reading; also test a semantic failed/incomplete SSE response.
  2. Have the fake Codex child exit nonzero with the safe generic gateway error on stderr.
  3. Assert that the public summarizer currently reaches the compatibility/upgrade fallback rather than an upstream protocol/stream category.
  4. Add failure-precedence, cancellation, and redaction checks when repairing the gap. Distinguish caller cancellation from upstream stream failure.

Environment

Follow-up outside #1154's fixed repair inventory. Related: #1154, #1157, historical #780. The main Spark repair must retain its own successful live acceptance and exact-head review/CI evidence.

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

    Type

    Fields

    Priority

    Medium

    Effort

    None yet

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions