Skip to content

feat: typed builders for reasoning, verbosity, rollout budget and approvals reviewer - #180

Merged
joshrotenberg merged 1 commit into
mainfrom
feat/146-typed-config
Nov 10, 2026
Merged

joshrotenberg merged 1 commit into
mainfrom
feat/146-typed-config

Conversation

@joshrotenberg

Copy link
Copy Markdown
Collaborator

Closes #146.

Plan

Typed builders for config fields that today go through config/2 as raw strings, on Exec, ExecResume, ExecFork and Review (each subcommand reads -c):

Builder Emits Checked before spawning
reasoning_effort/2 -c model_reasoning_effort="<effort>" non-empty string
reasoning_summary/2 -c model_reasoning_summary="<v>" :auto, :concise, :detailed, :none
verbosity/2 -c model_verbosity="<v>" :low, :medium, :high
approvals_reviewer/2 -c approvals_reviewer="<v>" :user, :auto_review, :guardian_subagent
rollout_budget/2 -c features.rollout_budget={enabled=true,...} positive integer :limit_tokens and non-empty list of positive integers :reminder_at_remaining_tokens (both required by codex), optional positive :sampling_token_weight and :prefill_token_weight

Invalid values raise ArgumentError. Values were checked on codex-cli 0.149.0, 0.164.0 and 0.165.0 with --strict-config and an isolated CODEX_HOME.

  • The values live in one config_fields map per builder, so the structs do not grow by five fields.
  • Precedence: the builder fields are emitted after the caller's config/2 entries, and codex applies repeated -c last-wins, so a typed builder wins over a config/2 entry for the same key. This matches how approval_policy/2 and search/1,2 already behave; the comment in Exec that says the opposite is corrected.
  • CodexWrapper.exec/2, review/1 and Session accept :reasoning_effort, :reasoning_summary, :verbosity, :approvals_reviewer and :rollout_budget.
  • mix codex.contract: the three closed sets join @enum_config_keys; model_reasoning_effort is probed with "" (codex: "reasoning_effort must not be empty"); features.rollout_budget is probed with a table holding an unknown field, which codex rejects as a malformed features.rollout_budget rather than an unknown configuration field.
  • README section and tests.

…rovals reviewer

Exec, ExecResume, ExecFork and Review gain reasoning_effort/2,
reasoning_summary/2, verbosity/2, approvals_reviewer/2 and
rollout_budget/2. Each emits a -c config field with its value checked
before spawning (values checked on codex-cli 0.149.0, 0.164.0 and
0.165.0). The fields share one config_fields map per builder.

Typed fields follow config/2 entries, and codex applies repeated -c
last-wins, so a typed builder wins for the same key. The Exec comment
that said the opposite is corrected.

CodexWrapper.exec/2, review/1 and Session accept the same options.
mix codex.contract probes the three closed sets with sentinels,
model_reasoning_effort with an empty string, and features.rollout_budget
with a table holding an unknown field.

Closes #146
@joshrotenberg
joshrotenberg marked this pull request as ready for review November 10, 2026 21:55
@joshrotenberg
joshrotenberg merged commit 1095324 into main Nov 10, 2026
5 checks passed
@joshrotenberg
joshrotenberg deleted the feat/146-typed-config branch November 10, 2026 21:55
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.

feat: typed builders for reasoning, verbosity, rollout budget and approvals reviewer

1 participant