Skip to content

Commit 41b7aee

Browse files
fix(cli): cloud render logs a line a minute while a job holds its status (#7262)
* fix(cli): cloud render logs a line a minute while a job holds its status Outside a terminal, `cloud render` printed one line per status change, so a 3D shot that renders for 20 minutes showed "rendering 2.1s" and nothing else. Agents read that as a hang and killed jobs that later completed. The log now repeats the status with its elapsed time once a minute, and the style-sampling remix guide says the cloud gives no frame count and how to check a job the client stopped waiting for. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HebQXPiLcYKQfvPWB3Fgxy * chore(skills): regenerate the skills manifest Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HebQXPiLcYKQfvPWB3Fgxy * refactor(cli): keep the still-running interval module-private Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HebQXPiLcYKQfvPWB3Fgxy --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 8fd7542 commit 41b7aee

4 files changed

Lines changed: 26 additions & 4 deletions

File tree

‎packages/cli/src/commands/cloud/render.test.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { fileURLToPath } from "node:url";
77

88
import {
99
assertArchiveFits,
10+
logsTick,
1011
resolveCloudFpsArg,
1112
parseAspectRatioFlag,
1213
resolveAspectRatioForSubmit,
@@ -61,6 +62,15 @@ describe("resolveCloudFpsArg", () => {
6162
});
6263
});
6364

65+
describe("logsTick", () => {
66+
it("logs a long render once a minute while its status holds, so a slow render does not read as a hang", () => {
67+
const logged = { status: "rendering", at: 2_000 };
68+
expect(logsTick("rendering", 30_000, logged)).toBe(false);
69+
expect(logsTick("rendering", 62_000, logged)).toBe(true);
70+
expect(logsTick("completed", 3_000, logged)).toBe(true);
71+
});
72+
});
73+
6474
describe("validateDryRunSource", () => {
6575
it("accepts a local directory and rejects already-uploaded sources", () => {
6676
expect(() => validateDryRunSource({ kind: "dir", dir: "." }, true)).not.toThrow();

‎packages/cli/src/commands/cloud/render.ts‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,7 @@ async function pollWithProgress(
978978
// mode stays silent altogether.
979979
const interactive = !asJson && process.stdout.isTTY === true;
980980
let lastStatus = "";
981+
let logged = { status: "", at: 0 };
981982
try {
982983
return await pollUntilTerminal(client, renderId, {
983984
intervalMs: poll.intervalMs,
@@ -993,10 +994,11 @@ async function pollWithProgress(
993994
process.stdout.write(` ${formatTickLine(detail, elapsedMs)}`);
994995
lastStatus = detail.status;
995996
}
996-
} else if (detail.status !== lastStatus) {
997-
// Non-TTY: one line per status transition, no carriage returns.
997+
} else if (logsTick(detail.status, elapsedMs, logged)) {
998+
// Non-TTY: a line per status change and one a minute while it holds, no carriage returns.
998999
console.log(` ${formatTickLine(detail, elapsedMs)}`);
9991000
lastStatus = detail.status;
1001+
logged = { status: detail.status, at: elapsedMs };
10001002
}
10011003
},
10021004
});
@@ -1018,6 +1020,16 @@ async function pollWithProgress(
10181020
}
10191021
}
10201022

1023+
const STILL_RUNNING_EVERY_MS = 60_000;
1024+
1025+
export function logsTick(
1026+
status: string,
1027+
elapsedMs: number,
1028+
logged: { status: string; at: number },
1029+
): boolean {
1030+
return status !== logged.status || elapsedMs - logged.at >= STILL_RUNNING_EVERY_MS;
1031+
}
1032+
10211033
function formatTickLine(detail: HyperframesRenderDetail, elapsedMs: number): string {
10221034
const status = colorStatus(detail.status);
10231035
return `${status} ${c.dim(formatDuration(elapsedMs))}`;

‎skills-manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"files": 2
3535
},
3636
"style-sampling": {
37-
"hash": "58192cff7fc8f7ce",
37+
"hash": "e54aca29ef95de2e",
3838
"files": 2
3939
}
4040
}

‎skills/style-sampling/references/remix.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ The person's message carries what it carries. Ask once, together, only what is s
5353
## 7. Checks, stop 2, render
5454

5555
- One heavy job at a time (renders, long ffmpeg, transcription): renders with `--workers 1`, ffmpeg with `-threads 2 -nostdin`. For a change, render only that window.
56-
- Before a render likely to run past 20 minutes (3D at full quality, a long cut), say roughly how long it takes; while it runs, report its progress from the log rather than only that it has not finished.
56+
- Before a render likely to run past 20 minutes (3D at full quality, a long cut), say roughly how long it takes; while it runs, report the elapsed time the log prints each minute. The cloud gives no frame count, so a 3D shot can sit at `rendering` for 20 minutes and still finish; don't kill it for that, and check a job you stopped waiting for with `npx hyperframes cloud get <id>`.
5757
- Run REMIX.md's checks. Report each of our numbers beside the series' own: cuts a minute, pause density, longest hold, loudness, sound effects on picture changes, the script fingerprint. Name every check that failed.
5858
- **Stop 2:** ask once on the draft: a contact sheet and `npx hyperframes preview --background --no-open` (add `--port <free port>` when 3002 is taken), with what is still a stand-in.
5959
- Then the one full render REMIX.md's delivery calls for. A render over 10 minutes starts detached and is watched through its log, because a render stops when the shell that started it exits: `bash -c 'set -m; HYPERFRAMES_RENDER_DETACHED=1 npx hyperframes render -o <out> < /dev/null > render.log 2>&1 &'`.

0 commit comments

Comments
 (0)