Repository navigation
feat(codex): pass sdk_options.effort as model_reasoning_effort - #269
danmunteanu1 wants to merge 2 commits into
Conversation
|
Claude finished @danmunteanu1's task in 1m 16s —— View job PR Review in Progress
|
uipreliga
left a comment
There was a problem hiding this comment.
Review: coder_eval — pr:269 --post-comment
Scope: pr:269 --post-comment · branch feat/codex-reasoning-effort (PR #269 head) · 3056099 · 2026-11-25T19:20Z · workflow variant
Change class: complex — changes the public CodexAgentConfig schema (sdk_options now accepted and validated) and adds a new value to the Codex thread config
The codebase is healthy (9.7/10, with no critical or high findings and clean Security and Error Handling axes), but the new Codex sdk_options.effort path has three real risks: an unhashable effort value raises a raw TypeError that stops the whole suite, the tier goes through an untyped config key that an SDK rename can silently ignore, and reports cannot show effort variants apart; fix these three before you rely on Codex effort A/B results.
Summary
| Axis | Score | 🔴 | 🟠 | 🟡 | 🔵 | Top Issue |
|---|---|---|---|---|---|---|
| 1. Code Quality & Style | 9.4 / 10 | 0 | 0 | 1 | 1 | Codex sdk_options single-key validator is a near-copy of Delegate's effort-only validator |
| 2. Type Safety | 9.9 / 10 | 0 | 0 | 0 | 1 | Codex effort tier is an untyped dict[str, Any] entry checked against a runtime frozenset, not a typed Literal field |
| 3. Test Health | 9.4 / 10 | 0 | 0 | 1 | 1 | PR deletes the only tests of the friendly '-D sdk_options on a kind that has none' OverrideError branch |
| 4. Security | 10 / 10 | 0 | 0 | 0 | 0 | — |
| 5. Architecture & Design | 9.9 / 10 | 0 | 0 | 0 | 1 | Codex effort uses the untyped thread config dict instead of the SDK's typed effort parameter |
| 6. Error Handling & Resilience | 10 / 10 | 0 | 0 | 0 | 0 | — |
| 7. API Surface & Maintainability | 9.4 / 10 | 0 | 0 | 1 | 1 | Codex effort validator raises a raw TypeError (not a ValidationError) for an unhashable value, which skips OverrideError formatting and per-task skip isolation, and no test covers it |
| 8. Evaluation Harness Quality | 9.5 / 10 | 0 | 0 | 1 | 0 | Codex effort is not rendered in Agent Settings, so run.md/experiment.md/HTML cannot tell effort variants apart |
Overall Score: 9.7 / 10 · Weakest Axis: Code Quality & Style at 9.4 / 10
Totals: 🔴 0 · 🟠 0 · 🟡 4 · 🔵 5 across 8 axes.
Blockers
None.
Non-blocking, but please consider before merge
- [Axis 1] Codex sdk_options single-key validator is a near-copy of Delegate's effort-only validator (
src/coder_eval/models/agent_config.py:412-423) — The newCodexAgentConfig._validate_sdk_options_keys(lines 412-423) has the same shape asDelegateAgentConfig._validate_sdk_options_keys(lines 618-629). Both have a module-levelfrozenset({"effort"})allowlist (_CODEX_SDK_OPTION_FIELDSat line 370,_DELEGATE_SDK_OPTION_FIELDSat line 560), the same unknown-key checkunknown = sorted(set(v) - _CODEX_SDK_OPTION_FIELDS)/unknown = sorted(set(v) - _DELEGATE_SDK_OPTION_FIELDS), the sameraise ValueError(f"sdk_options keys {unknown} are not ... coder_eval forwards " + f"(valid keys: {sorted(...)})"), and the sameif "effort" in v and ...value check. Only the agent label and the effort predicate differ (closed tier set for Codex,isinstance(..., str)for Delegate). This is duplication across 2 sites, the Axis 1 Medium anchor. A third agent that adoptssdk_options.effort(the PR's docs push-D agent.sdk_options.effort=highas the cross-agent lever) would make a third copy. Fix: add one private helper, for example_validate_effort_only_sdk_options(v, *, owner: str, tiers: frozenset[str] | None) -> dict[str, Any], and call it from both validators. One shared_EFFORT_ONLY_SDK_OPTION_FIELDS = frozenset({"effort"})can replace the two identical frozensets. - [Axis 3] PR deletes the only tests of the friendly '-D sdk_options on a kind that has none' OverrideError branch (
tests/test_overrides_engine.py:145) — On main, three tests reached the rejection branch at src/coder_eval/orchestration/overrides.py:153-158 (if type_value not in accepting: ... raise OverrideError(f"sdk_options cannot be used with {where}. This option is only supported for " ...)). They are test_overrides_engine.py:147 and :182 and test_merge_characterization.py:331, and all three used Codex as the kind that rejects the option. This PR changes all three into 'applies' tests:def test_sdk_options_effort_on_codex_applies(self):here,def test_sdk_options_effort_with_agent_type_codex_applies(self):at line 185, and test_merge_characterization.py:327. It adds no test for another kind that still rejects the option. I measured coverage of coder_eval.orchestration.overrides over the 12 related test files (overrides_engine, merge_characterization, cli_sdk_options, cli_set_overrides, experiment_resolver, config_lineage, cli_type_flag, dataset_expansion, and others). Lines 154-155 now show as missing. On main they are covered. The branch is still live: opencode, antigravity, pi and none have no sdk_options. Its message also changes with this PR. A probe shows the new message: 'sdk_options cannot be used with agent type opencode. This option is only supported for claude-code, codex, delegate agents.' Add a test that applies{"agent.sdk_options.effort": "high"}to an opencode (or pi) task and asserts the full message, including the accepted-kinds list that now names codex. Add a second test for theagent_type=rewrite path (--type opencode), because that is the second test this PR removed. - [Axis 7] Codex effort validator raises a raw TypeError (not a ValidationError) for an unhashable value, which skips OverrideError formatting and per-task skip isolation, and no test covers it (
src/coder_eval/models/agent_config.py:421) — At line 421 the validator runsif "effort" in v and v["effort"] not in _CODEX_EFFORT_TIERS:. That is a membership test against a frozenset, so an unhashable value raisesTypeError: unhashable type. Pydantic does not convert a TypeError into a ValidationError. I reproduced this in the PR worktree:parse_agent_config(type=AgentKind.CODEX, sdk_options={'effort': ['high']})raisesTypeError: unhashable type: 'list', and{'effort': {'a': 1}}raisesunhashable type: 'dict'. Two common typos produce such values: the YAMLeffort: {high}and-D agent.sdk_options.effort=[high](parse_scalarYAML-parses the value).overrides._resolvere-raises onlyMergeErrorandValidationErrorasOverrideError. Experiment resolution isolates a failing task only for(FileNotFoundError, OSError, ValueError, yaml.YAMLError)(experiment.py:662/721). So this TypeError gets no clear CLI message, and it does not skip only the bad task: it propagates and aborts the whole suite. The notes reserve TypeError for loader regressions. Delegate's validator avoids this because it checksisinstance(v["effort"], str)first. Fix: writeif "effort" in v and (not isinstance(v["effort"], str) or v["effort"] not in _CODEX_EFFORT_TIERS):, and add["high"]to the@pytest.mark.parametrize("effort", ["extreme", 3, None])case at tests/test_codex_reasoning_effort.py:44. Cross-axis: Error Handling (6) and Harness (8). - [Axis 8] Codex effort is not rendered in Agent Settings, so run.md/experiment.md/HTML cannot tell effort variants apart (
src/coder_eval/agents/codex_agent.py:1801) — The PR addseffort = self.config.sdk_options.get("effort")/tool_config["model_reasoning_effort"] = effort(lines 1801-1803). CodexAgent does not overrideget_sdk_options(), soEvaluationResult.sdk_optionsstays None for Codex.resolve_agent_settingsand html_render_agent_settingsthen fall back toagent_configwithis_sdk=False.collect_agent_settings_rowsadds the("effort", "Effort")row only insideif is_sdk:, and only from a top-level key. I confirmed this at PR HEAD: a codex config withsdk_options={'effort':'high'}renders only[('Permission Mode','acceptEdits'), ('Allowed Tools','(all)'), ('Model','gpt-5')]. In an A/B experiment of codex at effort high against codex at effort xhigh, both variants show the same Agent Settings. Claude Code and Delegate (whoseget_sdk_optionsincludeseffort) show the row. The value is present in run.json only asagent_config.sdk_options.effort. The previous PR #267 handled the same problem forcontext_windowwithresolve_context_window, which reads it fromagent_config. Do the same for effort: renderagent_config.sdk_options.effortwhensdk_optionsis absent. Another option is to give CodexAgent aget_sdk_options()that returns the thread config with provider credentials redacted. Add a report-row test.
Nits
- [Axis 1] Validator named
_validate_sdk_options_keysnow also validates the effort value (src/coder_eval/models/agent_config.py:414) — Line 414,def _validate_sdk_options_keys(cls, v: dict[str, Any]) -> dict[str, Any]:, rejects unknown keys and also rejects an unknown tier value (line 421,if "effort" in v and v["effort"] not in _CODEX_EFFORT_TIERS:). The name says only half of what the function does. It copies the Delegate name, which has the same problem, so you can rename both together, for example to_validate_sdk_options. You can also do this as part of the shared-helper fix in finding 1. This is a naming nit. - [Axis 2] Codex effort tier is an untyped dict[str, Any] entry checked against a runtime frozenset, not a typed Literal field (
src/coder_eval/models/agent_config.py:381) — Line 381sdk_options: dict[str, Any] = Field(and line 373_CODEX_EFFORT_TIERS: frozenset[str] = frozenset({"none", "minimal", "low", "medium", "high", "xhigh", "max", "ultra"})put the closed tier set only in a runtime frozenset. Pyright cannot see it, the JSON schema does not show it, and codex_agent.py:1801 (effort = self.config.sdk_options.get("effort")) gets anAnythat goes intotool_config["model_reasoning_effort"]with no type check. The field copies the existing Delegate/Claudesdk_optionsdict shape, which the shared-D agent.sdk_options.effortpath depends on, so this is Low. A small fix keeps the dict shape: declareCodexReasoningEffort = Literal["none", ..., "ultra"], build_CODEX_EFFORT_TIERS = frozenset(get_args(CodexReasoningEffort))from it, and validate throughTypeAdapter(CodexReasoningEffort)or a typed accessor that returnsCodexReasoningEffort | Nonefor the agent. This also fixes the unhashable-value TypeError, because the Literal check gives a ValidationError. The existingtest_the_tiers_match_the_sdkcheck againstopenai_codex.api.ReasoningEffortkeeps working unchanged. - [Axis 3] The new 'other key on Codex raises' test matches any OverrideError that contains 'sdk_options', so it does not pin the new validator (
tests/test_overrides_engine.py:152) —with pytest.raises(OverrideError, match="sdk_options"):also matches the friendly 'sdk_options cannot be used with agent type codex...' message that this PR replaced. If CodexAgentConfig lost its sdk_options field, the test would still pass. A probe shows the real message: "-D agent.sdk_options: Value error, sdk_options keys ['max_thinking_tokens'] are not Codex options coder_eval forwards (valid keys: ['effort'])". Match onare not Codex options, as test_codex_reasoning_effort.py:41 does, so the test asserts the new contract. - [Axis 5] Codex effort uses the untyped thread config dict instead of the SDK's typed effort parameter (
src/coder_eval/agents/codex_agent.py:1801) — Lines 1801-1803 put the tier into the free-form threadconfigdict:effort = self.config.sdk_options.get("effort")/if effort is not None:/tool_config["model_reasoning_effort"] = effort. The pinned openai_codex SDK has a typed parameter for this:Thread.turn(..., effort: ReasoningEffort | None = None), documented as "Override the reasoning effort for this turn and subsequent turns". This agent callsself.thread.turnat line 1862 (turn_handle = await self._run_async(self.thread.turn, state.user_input)). The new test module admits the cost of this choice in tests/test_codex_reasoning_effort.py lines 3-5: "the openai_codex SDK passes that dict through unchecked, so a Codex release that renamed the key would go unnoticed here." If the key changes, every effort tier silently runs at the default, and an effort A/B experiment then compares identical configurations with no error. context_window and tool_output_token_limit go throughconfigbecause they have no typed parameter, but effort does. Recommendation: passeffort=ReasoningEffort(self.config.sdk_options["effort"])tothread.turnat line 1862. An SDK rename then fails as an import or type error, and the existing tier-parity test (api.ReasoningEffort) already ties the validator to that enum. If thread-level config is deliberate, for example so the setting persists across resume, record that reason in .claude/notes/agents.md section Codex. - [Axis 7] The PR edits the sdk_options section of TASK_DEFINITION_GUIDE but leaves the Agent Types list saying only claude-code supports sdk_options (
docs/TASK_DEFINITION_GUIDE.md:225) — Line 225 still says "claude-code(default) — Claude Code SDK agent. Supportssdk_options,claude_settings, and all permission modes." Thecodexbullet on line 226 does not mentionsdk_options. After this PR, codex (and delegate, which this list does not show) takessdk_options.effort, so a reader of this list concludes that Codex rejects the key. Addsdk_options.effort(passed asmodel_reasoning_effort, link toagents/CODEX.md#reasoning-effort) to the codex bullet, or remove the per-typesdk_optionsclaim here and point to the list at lines 194-201.
What's Missing
Parallel paths:
- 🟡 The PR makes
sdk_options.efforta cross-agent setting (CODEX.md and DELEGATE.md say-D agent.sdk_options.effort=highdrives Claude Code, Codex and Delegate), but docs/agents/HARNESS_PARITY.md has no row for effort. Each agent accepts a different set of tiers. Claude Code's SDK typeseffortas Literal low/medium/high/xhigh/max. Codex accepts none/minimal/low/medium/high/xhigh/max/ultra. Delegate accepts any string, and the host falls back to the default for a tier it does not know. Antigravity, OpenCode and Pi set effort through their own typed fields with other names and other tier sets. Soeffort=ultraoreffort=noneloads on Codex but not on Claude Code, and-D agent.sdk_options.effort=highfails on opencode, pi and antigravity. The CLAUDE.md parity rule says a shared field must mean the same on every backend, or the difference must be documented. Add an effort section to HARNESS_PARITY.md that lists the field name and tier set for each agent, and what an unknown tier does. (trigger: docs/agents/CODEX.md) - 🔵 The Agent Types list in TASK_DEFINITION_GUIDE.md still says only
claude-codesupportssdk_options, and experiments/default.yaml still describes thesdk_optionsblock as 'Claude Code SDK pass-through options'. The PR updates the sdk_options list at line 194 but not these other places that describe which kinds accept the key. (trigger: docs/TASK_DEFINITION_GUIDE.md) (restates: Axis 7: The PR edits the sdk_options section of TASK_DEFINITION_GUIDE but leaves the Agent Types list saying only claude-code supports sdk_options)
Tests:
- 🟡 No test reaches the friendly 'sdk_options cannot be used with agent type X' OverrideError branch now. The PR changed all three tests that used Codex as the rejecting kind into 'applies' tests, and its accepted-kinds message now names codex. Add a test for opencode or pi, and one for the
--type opencoderewrite path. (trigger: tests/test_overrides_engine.py) (restates: Axis 3: PR deletes the only tests of the friendly '-D sdk_options on a kind that has none' OverrideError branch) - 🟡 The new effort validator has no test for an unhashable value.
effort: ['high']oreffort: {a: 1}raises a raw TypeError, not a ValidationError. Add['high']to the parametrize in test_codex_reasoning_effort.py:44. (trigger: tests/test_codex_reasoning_effort.py) (restates: Axis 7: Codex effort validator raises a raw TypeError (not a ValidationError) for an unhashable value, which skips OverrideError formatting and per-task skip isolation, and no test covers it) - 🔵 No test covers
sdk_options.effortacross the 5-layer merge or a kind switch. The companion tool_output_token_limit tests in test_codex_tool_output_cap.py check YAML null throughresolve_root, a variant that switches away from Codex, and a-Dround-trip with clean error text. test_codex_reasoning_effort.py tests onlyparse_agent_configdirectly. Addresolve_rootcases for three switches: (a) a claude-code task withsdk_options: {effort: high}and a codex variant, which now inherits the effort; (b) the same withmax_thinking_tokens, which must fail; (c) a codex task witheffort: ultraand a claude-code variant. Also add anapply_overridestest for an invalid tier that asserts the-D agent.sdk_options.effort: ... must be one ofmessage. (trigger: tests/test_codex_reasoning_effort.py) - 🔵 The new test module stops at the thread
configdict, and its own docstring says a Codex rename ofmodel_reasoning_effortwould go unnoticed. No test pins the key against the SDK, and no test passes the typedThread.turn(effort=...)parameter. (trigger: tests/test_codex_reasoning_effort.py) (restates: Axis 5: Codex effort uses the untyped thread config dict instead of the SDK's typed effort parameter)
Downstream consumers:
- 🔵 Downstream readers of the effort tier get nothing for Codex. Codex does not override
get_sdk_options(), so run.json/task.jsonsdk_optionsstaysnullfor Codex rows, and Codex's effort is stored only asagent_config.sdk_options.effort. Claude Code and Delegate rows expose it under top-levelsdk_options.effort. This affects anything that slices by effort: the report Agent Settings, the evalboard, and the coder-eval-uipath pipeline. docs/REPORT_SCHEMA.md (thesdk_optionsentry near line 175) does not say where a Codex row keeps its effort. Documentagent_config.sdk_options.effortas the Codex location, or make Codex return its thread config fromget_sdk_options()with credentials redacted. (trigger: src/coder_eval/agents/codex_agent.py) (restates: Axis 8: Codex effort is not rendered in Agent Settings, so run.md/experiment.md/HTML cannot tell effort variants apart)
Display & mapping dicts:
- 🟡 The Effort row in
collect_agent_settings_rows(reports/markdown.py:137) is shown only whenis_sdkis true, and it reads a top-level key. The html_render_agent_settingshas the same gate. Neither extends to the nestedagent_config.sdk_options.effortthat Codex now uses, so Codex effort A/B variants show the same Agent Settings. No report-row test asserts that a Codex effort value is rendered. (trigger: src/coder_eval/agents/codex_agent.py) (restates: Axis 8: Codex effort is not rendered in Agent Settings, so run.md/experiment.md/HTML cannot tell effort variants apart)
Daily/nightly:
- 🔵 The PR does not say what changes for scheduled or nightly runs and for experiment configs in the coder-eval-uipath repo. Before this PR,
sdk_options.effortin experiment defaults or a variant failed to load for Codex. Now it goes to Codex silently asmodel_reasoning_effortand overrides anymodel_reasoning_effortin the runner's$CODEX_HOME/config.toml. A nightly that shares a Claude-tunedeffortdefault across agents now changes Codex's tier, and its Codex trend lines move with no change to any recorded Codex-specific field. Run.jsonsdk_optionsstays null for Codex, so a dashboard cannot see the change. State this in the PR, and add a trend-break note like the one CODEX.md has fortool_output_token_limit. (trigger: src/coder_eval/models/agent_config.py)
Harness & Lint Improvements
Static checks (lint / type):
- [ce-lint] CE074
no-unguarded-allowlist-membership-in-validator(tests/lint/rules/ce074_no_unguarded_allowlist_membership.py, wired in tests/lint/runner.py). Scope: src/coder_eval/models/**. Inside a function decorated@field_validator/@model_validator, flag aComparewithIn/NotInwhen the left operand is a Subscript or.get(...)on the validator's value parameter and the right operand is a module-level name bound tofrozenset(...)/set(...)/ a set literal, unless the sameBoolOpfirst has anisinstance(<same expr>, ...)guard. The rule message must recommend the Literal route from the pyright entry below: aLiteralplusTypeAdaptergives a ValidationError, not a TypeError. Known blind spot: it does not see a value that was first bound to a local name. Prevents: Finding 'Codex effort validator raises a raw TypeError for an unhashable value' (src/coder_eval/models/agent_config.py:421,v["effort"] not in _CODEX_EFFORT_TIERS). The rule does not flag the Delegate validator, because itsisinstance(v["effort"], str)guard comes first. - [pyright] Express the closed tier set as a type so that pyright can check it. Declare
CodexReasoningEffort = Literal["none", ..., "ultra"]. Build_CODEX_EFFORT_TIERS = frozenset(get_args(CodexReasoningEffort))from it. Validate withTypeAdapter(CodexReasoningEffort). Add a typed accessorCodexAgentConfig.effort -> CodexReasoningEffort | Noneand use it at codex_agent.py:1801 in place ofself.config.sdk_options.get("effort"), which returnsAny. Pyright cannot look intodict[str, Any], so the typed accessor is what puts this value under the type gate. As an optional second clause, CE074 could also forbid a module-levelfrozenset({<str literals only>})in models/ when it is used as a value allowlist, unless it is built withget_args(<Literal>). Prevents: Finding 'Codex effort tier is an untyped dict[str, Any] entry checked against a runtime frozenset' (agent_config.py:373/381, codex_agent.py:1801). It also removes the TypeError shape at agent_config.py:421 at its root. - [pyright] Pass the effort through the typed SDK parameter:
self.thread.turn(..., effort=ReasoningEffort(...))at codex_agent.py:1862, nottool_config["model_reasoning_effort"]. If the pinned openai_codex SDK renames or removes the parameter or the enum,make typecheckthen fails. With the current free-form config dict, the effort silently falls back to the default. This holds only if the typecheck environment installs the[codex]extra. Check that this is true, or add the extra to the environment. Prevents: Finding 'Codex effort uses the untyped thread config dict instead of the SDK's typed effort parameter' (src/coder_eval/agents/codex_agent.py:1801, and the gap that tests/test_codex_reasoning_effort.py:3-5 admits). - [ce-lint] CE075 doc parity, as a
@pytest.mark.lintclass in tests/test_custom_lint.py (it reasons over Markdown). The set of backticked agent kinds in thesdk_optionsper-type bullet list of docs/TASK_DEFINITION_GUIDE.md ('Each agent type validates its own keys at YAML load') must equalorchestration.overrides._kinds_accepting_sdk_options(). Delete before you guard: remove the per-type claim 'Supportssdk_options' from the 'Agent Types' bullets (line 225), so that the guarded list is the only place in the guide that states which kinds accept sdk_options. Prevents: Finding 'The PR edits the sdk_options section but leaves the Agent Types list saying only claude-code supports sdk_options' (docs/TASK_DEFINITION_GUIDE.md:225). It also prevents the next drift when another kind adoptssdk_options.effort.
Harness improvements (not statically reachable):
- Add a sdk_options override contract test that takes its cases from the registry and not from one hardcoded sample kind. Parametrize over every registered AgentKind and apply
-D agent.sdk_options.effort=high, on both the plain path and the--type <kind>rewrite path. Assert that the override applies if and only if the kind's config class declaressdk_options. Otherwise, assert the full friendly OverrideError message, including the accepted-kinds list from_kinds_accepting_sdk_options(). For each kind that accepts sdk_options, also assert two more things: an unknown key raises the validator's own message (match on 'are not options', not on 'sdk_options'), and an unhashable effort value (["high"]) raises OverrideError/ValidationError, not TypeError. Why not static: The test must run the override engine and the plugin registry to know which kinds accept sdk_options and which error path fires. A single-wordmatch=is too common to forbid statically: tests/ has 73 such matches, and most of them are correct. Prevents: Finding 'PR deletes the only tests of the friendly OverrideError branch' (overrides.py:153-158 now uncovered; tests/test_overrides_engine.py:145/185, test_merge_characterization.py:327). Finding 'new other-key-on-Codex test matches any OverrideError containing sdk_options' (test_overrides_engine.py:152). It also catches the unhashable-value TypeError (agent_config.py:421) for every current and future copy of the effort validator. - Add a diff-coverage gate to
make verify/ CI, for example diff-cover or a coverage comparison against the merge base. The gate fails when a changed PR makes a line in src/ that main covered uncovered, even when the global 80% threshold still passes. Why not static: It needs a test run with coverage on both sides of the diff. The branch was still reachable and correct. It only lost its tests, and no AST property shows that. Prevents: Finding 'PR deletes the only tests of the friendly OverrideError branch' (orchestration/overrides.py:154-155 covered on main, missing on the PR). - Add an Agent Settings report parity test. For each agent kind whose config accepts
sdk_options, build an EvaluationResult with every allowed sdk_options key set inagent_config. Leavesdk_optionsunset, as happens for an agent without aget_sdk_options()override. Render it throughcollect_agent_settings_rowsin markdown and HTML, and assert that a row for each key appears with its value. Fix shape: like theresolve_context_windowprecedent, read effort fromagent_config.sdk_optionswhensdk_optionsis absent, and do not gate it onis_sdk. Why not static: Whether a row renders depends on which runtime path is used: the agent'sget_sdk_options()override, or the fallback toagent_configwith is_sdk=False. Only a rendered report shows it. Prevents: Finding 'Codex effort is not rendered in Agent Settings, so run.md/experiment.md/HTML cannot tell effort variants apart' (codex_agent.py:1801, reports/markdown.py:132-140, reports/html.py:1020-1029). - Make sure that the configured Codex effort reaches the wire. The preferred fix is the typed
Thread.turn(effort=...)route from the static bucket, which makes this item unnecessary. If thread-level config is kept on purpose, add a test against a recorded or faked openai_codex call that asserts the effective reasoning effort the SDK received. Also record in .claude/notes/agents.md, section Codex, why the config dict is used. Why not static: The SDK passes the config dict through without checks, so only an actual (or recorded) SDK invocation shows whether a key such asmodel_reasoning_efforttook effect. Prevents: Finding 'Codex effort uses the untyped thread config dict instead of the SDK's typed effort parameter' (codex_agent.py:1801-1803): if the key is renamed, every effort tier silently runs at the default, and an effort A/B experiment compares identical configurations. - Do not add a lint rule for the duplicated effort-only validators or for the
_validate_sdk_options_keysnaming. Fix them with one shared private helper (for example_validate_effort_only_sdk_options(v, *, owner, tiers)) that both Codex and Delegate call, renamed so the name covers value validation too. The registry-driven contract test above then exercises every copy, so drift between agents shows up as a test failure. Why not static: ruff has no clone detector. pylint R0801 is not in the toolchain and is too noisy for blocks of about 10 lines. Whether a validator's name matches what it does needs semantic judgment. A guard rule that forbidssorted(set(v) - _X)outside the helper would guard a sharp edge that the helper removes. Prevents: Findings 'Codex sdk_options single-key validator is a near-copy of Delegate's effort-only validator' (agent_config.py:370/412-423 vs 560/618-629) and 'Validator named_validate_sdk_options_keysnow also validates the effort value' (agent_config.py:414).
Top 5 Priority Actions
- Make the Codex effort check type-safe at src/coder_eval/models/agent_config.py:421: check
isinstance(v["effort"], str)before the frozenset membership test, as the Delegate validator does at line 627, so that a typo such aseffort: {high}or-D agent.sdk_options.effort=[high]gives a ValidationError/OverrideError and skips one task instead of a raw TypeError that aborts the whole suite; add["high"]to the parametrize case at tests/test_codex_reasoning_effort.py:44. - Pass the effort tier through the SDK's typed parameter (
thread.turn(..., effort=ReasoningEffort(...))) at src/coder_eval/agents/codex_agent.py:1862 instead of the untypedtool_config["model_reasoning_effort"]key at lines 1801-1803, so that an SDK key rename fails loudly and cannot make every effort variant run silently at the default tier; if thread-level config is deliberate, record the reason in .claude/notes/agents.md. - Show Codex effort in Agent Settings: when
sdk_optionsis absent, renderagent_config.sdk_options.effortin the fallback path of src/coder_eval/reports/markdown.py:50-64/132-140 and src/coder_eval/reports/html.py:1020, following theresolve_context_windowexample, so that codex-high and codex-xhigh variants do not show the same settings table; add a report-row test. - Restore test coverage of the friendly 'sdk_options cannot be used with' OverrideError branch at src/coder_eval/orchestration/overrides.py:153-158: add a test for opencode (or pi) and a test for the
--type opencodepath that assert the full message, including the accepted-kinds list that now names codex (the PR removed these tests at tests/test_overrides_engine.py:145/185); also changematch="sdk_options"at tests/test_overrides_engine.py:152 tomatch="are not Codex options". - Merge the two duplicate effort-only validators (src/coder_eval/models/agent_config.py:412-423 and 618-629) into one helper named for what it does (for example
_validate_sdk_options). Derive_CODEX_EFFORT_TIERS(line 373) from aCodexReasoningEffortLiteral so the type checker and the JSON schema can see the tier set, and update the codex bullet at docs/TASK_DEFINITION_GUIDE.md:225-226 to say that it supportssdk_options.effort.
Stats: 0 🔴 · 0 🟠 · 4 🟡 · 5 🔵 across 8 axes reviewed.
… show it in reports
|
Addressed in d7f93c3. Changed
Not changed
|

Summary
Codex takes
agent.sdk_options.effort, the reasoning-effort tier, and sends it as theeffortof everythread.turncall, typed as the SDK'sReasoningEffort. Codex applies it over themodel_reasoning_effortin$CODEX_HOME/config.toml. Unset, nothing is sent: the hostconfig.tomlvalue applies, or else the model's default, as today.sdk_optionson Codex accepts onlyeffort. Another key, a value that is not a string, or a tier outsideopenai_codex.api.ReasoningEffort(none,minimal,low,medium,high,xhigh,max,ultra) fails at load. Before this, anysdk_optionson Codex failed at load. Now-D agent.sdk_options.effort=highworks for Claude Code, Codex and Delegate, and a task sets it per task underagent.sdk_options.Why
Under coder_eval, Codex runs at the model's default effort, and neither a task nor a run can change it. We tested six multi-turn dialog tasks from UiPath/skills (
uipath-plannerinterview tasks, with a simulated user and an LLM judge). They pass reliably on Claude Code and fail intermittently on Codex. Each task ran 3 times at each effort, withgpt-5.6-luna, both efforts in the same CI runs. The rollouts recordhighin all 18 runs athigh:highAt
high, the average cost per task went from $0.059 to $0.152, and runs took about 1.8× as long. Those runs set the tier with apre_runstep that wroteconfig.toml, because coder_eval had no option for it.Changes
CodexAgentConfig.sdk_options, validated toeffortand Codex's tiers. Codex and Delegate now share one validator,_validate_effort_only_sdk_options; it checks thateffortis a string before it checks the tier.CodexAgent._build_turn_optionspasseseffort=ReasoningEffort(tier)tothread.turnwheneffortis set.agent_config.sdk_options, so effort variants show their tier in the markdown, experiment and HTML reports.CODEX.md§ Reasoning Effort, thesdk_optionslist in the Task Definition Guide (its Agent Types list no longer namessdk_optionsfor claude-code only), andDELEGATE.md, which now names all three agents.effortapplies and that another key raises. Two new tests pin the "sdk_options cannot be used with agent type opencode" message, on the plain path and the--typepath. The dataset-expansion fixtures that used the old rejection now use a key that only Claude accepts (max_thinking_tokens).Scheduled runs: a task that sets only
sdk_options.effortwas skipped under--type codexbefore this PR, and now runs on Codex at that tier. A run that sets nosdk_optionsis unchanged.Codex records
sdk_options: nullinrun.json, as before; its tier is inagent_config.sdk_options.effort.Testing
tests/test_codex_reasoning_effort.py:communicate()with a recording thread: a set effort reachesthread.turnasReasoningEffort; an unset effort sends no option;openai_codex.api.ReasoningEffort;3,None,["high"],{"tier": "high"}) is aValidationError;effortas "Override the reasoning effort for this turn and subsequent turns". An earlier live run of the first commit, which sent the tier as the thread config'smodel_reasoning_effort, recordedeffort: lowwith-D agent.sdk_options.effort=lowover aconfig.tomlthat setmedium.main(all environment), and 13 more passes, all from the new tests.ruff format --check,ruff checkand pyright on the changed files, the custom lint (753 passed), and the prose budget.