Repository navigation
feat(codex): pin an explicit tool output cap, default 10000 tokens - #267
Conversation
Codex caps each tool output by the model's catalog entry. A model the catalog does not know gets a fallback cap of 10,000 bytes, about a quarter of the 10,000-token cap that catalog models get, so results changed with Codex's catalog rather than with the task. Add agent.tool_output_token_limit (Codex only, default 10000, null keeps the Codex default) and pass it as tool_output_token_limit in the thread config. The value is recorded in the run's agent_config. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex's exec tool also cuts each command output to the max_output_tokens the model may pass per call, 10000 tokens by default, with no config key to raise it. A tool_output_token_limit above 10000 therefore widens only MCP and other tool outputs, and exec calls where the model asks for more. Log a warning at load for such a value and document the ceiling. Reject a bool (a YAML yes loads as 1) and values outside 1024-1000000, as the context_window floor does. Document that the value overrides a tool_output_token_limit in $CODEX_HOME/config.toml, with a parity note beside context_window, and that rows written before the field existed re-load with the default. Per-command output for models outside Codex's catalog grows from 10,000 bytes to about 40 KB; codex runs before and after are not comparable for those models. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Claude finished @CarlesUIPath's task in 1m 25s —— View job Code Review in Progress
|
uipreliga
left a comment
There was a problem hiding this comment.
Review: feat(codex): pin an explicit tool output cap, default 10000 tokens
PR #267 by CarlesUIPath · fix/codex-tool-output-cap → main · OPEN · reviewed against ccee881 · Scope: pr:267 (5 files) axis:1,2,3,4,5,6,7,8 · branch pr-267 (fix/codex-tool-output-cap → main) · ccee881 · 2026-11-24T16:56Z · workflow variant
Change class: complex — adds a validated public config field whose default changes the Codex tool-output cap (and overrides host config) for every Codex run
PR #267 is in good condition: it pins the Codex tool output cap at 10000 tokens with correct bounds, clean CLI override errors and no security or harness problems, and no finding can change a task's score or final_status for identical agent output; the real risks are a load-time warning in a models/ validator that fires again on every reload, and a model default that makes reloaded pre-PR Codex records report a cap they did not run with, so fix these two before merge and treat the rest as small test and doc follow-ups.
Summary
| Axis | Score | 🔴 | 🟠 | 🟡 | 🔵 | Top Issue |
|---|---|---|---|---|---|---|
| 1. Code Quality & Style | 9.9 / 10 | 0 | 0 | 0 | 1 | The bool-rejection validator on tool_output_token_limit duplicates the ge=1_024 bound (and the ceiling ClassVar is a single-use hook); the test cannot tell the two apart |
| 2. Type Safety | 10 / 10 | 0 | 0 | 0 | 0 | — |
| 3. Test Health | 9.7 / 10 | 0 | 0 | 0 | 3 | The tests check only the dict coder_eval builds. No test shows that the bundled codex binary uses the tool_output_token_limit thread-config key. |
| 4. Security | 10 / 10 | 0 | 0 | 0 | 0 | — |
| 5. Architecture & Design | 9.5 / 10 | 0 | 0 | 1 | 0 | Codex exec-ceiling advisory is a logging side effect in a models/ validator: it repeats on every validation, has no task context, and bypasses the agent's advisory hook |
| 6. Error Handling & Resilience | 10 / 10 | 0 | 0 | 0 | 0 | — |
| 7. API Surface & Maintainability | 9.4 / 10 | 0 | 0 | 1 | 1 | The model default of 10_000 makes reloaded legacy Codex records report and re-persist a tool_output_token_limit they did not run with |
| 8. Evaluation Harness Quality | 10 / 10 | 0 | 0 | 0 | 0 | — |
Overall Score: 9.8 / 10 · Weakest Axis: API Surface & Maintainability at 9.4 / 10
Totals: 🔴 0 · 🟠 0 · 🟡 2 · 🔵 5 across 8 axes.
Blockers
None.
Non-blocking, but please consider before merge
- [Axis 5] Codex exec-ceiling advisory is a logging side effect in a models/ validator: it repeats on every validation, has no task context, and bypasses the agent's advisory hook (
src/coder_eval/models/agent_config.py:410) — The PR addslogger = logging.getLogger(__name__)(line 27) and a model validatordef warn_tool_output_token_limit_above_exec_ceiling(self) -> Self:(line 410), which callslogger.warning("tool_output_token_limit %d is above %d: Codex still caps command output ...")(line 414). models/ is the pure-Pydantic layer. It already holds two load-time advisories, and both usewarnings.warn:validate_template_sourcesin models/sandbox.py and the unknown-field check in models/tasks.py. Python's default warning filter shows such a warning once per location. Alogger.warninggets no such de-duplication. The only otherlogger.warningin models/ is inurl_egress_target, which runs at egress resolution, not inside a validator.
The agent's ResolvedAgentConfig re-validates CodexAgentConfig (through _coerce_agent_config → parse_agent_config) every time a persisted agent_config loads: report, evaluate, resume, and the batch reload of task.json. So the warning fires again on each reload.
Measured on the PR head:
- One
parse_agent_config(type="codex", tool_output_token_limit=20000)call emits 1 warning. Five dump/reload round-trips bring the total to 6. coder-eval planon one Codex task with the value set to 20000 emits it 2 times.- So an N-row dataset run repeats it at least N times on every
reportorevaluatepass. It warns about a past run that the user cannot change any more.
The Codex agent already has the right seam for 'this knob does less than you think' advisories. CodexAgent._log_config_enforcement() (codex_agent.py:1802, called once per start at line 1124) and the disallowed_tools warning in _build_options both use the task-prefixed self._log (PrefixedAdapter, line 1069). The new advisory skips that seam, so the warning is also not linked to its task in per-task logs.
Fix: delete the model validator and the module logger. Move the check into _log_config_enforcement as a self._log.warning(...) next to the existing permission-mode warning, or into _build_options next to the tool_config["tool_output_token_limit"] assignment (codex_agent.py:1794-1795). Keep the field bounds and the bool-rejecting field_validator in the model, because they are real validation. Then update docs/agents/CODEX.md:217 ("Such a value logs a warning when the config loads.") to say the warning fires when the agent starts.
2. [Axis 7] The model default of 10_000 makes reloaded legacy Codex records report and re-persist a tool_output_token_limit they did not run with (src/coder_eval/models/agent_config.py:384) — tool_output_token_limit: int | None = Field(default=10_000, ...) is a Pydantic default, so every pre-PR Codex task.json that is loaded again through ResolvedAgentConfig comes back with tool_output_token_limit=10000. That value was never sent to Codex. CODEX.md:226 admits this ("a re-load (evaluate, resume, reports) fills in the default 10000, which those runs did not have"). It does not say that coder-eval evaluate <old_run> then saves the false value to disk permanently: _write_back calls write_text_atomic(target, result.model_dump_json(...)) (evaluate_command.py:638). After that, the record itself carries the wrong value for downstream consumers (eval-runner, evalboard, run.json via run_record.py:181 result.agent_config.model_dump()). The resume fingerprint (batch.py compute_run_fingerprint, a BatchRunConfig dump) does not cover per-task agent config, so resuming a pre-upgrade run also mixes the old and new caps under one recorded value. This is a cross-repo contract issue: the persisted record now reports a config that did not run. Recommended fix (open question on mechanism): keep the model default None so a legacy record loads truthfully as 'Codex default', and stamp 10000 only on newly resolved configs, for example in the default layer of orchestration/config_merge.py or at task resolution. Then new runs record the pinned value and old runs stay as they were. If the trade-off is kept as it is, at minimum say in CODEX.md that evaluate rewrites task.json with the filled-in value.
Nits
- [Axis 1] The bool-rejection validator on tool_output_token_limit duplicates the ge=1_024 bound (and the ceiling ClassVar is a single-use hook); the test cannot tell the two apart (
src/coder_eval/models/agent_config.py:401) —_reject_bool_tool_output_token_limit(lines 401-407:if isinstance(value, bool): raise ValueError("tool_output_token_limit must be a number of tokens or null, not a boolean")) guards against something the field constraint already rejects. Withge=1_024, True (1) and False (0) both fail: a probe ofx: int | None = Field(default=10_000, ge=1_024)rejects both withInput should be greater than or equal to 1024 [type=greater_than_equal, input_value=True, input_type=bool]. The validator's docstring says a bool 'would otherwise load as 0 or 1', but it would not load. The same class already uses the bound for this on its sibling field: the_context_window_rangecomment says 'The floor rejects a window too small to work in, such as ... a YAMLyesthat loads as 1'. There is one small gain: the error message is clearer. Either delete the validator and keepTrue, Falsein the out-of-range parametrize, or keep it and make the test assert its specific message. Todaytest_a_cap_out_of_range_or_a_bool_fails_at_loadin tests/test_codex_tool_output_cap.py matches only"tool_output_token_limit", so the test passes with or without the validator and does not pin it. - [Axis 3] The tests check only the dict coder_eval builds. No test shows that the bundled codex binary uses the tool_output_token_limit thread-config key. (
tests/test_codex_tool_output_cap.py:31) —TestThreadOptions(lines 31-38) checks only the options that_build_thread_options()returns, for exampleassert _thread_config()["tool_output_token_limit"] == 10_000. These tests restate the 3-line branch at codex_agent.py:1794-1795 (tool_config["tool_output_token_limit"] = self.config.tool_output_token_limit). The openai_codex SDK passesconfigon as a plain dict and does not check it. Codex reads ConfigToml through serde, so if a CLI bump renames or drops the key, Codex can ignore it with no error. A run would then recordtool_output_token_limit: 10000inagent_configbut use Codex's per-model default, which is the comparability problem that CODEX.md says this PR fixes. The existing integration testtests/test_codex_provider_binary.pysends the production thread options to the real binary, so it catches a hard rejection, but not a key that Codex ignores. Recommendation: add a binary-contract test. One way: start a thread through the stub app-server and read back the effective config, if the app-server exposes it. Another way: make the stub return a tool output that is larger than a small cap (for example 1024) and assert that the next request is truncated. If the app-server cannot show this, record that boundary in the test module docstring. - [Axis 3] The new field's out-of-range CLI override (OverrideError) has no test. The parallel context_window suite tests this case. (
tests/test_codex_tool_output_cap.py:86) —test_a_cli_override_sets_the_cap(lines 86-91) tests only the valid values("5000", 5_000), ("null", None). The parallel suitetests/test_agent_context_window.pyhastest_a_cli_override_out_of_range_reads_as_a_clean_error, which assertspytest.raises(OverrideError, match=r"-D agent: .*out of range"). A probe confirms that the new field produces a clean error now:OverrideError -D agent.tool_output_token_limit: Input should be greater than or equal to 1024 (got 10). No test pins this. Add a parametrized case, for exampleapply_overrides(task, dict([parse_override("agent.tool_output_token_limit=10")]))underpytest.raises(OverrideError, match="tool_output_token_limit"), so that the-Duser path for bad values stays covered. - [Axis 3] test_another_harness_rejects_the_field passes on any ValidationError because it has no match (
tests/test_codex_tool_output_cap.py:69) — Lines 68-70:with pytest.raises(ValidationError):/parse_agent_config(type=AgentKind.CLAUDE_CODE, tool_output_token_limit=10_000). This has nomatch=, but the same class usesmatch="tool_output_token_limit"at line 44. If Claude Code config validation fails for some other reason, the test still passes. It would then not show that the Codex-only field is rejected on another harness. Addmatch="tool_output_token_limit"(Pydantic's extra_forbidden error names the field). - [Axis 7] Field description for None omits the $CODEX_HOME/config.toml precedence that the docs state (
src/coder_eval/models/agent_config.py:393) — The description ends with"None leaves Codex's own per-model default.". CODEX.md:219-220 states the actual contract: "Set it tonullto let that host value [$CODEX_HOME/config.toml], or else the Codex default for the model, apply". The code supports the docs:_codex_home()resolves the host~/.codex, and the field is omitted from the thread config when None. The Pydantic description is the SSOT for the field, so update it to say that None defers first to the host$CODEX_HOME/config.tomltool_output_token_limitand then to Codex's per-model default. Otherwise a user who reads the schema text cannot predict that a host setting leaks intonullruns.
What's Missing
Display & mapping dicts:
- 🔵 The run.md and HTML 'Agent Settings' table does not show the new knob.
collect_agent_settings_rows(reports/markdown.py), withresolve_context_windowand html.py:1036, adds a 'Context Window' row fromagent_config. It has no 'Tool Output Cap' row fortool_output_token_limit. CODEX.md says that runs with different values (or with the pre-PR Codex default) are not comparable, but a reader of a report cannot see which cap a run used without opening task.json. Add the row next to Context Window, and add a test that asserts the row is present. (trigger: src/coder_eval/models/agent_config.py)
Tests:
- 🔵 CODEX.md documents the legacy-reload behaviour: a pre-PR Codex
agent_configwith notool_output_token_limitkey loads throughResolvedAgentConfigas 10000. No test pins it. Add a test that loads a pre-PR-shapedEvaluationResult/task.json dict without the key and asserts the resulting value. Then a later fix (for example, aNonemodel default with 10000 stamped at resolution) breaks a test, not just a doc sentence. (trigger: docs/agents/CODEX.md) (restates: Axis 7: The model default of 10_000 makes reloaded legacy Codex records report and re-persist a tool_output_token_limit they did not run with)
Parallel paths:
- 🔵 docs/TASK_DEFINITION_GUIDE.md § Agent Configuration is the authoritative task-YAML reference. Its example
agent:block and its prose listcontext_windowwith the harnesses that accept it. The new Codex-onlytool_output_token_limitis in CODEX.md and HARNESS_PARITY.md only. It is the first Codex-only user-authored field onCodexAgentConfig. A task author who reads the guide does not find it. Add an optional line to the example block, for exampletool_output_token_limit: 10000 # codex only, and a one-line pointer to CODEX.md#tool-output-cap. (trigger: src/coder_eval/models/agent_config.py)
Nightly pipeline:
- 🔵 The PR body says that the nightly runner passes
agent_configthrough and that the evalboard reads onlytype. It does not say what happens to a Codex nightly run that is in progress or already finished across the upgrade.--resumedoes not fingerprint per-task agent config, so the resumed rows run with the new cap while the old rows ran with the catalog or fallback cap, all under one recorded value of 10000. A detachedevaluatewrites 10000 back into task.json and run.json. For out-of-catalog models, the nightly trend lines change at this commit. Add a sentence to the PR or CHANGELOG to tell nightly consumers about this break in the series. (trigger: src/coder_eval/agents/codex_agent.py) (restates: Axis 7: The model default of 10_000 makes reloaded legacy Codex records report and re-persist a tool_output_token_limit they did not run with)
Harness & Lint Improvements
Static checks (lint / type):
- [ce-lint] New rule CE072
no-logging-in-pydantic-validator. Scope: the wholesrc/coder_eval/tree, not onlymodels/. The rule forbids a call whose receiver is namedlogger,logging,logor_log(.debug/.info/.warning/.error/.exception) inside a function decoratedmodel_validatororfield_validator. A validator runs again every time a persisted record re-validates (ResolvedAgentConfig→_coerce_agent_config→parse_agent_configonreport,evaluate, resume and batch reload), so a log call there repeats with no task context. The message tells the author either to usewarnings.warn, which de-duplicates per location (models/tasks.py:690andmodels/sandbox.py:100already do this), or to move the advisory to the agent'sself._logseam (CodexAgent._log_config_enforcement). Put the file attests/lint/rules/no_logging_in_validator.py. Add it toALL_RULESintests/lint/runner.py, addCE072toexternalin pyproject[tool.ruff.lint], and add aTestCE072...class intests/test_custom_lint.py. Correct the stale 'Claim 069 next' comment in the runner, because 069 and 071 are taken and 070 is the only gap. Before you claim 072, checkgrep -E '^class Test(CE[0-9]{3})' tests/test_custom_lint.pyfor in-flight branches. I ran an AST probe of this pattern (tmp/probe_validator_log.py). It finds 0 hits on main across all of src/ and exactly 1 hit on the PR head (src/coder_eval/models/agent_config.py:414,warn_tool_output_token_limit_above_exec_ceiling). The rule therefore lands with zero suppressions. Known blind spot: a validator that calls a helper which then logs. To cover that, follow same-module calls one level deep. Prevents: The A5 medium finding (agent_config.py:410/414): the Codex exec-ceiling advisory is alogger.warninginside a models/model_validator. It fired 6 times over 5 dump/reload round-trips and 2 times on onecoder-eval plan, and it bypasses the agent's task-prefixed advisory seam. The finding is also grouped under A1, A6, A7 and A8 at agent_config.py:409 and :414. - [ruff] Add
PT011to[tool.ruff.lint] selectand set[tool.ruff.lint.flake8-pytest-style] raises-require-match-for = ["pydantic.ValidationError", "pydantic_core.ValidationError", "*.OverrideError", "ValueError", "Exception", "BaseException", "OSError"]. Ruff matches on qualified names, so the bare name"ValidationError"does NOT matchfrom pydantic import ValidationError. You must usepydantic.ValidationError. I checked this with ruff 0.15.8. On the PR head the setting flags exactlytests/test_codex_tool_output_cap.py:69:28 PT011 pytest.raises(pydantic.ValidationError) is too broad. Acrosstests/it flags 58 existing sites for the pydantic names alone. To adopt it, fix those sites or add# noqa: PT011to each in the same change, so that new code is gated from the start. Prevents: The A3 low finding at tests/test_codex_tool_output_cap.py:69:test_another_harness_rejects_the_fieldusespytest.raises(ValidationError)with nomatch=, so any ValidationError makes it pass. It also stops the same shape in future tests. It does not catch amatch=that is present but too weak to tell two error paths apart, which is the A1 bool-validator test-pinning half (see the harness bucket).
Harness improvements (not statically reachable):
- Add a generic bounds-coverage test for every agent-config field that has bounds. Iterate the
model_fieldsof every registeredBaseAgentConfigsubclass. For each field whose metadata hasGe/Le(or a_context_window_range-style ClassVar), applyapply_overrides(task, dict([parse_override(f"agent.{name}={below_floor}")]))and assertOverrideErrorwithmatch=name. Also assert that directparse_agent_config(...)withTrue/False/below-floor/above-ceiling raisesValidationErrorwithmatch=name. A new bounded field is then covered on the-Dpath and the load path without a hand-written case for each field. Why not static: It must run Pydantic validation and the override parser to show that the bad value comes back as a cleanOverrideErrorrather than a traceback. An AST check can see that a bound exists, but not that the CLI path turns the violation into a user error. Prevents: The A3 low finding at tests/test_codex_tool_output_cap.py:86: the out-of-range-D agent.tool_output_token_limit=10path has no test, but the parallel context_window suite tests it. - Add a persisted-default snapshot test with a legacy-record round-trip. Commit a JSON snapshot of
{model: {field: default}}for every config model that a persisted record carries (ResolvedAgentConfigmembers, and the task.json/run.json agent_config surface), plus one frozen pre-change Codextask.jsonfixture for each AgentKind. The test fails when a new field arrives with a non-None default, or when a default changes, until the author updates the snapshot. It also asserts that reloading each legacy fixture (EvaluationResult.model_validate→model_dump) does not add keys the fixture lacked, or that each added key is on an explicit 'materialized-on-reload' allowlist that names the doc which admits it. This makes the 'a legacy record reloads with a value it never ran with, andevaluatewrites it back to task.json' trade-off a deliberate, reviewed decision. Why not static: It depends on what older records omitted, which is history and not something an AST of the current tree contains. Also, whether a non-None default is acceptable for legacy rows is a judgment call. A snapshot forces the decision into review but cannot make it. Prevents: The A7/A8 medium finding at agent_config.py:383/384:tool_output_token_limitdefaults to10_000, so pre-PR Codex records reload and are re-persisted through_write_back/run_record.py:181with a cap that was never sent to Codex. This affects the cross-repo contract that eval-runner and the evalboard read. - Add a Codex binary config-key contract test beside
tests/test_codex_provider_binary.py. Check every key that_build_thread_options()writes into the threadconfigdict against the bundled binary, so that a key Codex silently ignores fails the test. Preferred: if the app-server can return the effective config or a config JSON schema, assert that each sent key is present and has the sent value. Fallback: have the stub return a tool output larger than a small cap (1024) and assert that the next model request carries truncated output. If neither is possible, record that limit in the module docstring so the gap is a deliberate decision. Why not static: Whether Codex honours a key is decided by serde deserialization inside the external binary. Theopenai_codexSDK passesconfigthrough unchecked, so nothing in this repo's source can show the key is read. Only running the bundled binary can. Prevents: The A3 low finding at tests/test_codex_tool_output_cap.py:31:TestThreadOptionsonly restates the dict branch at codex_agent.py:1794-1795. If a CLI bump renames or dropstool_output_token_limit, the run records 10000 but uses Codex's per-model default, and no test fails. - Add an opt-in
make mutation-modelstarget, run nightly and not inmake verify. It runs mutmut (or cosmic-ray) overfield_validator/model_validatorbodies insrc/coder_eval/models/against the tests that cover them, and reports surviving mutants. A validator that can be deleted without any test failing is either redundant with a field constraint or unpinned by its tests. Both are review findings that this target finds mechanically. Why not static: Redundancy between a custom validator and age=bound, and whether a test'smatch=tells the two error paths apart, depend on runtime behaviour. You find them by running the suite against a mutated validator. Reading the AST cannot show them. Prevents: The A1/A2/A7 low finding at agent_config.py:401:_reject_bool_tool_output_token_limitduplicatesge=1_024, because True/False already fail the bound.test_a_cap_out_of_range_or_a_bool_fails_at_loadmatches only the field name, so the test passes with or without the validator. - No mechanical gate is proposed for the field-description finding (agent_config.py:393, where the description of
Noneomits the$CODEX_HOME/config.tomlprecedence that CODEX.md states). This is a recorded boundary, not an omission. When a docs page and the Pydanticdescription=both state semantics for one field, the review checklist should require them to agree. Better still, CODEX.md could render the field's description from the model, so there is one source. Why not static: The defect is a semantic gap between two prose statements. CE030-style parity checks that a field is documented, not that two descriptions agree. Checking that agreement needs judgment, or an LLM-judge doc check, and not a grep or AST rule. Prevents: The A7 low finding at agent_config.py:393: a schema reader cannot predict that a host$CODEX_HOME/config.tomlvalue leaks intonullruns.
Top 5 Priority Actions
- Move the exec-ceiling advisory out of the models/ layer: delete the model_validator
warn_tool_output_token_limit_above_exec_ceilingand the modulelogger(src/coder_eval/models/agent_config.py:27, :410-414), emit it once per start with the task-prefixedself._log.warninginCodexAgent._log_config_enforcement(codex_agent.py:1802) or next to the assignment at codex_agent.py:1794-1795, and change docs/agents/CODEX.md:217 to say the warning fires when the agent starts. - Stop reloaded legacy Codex records from reporting a cap they did not run with: keep the field default
Noneat src/coder_eval/models/agent_config.py:383 and stamp 10000 only on newly resolved configs (for example in the default layer of orchestration/config_merge.py); if you keep the trade-off, at minimum say in CODEX.md thatevaluatewrites the filled-in 10000 back to task.json (the original is kept as task.execute.json). - Add a binary-contract test in tests/test_codex_tool_output_cap.py (the current tests at :31-38 check only the dict that coder_eval builds), for example a stub tool output larger than a 1024 cap followed by an assertion that the next request is truncated, so that a Codex CLI bump that silently ignores the
tool_output_token_limitkey gets caught; if the app-server cannot show this, record that limit in the module docstring. - Update the field description at src/coder_eval/models/agent_config.py:393 to say that
Noneuses the host$CODEX_HOME/config.tomlvalue first and then Codex's per-model default, as docs/agents/CODEX.md:219-220 states. - Make the tests show what they claim: add
match="tool_output_token_limit"to the barepytest.raises(ValidationError)at tests/test_codex_tool_output_cap.py:69, add an out-of-range-D agent.tool_output_token_limit=10OverrideError case next to :86-91, and either delete the redundant bool validator at src/coder_eval/models/agent_config.py:401-407 (ge=1_024 already rejects True and False) or assert its specific message.
Stats: 0 🔴 · 0 🟠 · 2 🟡 · 5 🔵 across 8 axes reviewed.
bai-uipath
left a comment
There was a problem hiding this comment.
LGTM, good for now. The key does what it says: codex 0.156.1 applies tool_output_token_limit in both truncation modes, so gpt-6.1-sol goes from a 10,000-byte cap to 40,000 bytes, the same 10000 tokens codex gives every model in its catalog.
- Why Sol hit this: the pinned codex 0.156.1 predates
gpt-6.1-sol(0.160 and later catalog it), so Sol runs on codex's fallback model metadata, and the byte cap is only one part of it: generic base instructions instead of Sol's own, no freeformapply_patchtool, a different shell tool, no default reasoning effort. A codex bump fixes all of those for Sol. - Longer term: the model is chosen in an ADO variable and the catalog is pinned in the lock, and nothing checks that they agree. A preflight in the codex agent that calls
model/list(the SDK'smodels(include_hidden=True)) and fails the task when the configured model would fall back, naming the model and the pinned codex version, would catch the next one on its first run instead of two weeks in.
The exec-ceiling advisory was a logger.warning in a models/ validator, so it fired again on every reload of a record (report, evaluate, resume) with no task context. Move it to CodexAgent._log_config_enforcement, which runs once per start on the task-prefixed logger. Drop the bool validator: ge=1024 already rejects True and False. Say in the field description that null defers to $CODEX_HOME/config.toml first. Tests: the warning fires at start and not at load, an out-of-range -D override reads as a clean OverrideError, the other-harness rejection names the field, and a variant that switches away from codex neither keeps a set cap nor inherits the default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Records from before tool_output_token_limit existed have no such key and reload with the field default, which those runs did not have: Codex then applied its own default (10000 tokens in its catalog, 10,000 bytes outside it). Say so where the cap is described, so trend lines across this commit are read with that in mind, instead of rewriting legacy records on reload. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

What
Codex agent runs now pass an explicit
tool_output_token_limit(newCodexAgentConfigfield, default 10000 tokens) in the thread-startconfig, the same pathmodel_context_windowuses.Why
Codex sizes tool output from its bundled model catalog: catalog models get
{mode: tokens, limit: 10000}(~40 KB). A model that matches no catalog slug falls back to a 10,000-byte policy, a quarter of that. With no explicit value, results silently depend on whether the run's model is in the installed codex's catalog. Observed effect: an agent reading a 41.6 KB skill file saw only its head and tail and re-read the middle in slices; more than half of its commands were skill re-reads.Behaviour
max_output_tokensthe model may pass, default 10000 = codex'sDEFAULT_MAX_OUTPUT_TOKENS, not configurable). Values above 10000 only widen MCP / extension tool results and exec calls where the model asks for more; the agent logs a warning at start when the value is above 10000. Records written before this change reload showing the 10000 default (docs/agents/CODEX.md).nullsends nothing: codex's own default, or a host$CODEX_HOME/config.tomlvalue, applies. The default overrides a host config value (documented in CODEX.md and HARNESS_PARITY.md).agent_config.Impact on existing runs
agent_configthrough; the evalboard reads onlyagent_config.type.Checks
ruff format/check clean; pyright 0 errors; codex tests 298 passed; full suite (CI-equivalent env) 7059 passed earlier. Reviewed twice (findings fixed in the second commit).
🤖 Generated with Claude Code