Use Claude Code with your ChatGPT, Kimi, Cursor or Grok subscription via a local Anthropic-compatible proxy
Rust
test live Codex delivery boundaries
Raine Virta298bae77712f
diff --git a/src/providers/codex/mod.rs b/src/providers/codex/mod.rsindex 244b232..b9b6a50 100644--- a/src/providers/codex/mod.rs+++ b/src/providers/codex/mod.rs@@ -1071,6 +1071,23 @@ mod tests {assert!(output.starts_with("Expires: 2000-01-01T00:00:00.000Z (in -"));}+ #[tokio::test]+ async fn live_upstream_status_and_retry_after_are_preserved() {+ let err = client::CodexError {+ status: 422,+ message: "invalid request".to_string(),+ detail: Some("invalid request".to_string()),+ retry_after: Some("7".to_string()),+ origin: client::CodexErrorOrigin::WebSocketHandshake,+ };+ let response = map_codex_error_to_response(&err);+ assert_eq!(response.status(), StatusCode::UNPROCESSABLE_ENTITY);+ assert_eq!(+ response.headers().get(http::header::RETRY_AFTER).unwrap(),+ "7"+ );+ }+#[tokio::test]async fn statusless_codex_error_returns_source_message() {let err = client::CodexError {