Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: address codex retry review findings

[._.]/ Adam Eivy525a2113bfb9
diff --git a/client/src/components/media/MediaJobsQueue.jsx b/client/src/components/media/MediaJobsQueue.jsx
index d3e9d590eb..bb2f554d15 100644
--- a/client/src/components/media/MediaJobsQueue.jsx
+++ b/client/src/components/media/MediaJobsQueue.jsx
@@ -724,10 +724,17 @@ function VideoRetryForm({ job, onSubmit, onCancel }) {
if (numberChanged(chunks, p.chunks ?? 1)) overrides.chunks = Number(chunks);
if (JSON.stringify(chunkPrompts) !== JSON.stringify(p.chunkPrompts || [])) overrides.chunkPrompts = chunkPrompts;
if (numberChanged(contextFrames, p.contextFrames ?? 0)) overrides.contextFrames = Number(contextFrames);
- if (numberChanged(seed, p.seed)) overrides.seed = Number(seed);
- if (numberChanged(steps, p.steps)) overrides.steps = Number(steps);
- if (numberChanged(guidanceScale, p.guidanceScale)) overrides.guidanceScale = Number(guidanceScale);
- if (numberChanged(imageStrength, p.imageStrength)) overrides.imageStrength = Number(imageStrength);
+ const setNumericOverride = (key, value, original, clearable = false) => {
+ if (value === '') {
+ if (clearable && original != null) overrides[key] = null;
+ return;
+ }
+ if (numberChanged(value, original)) overrides[key] = Number(value);
+ };
+ setNumericOverride('seed', seed, p.seed, true);
+ setNumericOverride('steps', steps, p.steps, true);
+ setNumericOverride('guidanceScale', guidanceScale, p.guidanceScale, true);
+ setNumericOverride('imageStrength', imageStrength, p.imageStrength, true);
if (tiling !== (p.tiling || 'auto')) overrides.tiling = tiling;
if (disableAudio !== (p.disableAudio === true)) overrides.disableAudio = disableAudio;
if (textEncoderId !== originalEncoder) overrides.textEncoderId = textEncoderId;
diff --git a/server/routes/mediaJobs.js b/server/routes/mediaJobs.js
index 4f900b57a6..4fd0ca09b1 100644
--- a/server/routes/mediaJobs.js
+++ b/server/routes/mediaJobs.js
@@ -204,16 +204,16 @@ const RETRY_OVERRIDE_SCHEMA = z.object({
),
width: z.number().int().min(64).max(4096).optional(),
height: z.number().int().min(64).max(4096).optional(),
- steps: z.number().int().min(1).max(200).optional(),
+ steps: z.number().int().min(1).max(200).nullable().optional(),
guidance: z.number().min(0).max(30).optional(),
- guidanceScale: z.number().min(0).max(30).optional(),
+ guidanceScale: z.number().min(0).max(30).nullable().optional(),
cfgScale: z.number().min(0).max(30).optional(),
- seed: z.number().int().optional(),
+ seed: z.number().int().nullable().optional(),
numFrames: z.number().int().min(1).max(2000).optional(),
fps: z.number().int().min(1).max(120).optional(),
tiling: z.enum(['auto', 'none', 'spatial', 'temporal']).optional(),
disableAudio: z.boolean().optional(),
- imageStrength: z.number().min(0).max(1).optional(),
+ imageStrength: z.number().min(0).max(1).nullable().optional(),
textEncoderId: z.string().max(64).optional().transform(emptyToUndef),
chunks: z.number().int().min(1).max(8).optional(),
chunkPrompts: z.array(z.string().max(8000)).max(8).optional(),
@@ -265,6 +265,9 @@ router.post('/:id/retry', asyncHandler(async (req, res) => {
),
);
const params = { ...job.params, ...overrides };
+ for (const key of ['seed', 'steps', 'guidanceScale', 'imageStrength']) {
+ if (rawOverrides[key] === null) delete params[key];
+ }
// Reset Codex effort to the shipped default: dropping the key lets codex.js's
// fallback (CODEX_IMAGEGEN_DEFAULT_EFFORT) take over, which a merged sentinel
// string could not do (it would fail the CODEX_EFFORT_LEVELS validation).
diff --git a/server/routes/mediaJobs.test.js b/server/routes/mediaJobs.test.js
index 72d3fc95f6..7087369b7a 100644
--- a/server/routes/mediaJobs.test.js
+++ b/server/routes/mediaJobs.test.js
@@ -190,6 +190,18 @@ describe('mediaJobs routes', () => {
});
});
+ it('POST /:id/retry clears resettable numeric video controls with null', async () => {
+ jobStore.set('j-video-clear', {
+ id: 'j-video-clear', kind: 'video', owner: null, status: 'failed',
+ params: { prompt: 'old', steps: 25, seed: 42, guidanceScale: 3, imageStrength: 0.5 },
+ });
+ const r = await request(makeApp())
+ .post('/api/media-jobs/j-video-clear/retry')
+ .send({ params: { steps: null, seed: null, guidanceScale: null, imageStrength: null } });
+ expect(r.status).toBe(200);
+ expect(stubs.enqueueJob.mock.calls[0][0].params).toEqual({ prompt: 'old' });
+ });
+
it('GET /:id surfaces the Codex reasoning effort a job used (allowlisted)', async () => {
jobStore.set('j-eff', {
id: 'j-eff', kind: 'image', owner: null, status: 'failed',
diff --git a/server/services/mediaJobQueue/sanitizeJob.js b/server/services/mediaJobQueue/sanitizeJob.js
index 6fa33c784a..b10d708acb 100644
--- a/server/services/mediaJobQueue/sanitizeJob.js
+++ b/server/services/mediaJobQueue/sanitizeJob.js
@@ -6,6 +6,7 @@ const PARAM_ALLOWLIST = new Set([
'prompt', 'negativePrompt', 'modelId', 'model', 'effort',
'width', 'height', 'numFrames', 'fps', 'steps', 'guidanceScale',
'seed', 'tiling', 'disableAudio', 'mode', 'imageStrength',
+ 'textEncoderId', 'chunks', 'chunkPrompts', 'contextFrames', 'loras',
'cfgScale', 'guidance', 'quantize',
'runId', 'runtime', 'datasetId', 'characterId', 'characterName',
'triggerWord', 'rank', 'baseModelId', 'spriteRef', 'spriteWalk',
diff --git a/server/services/mediaJobQueue/sanitizeJob.test.js b/server/services/mediaJobQueue/sanitizeJob.test.js
index efc8355623..e072f0d1e9 100644
--- a/server/services/mediaJobQueue/sanitizeJob.test.js
+++ b/server/services/mediaJobQueue/sanitizeJob.test.js
@@ -2,6 +2,32 @@ import { describe, expect, it } from 'vitest';
import { sanitizeJob } from './sanitizeJob.js';
describe('sanitizeJob', () => {
+ it('exposes safe video retry configuration fields', () => {
+ const sanitized = sanitizeJob({
+ id: 'video-job',
+ kind: 'video',
+ status: 'failed',
+ params: {
+ modelId: 'example-video-model',
+ textEncoderId: 'example-encoder',
+ chunks: 2,
+ chunkPrompts: ['opening', 'climax'],
+ contextFrames: 12,
+ loras: [{ filename: 'example-style.safetensors', scale: 0.8 }],
+ pythonPath: '/private/internal/python',
+ },
+ });
+
+ expect(sanitized.params).toEqual({
+ modelId: 'example-video-model',
+ textEncoderId: 'example-encoder',
+ chunks: 2,
+ chunkPrompts: ['opening', 'climax'],
+ contextFrames: 12,
+ loras: [{ filename: 'example-style.safetensors', scale: 0.8 }],
+ });
+ });
+
it('exposes instrumental mode without leaking authored Music Studio text', () => {
const job = sanitizeJob({
id: 'job-1',