Skip to content

feat(issue-2827): expose Codex reasoning-effort in the media-job retry editor#2857

Merged
atomantic merged 3 commits into
mainfrom
next/issue-2827
Jul 21, 2026
Merged

feat(issue-2827): expose Codex reasoning-effort in the media-job retry editor#2857
atomantic merged 3 commits into
mainfrom
next/issue-2827

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

The Edit & Retry flow for a failed Codex image job had no way to inspect or change the per-render reasoning effort (added in #2826/#2828), and the server had no way to reset it back to the shipped default. This wires the full contract #2826 deliberately deferred:

  • Server (routes/mediaJobs.js) — re-add effort to PARAM_ALLOWLIST (so the Render Queue row and retry base surface the effort a job used) and to RETRY_OVERRIDE_SCHEMA, validated against CODEX_EFFORT_LEVELS. A distinct clear-to-default sentinel (effort: 'default') lets a retry actually reset the effort: the handler deletes params.effort so codex.js's CODEX_IMAGEGEN_DEFAULT_EFFORT fallback takes over — a merged sentinel string could never do this (it would fail the level validation), and emptyToUndef alone can't express "reset" (the drop-undefined merge silently retains the old value).
  • Client (MediaJobsQueue.jsx) — the Render Queue row now shows the effective effort a Codex job ran at (resolving an absent value to the shipped default), and EditRetryForm gains a Codex-only Reasoning-effort <select> (levels from CODEX_EFFORT_LEVELS plus a "Default" choice) wired into the override payload. Pin a level, or reset to default, before re-queuing.
  • Extracted CODEX_IMAGEGEN_DEFAULT_EFFORT into the shared imageGenBackends lib (deduping the settings form's local copy) and a codexEffortOf guard mirroring codex.js's typeof === 'string' && trim, so a non-string effort from hand-edited data can't throw at render.

Closes #2827

Test plan

  • server/routes/mediaJobs.test.js — retry preserves an explicit effort on a plain retry; pins a new level when overridden; resets to the default (drops the key) on the clear sentinel; rejects an invalid level; the effort is exposed via GET.
  • client/src/components/media/MediaJobsQueue.test.jsx — the effort control renders for Codex jobs only (hidden for local); pins a level and sends the clear sentinel; the row + editor show/pre-fill the effective default when a job stored no effort; a non-string persisted effort doesn't crash the row.
  • Reviewed by claude (in-process), ollama (gemma-4-12B-coder), and codex (codex review); all findings addressed.

…y editor

The Edit & Retry flow for a failed Codex image job had no way to inspect
or change the per-render reasoning `effort`, and the server could not
reset it back to the shipped default. Re-add `effort` to the media-job
param allowlist and retry-override schema, using a distinct 'default'
clear sentinel (the drop-undefined merge could never express a reset),
and add a Codex-only Reasoning-effort <select> to the retry editor.

Closes #2827
…w; drop fixed retry-effort id

P1: a Codex job that ran on the shipped default stores no `effort`, but
codex.js still rendered it at `low` — resolve an absent value to the shared
CODEX_IMAGEGEN_DEFAULT_EFFORT so the Render Queue row shows the effective
level instead of a blank. P2: the retry-editor effort <select> used a fixed
`id`, so two editors open at once shared one id and the label association
broke — drop the id and let FormField's useId() generate a unique one.
Extract the default-effort constant into the shared imageGenBackends lib and
reuse it in the settings form.
… values

A hand-edited media-jobs.json could store a non-string `effort`; the row
label's `.trim()` would then throw at render. Extract a `codexEffortOf`
helper mirroring codex.js's own `typeof === 'string' && trim` guard, so a
non-string or blank value resolves to the shipped default instead of crashing,
and reuse it for the retry editor's pre-fill.
@atomantic
atomantic merged commit 51e95dd into main Jul 21, 2026
2 checks passed
@atomantic
atomantic deleted the next/issue-2827 branch July 21, 2026 23:58
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.

Expose Codex reasoning-effort in the media-job retry editor (inspect + clear-to-default)

1 participant