Skip to content

test(aikit): OpenAI and Codex e2e model matrix, with the fixes it found - #41

Merged
sanchitrk merged 2 commits into
devfrom
fix-test-cov-openai
Sep 30, 2026
Merged

sanchitrk merged 2 commits into
devfrom
fix-test-cov-openai

Conversation

@sanchitrk

Copy link
Copy Markdown
Contributor

Summary

Runs every OpenAI and Codex e2e suite against a model matrix, adds new live suites, and fixes the bugs those runs surfaced.

Matrices (test/utils/llm.ts)

  • OpenAI: gpt-6-luna, gpt-5.6-luna, gpt-5.5, gpt-5.4, gpt-5.4-mini, gpt-5.4-nano
  • Codex: gpt-6-luna, gpt-5.6-luna, gpt-5.5. The Codex backend rejects gpt-5.4, gpt-5.4-mini and gpt-5.4-nano for ChatGPT accounts ("not supported when using Codex with a ChatGPT account").

Reasoning is low by default, medium for thinking tests, and high for multi-turn, replay and handoff (smaller models skip reasoning on easy prompts below high).

New suites

  • thinking.levels: every model × every reasoning level plus off, live
  • overflow: an oversized prompt must return an error isContextOverflow recognises; writes __artifacts__/overflow.*.json
  • handoff: reasoning-only aborted turn replay, mid-conversation model switch, Codex ↔ OpenAI in both directions
  • cache: a follow-up request in the same sessionId reads the cached prefix

Fixes

Issue Fix
OpenAI/Codex reject minimal on every matrix model; max only works on gpt-5.6/gpt-6; gpt-6-luna had no level map; Codex gpt-6-luna missing; Codex models couldn't turn reasoning off although the API accepts none modelgen.ts catalog, verified against the live APIs
@ai-sdk/openai 4.0.66 dropped reasoningEffort: "none" for gpt-6-luna Bump to 4.0.81 (+ @ai-sdk/provider 4.0.19 to align types)
An overflowing prompt was sent with max_output_tokens: 1, rejected by OpenAI (min 16), hiding the overflow MIN_MAX_TOKENS 1 → 16 in shared.ts
Codex call|item tool-call IDs (83 chars) sent to OpenAI exceed its 64-char call_id limit Normalise IDs for OpenAI targets in transform.ts
OpenAI sometimes reports overflow mid-stream (StreamProviderError), classified as Unknown Classify it like APICallError in failure.ts

The Codex catalog window stays at 272k on purpose (input above that is billed at long-context rates); the server accepts up to ~1.05M, so the overflow test targets the hard limit.

Test plan

  • vp check, vp run typecheck
  • pnpm test (246 unit)
  • vp test test/e2e -t OpenAI (all OpenAI + Codex live suites, 342 tests)

Regenerate the gitignored catalog before running the e2e suites:

pnpm --filter @codeworksh/aikit cli modelgen ../../models.gen.json

🤖 Generated with Claude Code

sanchitrk and others added 2 commits September 30, 2026 17:41
… handling

- modelgen: live-verified thinking levels for gpt-5.4 through gpt-6 (no
  minimal; max only on gpt-5.6/gpt-6; none on Codex gpt-5.5/5.6-luna/6-luna)
  and add Codex gpt-6-luna
- bump @ai-sdk/openai to 4.0.81 so gpt-6-luna accepts reasoning "none"
- floor the context-clamped max tokens at 16 so an overflowing prompt
  surfaces as an overflow instead of an invalid max_output_tokens
- normalize Codex call|item tool call IDs for OpenAI targets (64-char cap)
- classify in-stream StreamProviderError like APICallError

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every OpenAI suite runs on gpt-6-luna through gpt-5.4-nano and every Codex
suite on gpt-6-luna, gpt-5.6-luna and gpt-5.5. Adds thinking-level, context
overflow, handoff and prompt-cache suites.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sanchitrk
sanchitrk merged commit 386dfe6 into dev Sep 30, 2026
@sanchitrk
sanchitrk deleted the fix-test-cov-openai branch October 8, 2026 06: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