Show Codex Live generation progress

Journal and stream dedicated worker phases so Live distinguishes first-variant design and validation from remaining-direction work without adding pollable events.\n\nAI-assisted: OpenAI Codex.
This commit is contained in:
Paul Bakaus
2026-07-12 20:21:22 -07:00
parent 27a210b04c
commit 0aa6fc56a0
7 changed files with 106 additions and 0 deletions
@@ -244,6 +244,7 @@ describe('Codex Live worker supervisor ownership and lifecycle', () => {
};
const replies = [];
const checkpoints = [];
const phases = [];
const supervisor = new CodexLiveWorkerSupervisor({
cwd,
base: 'http://localhost:1',
@@ -254,6 +255,7 @@ describe('Codex Live worker supervisor ownership and lifecycle', () => {
scriptsDir: path.join(cwd, 'skill/scripts'),
reply: async (_base, _token, value) => { replies.push(value); },
publishCheckpoint: async (_base, _token, value) => { checkpoints.push(value); },
publishPhase: async (_base, _token, value) => { phases.push(value); },
});
supervisor.thread = { id: 'live-worker-thread' };
supervisor.model = client.models[0];
@@ -268,6 +270,12 @@ describe('Codex Live worker supervisor ownership and lifecycle', () => {
assert.equal(checkpoints.length, 2);
assert.deepEqual(checkpoints.map((item) => item.arrivedVariants), [1, 3]);
assert.deepEqual(phases.map((item) => item.phase), [
'first_variant_generating',
'first_variant_validating',
'remaining_variants_generating',
'remaining_variants_validating',
]);
assert.equal(replies.at(-1).type, 'done');
assert.equal((readFileSync(path.join(cwd, 'src/App.jsx'), 'utf-8').match(/data-impeccable-variant="1"/g) || []).length, 2, 'selector and variant 1 remain once each');
const snapshot = createLiveSessionStore({ cwd, sessionId }).getSnapshot(sessionId, { includeCompleted: true });