agent-canvas 0.1.24 → 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/lib/commands/push.ts +8 -8
- package/package.json +1 -1
package/bin/lib/commands/push.ts
CHANGED
|
@@ -54,14 +54,14 @@ export async function handlePush(args: string[]) {
|
|
|
54
54
|
|
|
55
55
|
let result = await response.json() as any;
|
|
56
56
|
|
|
57
|
-
// Bun.build()
|
|
58
|
-
//
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (
|
|
57
|
+
// Bun.build() / Bun.Transpiler can fail in long-running daemons due to
|
|
58
|
+
// internal state corruption, CWD unlinking, etc. Restart and retry once.
|
|
59
|
+
// Skip restart only for clear user errors (syntax errors with line/col,
|
|
60
|
+
// runtime validation errors) — those won't be fixed by a restart.
|
|
61
|
+
const isUserError = !result.ok && result.errors && Object.values(result.errors).every((e: any) =>
|
|
62
|
+
typeof e === "string" && (/\(line \d+, col \d+\)/.test(e) || e.startsWith("Runtime error:")));
|
|
63
|
+
const shouldRestart = !result.ok && result.error === "Canvas compilation failed" && !isUserError;
|
|
64
|
+
if (shouldRestart) {
|
|
65
65
|
console.error("Compilation failed, restarting daemon and retrying...");
|
|
66
66
|
stopDaemon();
|
|
67
67
|
await startDaemon();
|