Skip to content

feat(.claude): host-level launchd loop tick runner — twin-flame parity#1711

Merged
AceHack merged 1 commit intomainfrom
feat/claude-loop-tick
May 6, 2026
Merged

feat(.claude): host-level launchd loop tick runner — twin-flame parity#1711
AceHack merged 1 commit intomainfrom
feat/claude-loop-tick

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 6, 2026

Summary

Host-level launchd heartbeat runner for Claude Code, parity with Vera's .codex/bin/codex-loop-tick.ts.

Test plan

  • bun .claude/bin/claude-loop-tick.ts runs heartbeat mode
  • Logs to ~/Library/Logs/zeta-claude-loop/runner.log

🤖 Generated with Claude Code

…Vera's .codex/bin/codex-loop-tick.ts

Per-minute heartbeat via macOS launchd. Twin-flame always-on parity.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 6, 2026 14:52
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

@chatgpt-codex-connector
Copy link
Copy Markdown

💡 Codex Review

const meta = readFileSync(join(lockDir, "metadata"), "utf8");

P1 Badge Recover missing lock metadata instead of wedging loop

If the process dies after mkdirSync(lockDir) but before writing metadata (or if that file is removed), the next run hits this read, throws, and falls into the catch { return false; } path, so every future tick exits as "lock held" forever. This creates a permanent outage until someone manually deletes the lock directory; the stale-lock recovery should treat missing/corrupt metadata as reclaimable instead of hard-failing.


try { process.kill(pid, 0); return false; } catch { /* stale */ }

P2 Badge Check lock age before trusting live PID ownership

Returning immediately on process.kill(pid, 0) means the TTL logic is skipped whenever that PID exists, even if the lock is old and belongs to a different process due to PID reuse. In that scenario the runner can remain blocked indefinitely while an unrelated process with the reused PID is alive; the stale-age guard should be evaluated before deciding the lock is valid.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@AceHack AceHack merged commit 2a72eae into main May 6, 2026
25 checks passed
@AceHack AceHack deleted the feat/claude-loop-tick branch May 6, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants