Skip to content

test: cover nonstream upstream failed response shape#7

Merged
HisenWeb merged 2 commits into
mainfrom
test/nonstream-upstream-error-failed-response
Jun 24, 2026
Merged

test: cover nonstream upstream failed response shape#7
HisenWeb merged 2 commits into
mainfrom
test/nonstream-upstream-error-failed-response

Conversation

@HisenWeb

Copy link
Copy Markdown
Owner

Summary

Adds P1-3 regression coverage for non-stream upstream HTTP errors.

After inspection, the runtime already returns a Responses-shaped body with status: failed for non-stream /v1/responses upstream failures. This PR therefore locks the behavior with a focused regression test instead of changing runtime code.

Changes

  • Adds tests/nonstream_upstream_error_regression.rs.
  • Verifies upstream HTTP errors produce a Responses object with:
    • object: response
    • status: failed
    • empty output
    • zeroed usage
    • original model alias and metadata
    • error.type/code: upstream_error
  • Adds docs/p1-nonstream-upstream-error.md documenting the current behavior and the future HTTP-200 policy option if real Codex validation requires it.

Current policy

The adapter currently preserves the upstream HTTP status while returning a Responses failed body. If real Codex subagent validation shows that non-2xx status still breaks the chain, the next policy change should be explicit: return HTTP 200 with response.status = failed for /v1/responses upstream errors.

Validation

Edited via GitHub connector. Please run locally before merge:

cargo fmt --check
cargo test --test nonstream_upstream_error_regression
cargo test --test test_e2e
cargo test

Notes

This PR intentionally does not change /v1/models upstream error behavior.

@HisenWeb
HisenWeb marked this pull request as ready for review June 24, 2026 23:18
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@HisenWeb
HisenWeb merged commit 4ea50ee into main Jun 24, 2026
1 check passed
@HisenWeb
HisenWeb deleted the test/nonstream-upstream-error-failed-response branch June 24, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant