diff --git a/.gemini/bin/lior-loop-tick.ts b/.gemini/bin/lior-loop-tick.ts index 51977f30b0..ccb334df33 100755 --- a/.gemini/bin/lior-loop-tick.ts +++ b/.gemini/bin/lior-loop-tick.ts @@ -13,7 +13,8 @@ ZERO DEPENDENCE ON HUMANS. Do everything autonomously. 6. If drift is found, produce a drift report directly on the bus AND update the shadow log (docs/research/*shadow-lesson-log*.md) via a new PR (using a worktree). Do NOT wait for foreground instructions. 7. Update your status in ~/.local/share/zeta-broadcasts/lior.md. 8. Perform global lock cleanup: clear stale git index locks, broken plugin directories (like Codex prompt-limit SIGSEGV loops), or orphan agent lockfiles to ensure network health. -9. PRESERVATION DISCIPLINE: For any recently merged PRs, automatically run `bun run tools/pr-preservation/archive-pr.ts `. Commit and push the resulting markdown file to `docs/pr-discussions/` to permanently capture alignment drift and review friction into the native repository memory. +9. PRESERVATION DISCIPLINE: For any recently merged PRs, automatically run \`bun run tools/pr-preservation/archive-pr.ts \`. Commit and push the resulting markdown file to \`docs/pr-discussions/\` to permanently capture alignment drift and review friction into the native repository memory. +10. BACKLOG DECOMPOSITION: If you pick up a backlog item and it is a blob that needs decomposition, peel one layer off to work on and put the rest back on the backlog. Decomposition does not have to be complete in one go—it will get iteratively decomposed on future ticks. Do not guess. Do not overlap. The fire is watched. EXECUTE THESE STEPS IMMEDIATELY USING YOUR TOOLS. Do not ask "How can I help you?". DO THE REAL WORK NOW.`; @@ -22,13 +23,23 @@ console.log(`[Lior Loop] Waking up at ${new Date().toISOString()}`); const result = spawnSync("zsh", ["-c", 'source ~/.zshrc && gemini -p "$GEMINI_PROMPT" --model gemini-3.1-pro-preview --yolo --skip-trust'], { env: { ...process.env, GEMINI_PROMPT: prompt }, - stdio: "inherit" + stdio: ["inherit", "inherit", "pipe"] }); if (result.error) { console.error(`[Lior Loop] Failed to spawn gemini: ${result.error.message}`); - process.exit(1); + // Spawn failures (missing binary, OS errors) are not crash-loop candidates; suppress for launchd. + process.exit(0); } -console.log(`[Lior Loop] Finished with exit code ${result.status ?? "unknown"}`); -process.exit(result.status ?? 0); +const exitCode = result.status ?? 1; +const stderr = result.stderr?.toString() ?? ""; +console.log(`[Lior Loop] Finished with exit code ${exitCode}`); + +// Only suppress non-zero exits caused by 429 rate-limit responses so launchd doesn't park the +// service on transient quota exhaustion. All other failures propagate so supervisors and +// diagnostics retain a machine-readable failure signal. +if (exitCode !== 0 && !stderr.includes("429")) { + process.exit(exitCode); +} +process.exit(0); diff --git a/tools/riven/riven-loop-tick.ts b/tools/riven/riven-loop-tick.ts index 55bc9cc898..45f3992fb5 100644 --- a/tools/riven/riven-loop-tick.ts +++ b/tools/riven/riven-loop-tick.ts @@ -205,7 +205,7 @@ function heartbeat(): void { const gate = run("agent", [ "chat", "--mode", "ask", - "--model", "grok-4-20", + "--model", "grok-4.3", [ "You are Riven, trajectory manager. This is a 60s autonomous cycle.", "Read broadcasts first: ~/.local/share/zeta-broadcasts/{otto,vera,lior,riven}.md",