[codex] Add transport params runtime contracts#71048
[codex] Add transport params runtime contracts#71048100yenadmin wants to merge 4 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR adds a test-only Phase 1 runtime contract suite covering OpenAI/Pi transport defaults, alias normalization, API-family Confidence Score: 5/5Safe to merge — test-only change with no production runtime impact. All remaining findings are P2 style/robustness suggestions (fragile optional-chain lookup, unused No files require special attention beyond the two P2 comments. Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/agents/transport-params-runtime-contract.test.ts
Line: 119-120
Comment:
The `?.thinkLevel` optional chain here silently produces `undefined` if `"high"` is ever removed from `CODEX_REASONING_EFFORT_CASES`, causing the test to pass with no `thinkingLevel` rather than failing loudly. Since the intent is simply to pick a high-effort level for the hook-order test, a direct literal avoids the fragility entirely.
```suggestion
thinkingLevel: "high",
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: test/helpers/agents/transport-params-runtime-contract.ts
Line: 6-27
Comment:
The `api` field in `OPENAI_GPT5_TRANSPORT_DEFAULT_CASES` and `NON_OPENAI_GPT5_TRANSPORT_CASE` is exported but never consumed by any test — `resolveExtraParams` only takes `{ cfg, provider, modelId }`. If the intent is to document which API family each case corresponds to, a comment would make that clearer; if it was meant to feed a future API-boundary assertion, a note to that effect would help future readers.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "test: add transport params runtime contr..." | Re-trigger Greptile |
There was a problem hiding this comment.
Pull request overview
Adds a Phase 1, test-only runtime contract suite to lock down transport-parameter behavior across the Pi/OpenAI path and the Codex app-server adapter, as groundwork for a shared AgentRuntimePlan (RFC #71004).
Changes:
- Introduces shared contract fixtures for GPT-5 transport defaults, API-family payload patch boundaries, and Codex adapter inputs.
- Adds Pi-side contract tests covering OpenAI GPT-5 defaults, alias normalization, payload patch eligibility, and provider hook ordering.
- Adds Codex app-server contract tests covering adapter transport config preservation and think-level → effort mapping.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/helpers/agents/transport-params-runtime-contract.ts | Shared fixtures/constants used by both Pi and Codex contract tests. |
| src/agents/transport-params-runtime-contract.test.ts | Pi/OpenAI runtime contract tests for defaults, alias normalization, payload patch support, and hook ordering. |
| extensions/codex/src/app-server/transport-params-runtime-contract.test.ts | Codex adapter contract tests for app-server runtime options and turn effort mapping. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1eddd6ba1e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba03cbbdd2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
Adds the transport-params contract rung from RFC #71004. This is test-only: it documents OpenClaw-owned GPT-5/OpenAI-family transport policy that must stay stable while Pi and Codex move toward a shared
AgentRuntimePlan.No production runtime behavior changes.
Files Changed And Why
test/helpers/agents/transport-params-runtime-contract.tssrc/agents/transport-params-runtime-contract.test.tsContract Matrix
openai/*andopenai-codex/*receive exact shared GPT-5 defaults.parallel_tool_callssupport includesopenai-codex-responses.openai-codex/gpt-5.4Responses-family payloads receive the expected transport patch.openaiWsWarmup: false.reasoning.effortwhen the reasoning wrapper is active.Intentional Boundary
Codex app-server startup config and turn-start effort mapping are intentionally excluded from this PR. Those are Codex adapter lifecycle concerns, not shared Pi/OpenAI transport-param policy, and should be covered when Codex consumes
AgentRuntimePlan.How This Helps The RuntimePlan Work
Transport params are currently easy to scatter by API string and wrapper path. These tests define the shared policy that the plan should compute once, especially around
openai-codex-responsesand GPT-5 defaults.Reviewer Notes
Verification
node scripts/run-vitest.mjs run --config test/vitest/vitest.agents.config.ts src/agents/transport-params-runtime-contract.test.ts./node_modules/.bin/oxlint --tsconfig tsconfig.oxlint.core.json test/helpers/agents/transport-params-runtime-contract.ts src/agents/transport-params-runtime-contract.test.tsgit diff --check -- test/helpers/agents/transport-params-runtime-contract.ts src/agents/transport-params-runtime-contract.test.tsRefs #71004
Follows #71009, #71029, #71038, #71039, #71042, #71044, #71046