mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 16:08:56 +00:00
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HebQXPiLcYKQfvPWB3Fgxy * chore(skills): regenerate the skills manifest Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HebQXPiLcYKQfvPWB3Fgxy * refactor(cli): keep the still-running interval module-private Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HebQXPiLcYKQfvPWB3Fgxy --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
8fd7542070
commit
41b7aeeafb
@@ -7,6 +7,7 @@ import { fileURLToPath } from "node:url";
|
||||
|
||||
import {
|
||||
assertArchiveFits,
|
||||
logsTick,
|
||||
resolveCloudFpsArg,
|
||||
parseAspectRatioFlag,
|
||||
resolveAspectRatioForSubmit,
|
||||
@@ -61,6 +62,15 @@ describe("resolveCloudFpsArg", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("logsTick", () => {
|
||||
it("logs a long render once a minute while its status holds, so a slow render does not read as a hang", () => {
|
||||
const logged = { status: "rendering", at: 2_000 };
|
||||
expect(logsTick("rendering", 30_000, logged)).toBe(false);
|
||||
expect(logsTick("rendering", 62_000, logged)).toBe(true);
|
||||
expect(logsTick("completed", 3_000, logged)).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("validateDryRunSource", () => {
|
||||
it("accepts a local directory and rejects already-uploaded sources", () => {
|
||||
expect(() => validateDryRunSource({ kind: "dir", dir: "." }, true)).not.toThrow();
|
||||
|
||||
@@ -978,6 +978,7 @@ async function pollWithProgress(
|
||||
// mode stays silent altogether.
|
||||
const interactive = !asJson && process.stdout.isTTY === true;
|
||||
let lastStatus = "";
|
||||
let logged = { status: "", at: 0 };
|
||||
try {
|
||||
return await pollUntilTerminal(client, renderId, {
|
||||
intervalMs: poll.intervalMs,
|
||||
@@ -993,10 +994,11 @@ async function pollWithProgress(
|
||||
process.stdout.write(` ${formatTickLine(detail, elapsedMs)}`);
|
||||
lastStatus = detail.status;
|
||||
}
|
||||
} else if (detail.status !== lastStatus) {
|
||||
// Non-TTY: one line per status transition, no carriage returns.
|
||||
} else if (logsTick(detail.status, elapsedMs, logged)) {
|
||||
// Non-TTY: a line per status change and one a minute while it holds, no carriage returns.
|
||||
console.log(` ${formatTickLine(detail, elapsedMs)}`);
|
||||
lastStatus = detail.status;
|
||||
logged = { status: detail.status, at: elapsedMs };
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -1018,6 +1020,16 @@ async function pollWithProgress(
|
||||
}
|
||||
}
|
||||
|
||||
const STILL_RUNNING_EVERY_MS = 60_000;
|
||||
|
||||
export function logsTick(
|
||||
status: string,
|
||||
elapsedMs: number,
|
||||
logged: { status: string; at: number },
|
||||
): boolean {
|
||||
return status !== logged.status || elapsedMs - logged.at >= STILL_RUNNING_EVERY_MS;
|
||||
}
|
||||
|
||||
function formatTickLine(detail: HyperframesRenderDetail, elapsedMs: number): string {
|
||||
const status = colorStatus(detail.status);
|
||||
return `${status} ${c.dim(formatDuration(elapsedMs))}`;
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
"files": 2
|
||||
},
|
||||
"style-sampling": {
|
||||
"hash": "58192cff7fc8f7ce",
|
||||
"hash": "e54aca29ef95de2e",
|
||||
"files": 2
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ The person's message carries what it carries. Ask once, together, only what is s
|
||||
## 7. Checks, stop 2, render
|
||||
|
||||
- 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.
|
||||
- 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.
|
||||
- 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>`.
|
||||
- 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.
|
||||
- **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.
|
||||
- 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 &'`.
|
||||
|
||||
Reference in New Issue
Block a user