feat(issue-2827): expose Codex reasoning-effort in the media-job retry editor#2857
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:routes/mediaJobs.js) — re-addefforttoPARAM_ALLOWLIST(so the Render Queue row and retry base surface the effort a job used) and toRETRY_OVERRIDE_SCHEMA, validated againstCODEX_EFFORT_LEVELS. A distinct clear-to-default sentinel (effort: 'default') lets a retry actually reset the effort: the handler deletesparams.effortsocodex.js'sCODEX_IMAGEGEN_DEFAULT_EFFORTfallback takes over — a merged sentinel string could never do this (it would fail the level validation), andemptyToUndefalone can't express "reset" (the drop-undefined merge silently retains the old value).MediaJobsQueue.jsx) — the Render Queue row now shows the effective effort a Codex job ran at (resolving an absent value to the shipped default), andEditRetryFormgains a Codex-only Reasoning-effort<select>(levels fromCODEX_EFFORT_LEVELSplus a "Default" choice) wired into the override payload. Pin a level, or reset to default, before re-queuing.CODEX_IMAGEGEN_DEFAULT_EFFORTinto the sharedimageGenBackendslib (deduping the settings form's local copy) and acodexEffortOfguard mirroringcodex.js'stypeof === '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.gemma-4-12B-coder), and codex (codex review); all findings addressed.