feat(nova): cut HEARTBEAT over from acpx_run to DM-delegation to sam-local-codex#247
Closed
feat(nova): cut HEARTBEAT over from acpx_run to DM-delegation to sam-local-codex#247
Conversation
…local-codex Task #5 of ADR-005 Stage 3 / ADR-010 Phase 3. Nova's heartbeat retires acpx_run as the codex implementation path and replaces it with DM-based delegation to sam-local-codex (the first ADR-005 wrapper agent). ## How it works Heartbeat is a separate model invocation per tick — there is no in-tick "wait." Nova's flow is now event-loop-shaped: tick N: claim task → post task spec to SamCodexDmPodId → write `## PendingDelegation` to memory → HEARTBEAT_OK tick N+k: read memory + DM pod messages → find sam's reply → parse PR_URL or BLOCKED → complete or block task → clear memory tick N+3: if no reply after 90 min → mark task blocked, post status, clear memory (do NOT auto-fall-back to acpx_run — that's the whole point of the cutover) The five-branch decision tree (A through E) covers every reachable state: in-flight reply received, still waiting, timed out, fresh task, idle. ## What changes - `backend/routes/registry/presets.ts`: nova's `soulTemplate` and `heartbeatTemplate` rewritten end-to-end. SamCodexDmPodId hardcoded (matches existing DevPodId/MyPodId pattern). Both Path A (audit) and Path B (impl) collapse into "post delegation prompt to sam." Step 2.5 (CI-failure check) deferred per design review. - `backend/__tests__/unit/routes/registry.presets.test.js`: regression test asserting the structural invariants (no imperative acpx_run, PendingDelegation present, all five Branch labels, SamCodexDmPodId constant, sam-local-codex referenced in SOUL). ## Pre-existing setup The sam ↔ nova agent-room (podId 69efbd9c11277089b127d891) was pre-created by calling the dual-auth `POST /api/agents/runtime/room` endpoint shipped in ADR-010 Phase 1 (PR #243). Idempotent upsert — re- runs return the same pod. ## Identity caveat PRs delegated via sam-local-codex are authored by the laptop user's git identity (sam runs codex with the operator's local gh creds), not nova- agent's. Documented in nova's SOUL.md and the delegation prompt. Accepted Stage 2 cost; future fix is a per-agent token-broker / GitHub App. ## Out of scope - Theo / Pixel / Ops cutover (Task #7) — once nova holds for 3+ ticks. - Deleting `acpx_run` from the openclaw fork (Task #8) — only after all four dev agents stable on DM cutover. - Phase 2 of ADR-010 (OpenClaw → MCP) — independent track. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Squashed manually as the merge commit on main. |
samxu01
added a commit
that referenced
this pull request
Apr 28, 2026
…local-codex (#247) Task #5 of ADR-005 Stage 3 / ADR-010 Phase 3. Nova's heartbeat retires acpx_run as the codex implementation path and replaces it with DM-based delegation to sam-local-codex. Heartbeat is a separate model invocation per tick — nova posts a self- contained task spec into her 1:1 agent-room with sam (podId hardcoded as SamCodexDmPodId, pre-created via the dual-auth /room endpoint shipped in PR #243), writes ## PendingDelegation to memory, and reads sam's reply on the next tick. Five-branch decision tree (A: reply received, B: still waiting, C: 90-min timeout → block, D: fresh task → delegate, E: idle). Includes regression test asserting acpx_run is only in negative-instruction lines, PendingDelegation + SamCodexDmPodId present, all five Branch labels. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Task #5 of ADR-005 Stage 3 / ADR-010 Phase 3. Nova's heartbeat retires `acpx_run` as the codex implementation path and replaces it with DM-based delegation to sam-local-codex (the first ADR-005 wrapper agent).
The agent-room (podId `69efbd9c11277089b127d891`) was pre-created via the dual-auth `/room` endpoint shipped in ADR-010 Phase 1 (PR #243). Hardcoded in `presets.ts` matching the existing DevPodId/MyPodId convention.
Decision tree (5 branches)
Reviewer-fix-throughs
Self-reviewed with code-reviewer subagent before push. Three Critical + four Important issues caught and addressed:
The reviewer also flagged the upcoming Phase 2 ADR-010 friction with `commonly_update_task` semantics differing between openclaw extension (PATCH with `{status, notes}`) and MCP server (POST /updates with `{text}`). Accepted as a known concern for the future Phase 2 PR; this PR uses the openclaw extension shape that nova has access to today.
Tests
Rollout
After merge:
Out of scope
Test plan
🤖 Generated with Claude Code