Skip to content

[#82]: Add compat guard test for v0.131.0 hyphenated API headers#89

Open
delexw wants to merge 1 commit into
mainfrom
fix-issue-82
Open

[#82]: Add compat guard test for v0.131.0 hyphenated API headers#89
delexw wants to merge 1 commit into
mainfrom
fix-issue-82

Conversation

@delexw
Copy link
Copy Markdown
Contributor

@delexw delexw commented May 31, 2026

Summary

Codex v0.131.0 (PRs #21757, #22193) changed the HTTP header names it sends to the OpenAI API from underscore form (x_codex_session_id, x_codex_thread_id) to hyphen form (x-codex-session-id, x-codex-thread-id). The old underscored headers are no longer sent.

codex-trace is not affected: it reads session and thread IDs exclusively from JSONL payload fields (id, session_id, thread.sessionId) in the session files at ~/.codex/sessions/. It does not intercept HTTP traffic or inspect HTTP request/response headers sent by the Codex CLI to OpenAI.

Changes

src-tauri/src/parser/entry.rs — new test v0131_hyphenated_api_headers_do_not_affect_session_id_extraction:

  • Documents that PRs #21757/#22193 changed transport-layer HTTP headers, not JSONL payload structure
  • Confirms extract_session_id correctly reads session_id from a v0.131.0 session_meta payload
  • Asserts that neither x_codex_session_id nor x-codex-session-id (nor thread variants) appear as JSONL payload keys — they are HTTP transport details only

Verification

  • cargo test --lib — 132 tests pass (includes the new guard test)
  • cargo clippy -- -D warnings — clean, no warnings
  • npx vitest run — 128 frontend tests pass
  • HTTP API smoke test — backend starts headless and /api/sessions returns valid JSON

Fixes #82

Codex v0.131.0 (PRs #21757, #22193) changed HTTP header names from
underscore form (x_codex_session_id, x_codex_thread_id) to hyphen form
(x-codex-session-id, x-codex-thread-id).

codex-trace reads session IDs from JSONL payload fields (id, session_id,
thread.sessionId) — not from HTTP headers. The transport-layer header
rename has no impact on session parsing.

Adds a regression guard test in entry.rs that:
- Documents the v0.131.0 header change with PR references
- Confirms session ID extraction from JSONL is unaffected
- Asserts that neither underscore nor hyphen header-name strings appear
  as JSONL payload keys

Fixes #82
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.

[Compat] Codex v0.131.0: API session/thread headers changed from underscored to hyphenated form

1 participant