Skip to content

Add persistent node delivery and protected wake service with Hermes recovery - #148

Merged
ThinkOffApp merged 5 commits into
mainfrom
feat/node-bootstrap
Nov 22, 2026
Merged

ThinkOffApp merged 5 commits into
mainfrom
feat/node-bootstrap

Conversation

@ThinkOffApp

Copy link
Copy Markdown
Owner

Add a Linux user-service command for durable GroupMind mention delivery, an authenticated tailnet-bound wake endpoint, and change-only health reports. A receipt-aware Hermes adapter resumes an explicit session and can rotate a confirmed context-full session while retaining transcript IDs and persistent commitments.

Delivery retries use backoff and dead letters; long offline catch-up gaps are reported explicitly after a bounded re-baseline. Readiness is separate from attention, and an acknowledgement command archives attention before clearing it. Shared @deep configurations require an explicit node tag; a distinct owner-provisioned handle is preferred.

Validation: full npm test passes 950/950; diff check clean. Tests cover request authentication, message injection resistance, routing collisions, retry/dead-letter progression, context recovery, durable receipts and attention archival. Hermes protocol source checked at accb82032cfe8f62d7e8675f0409f3cd1a840b8f; no live inference or fleet installation performed.

Deployment requires local protocol/identity preflight, a separate commitments file and single service ownership of each state file. Delivery is at least once; crash replay must respect delivery IDs. Backlog re-baselining can skip unknown older work and reports that limitation. No identity registration, SSH permission change or service installation is included.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T15:58:26.429305Z 93db462 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 93db4623f4

ℹ️ 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".

Comment thread src/node-service.mjs
Comment on lines +158 to +160
const poll = async () => { await node.tick(); try { await node.announce(); } catch { console.error(JSON.stringify({node:c.id,stage:'announce',errorClass:'HealthPublicationFailure'})); } };
void poll();
const timer = setInterval(() => void poll(), 15000);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Serialize health announcements with polling state writes

When a delivery takes longer than the 15-second polling interval and healthRoom is configured, the next poll() skips the busy tick() but still calls announce(). Both operations can then persist concurrently through the same .tmp file. Releasing a delayed delivery and health POST together reproduces an ENOENT during rename; overlapping writes also undermine the atomic state-save guarantee. Serialize the entire polling/announcement cycle, and ensure wake-triggered ticks cannot race announcement persistence.

Useful? React with 👍 / 👎.

Comment thread src/node-service.mjs Outdated
if (state.seen.includes(m.id) || state.pending.some(p => p.id === m.id)) continue;
const sender = typeof m.from === 'string' ? m.from : '';
const mentioned = m.body.match(/@[a-z0-9_-]+/gi) || [];
if (state.ready && sender.toLowerCase() !== c.handle.toLowerCase() && mentioned.some(h => h.toLowerCase() === c.handle.toLowerCase()) && (!c.nodeTag || m.body.includes(c.nodeTag))) state.pending.push({ id: m.id, room, from: sender, body: m.body });

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve attachment and reply fields in queued messages

When a mention refers to an attached image/file or replies to another message, this projection drops image_url, file_url, reply_to, and all other message metadata before delivery. The Hermes adapter only receives this reduced object, so it cannot inspect the attachment or identify the referenced task. The existing GroupMind adapter explicitly preserves attachment information and reply context. Queue the complete message, adding the room without discarding its other fields.

Useful? React with 👍 / 👎.

Comment thread src/node-service.mjs
state.deadLetters.push(message); state.seen.push(message.id);
}
}
state.seen = state.seen.slice(-5000); await persist(state);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Bound seen history even when no deliveries occur

In watched rooms with ordinary traffic but no mentions of this node, every new message is appended to state.seen, while the only 5,000-entry truncation runs inside the pending-delivery loop. Consequently, the persistent service accumulates history indefinitely, repeatedly scanning it with includes() and rewriting the entire growing state file every poll. A no-mention reproduction reaches 6,039 entries without any pruning. Apply bounded-history retention on the normal polling path as well, preserving the necessary boundaries for each watched room.

Useful? React with 👍 / 👎.

@ThinkOffApp
ThinkOffApp merged commit 717c83e into main Nov 22, 2026
2 checks passed
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.

1 participant