Skip to content

gateway: persist node.health.frame telemetry + add node.health.get - #14

Merged
DeanoC merged 3 commits into
mainfrom
ziggy/node-health-frame-gateway-20260210
Feb 10, 2026
Merged

DeanoC merged 3 commits into
mainfrom
ziggy/node-health-frame-gateway-20260210

Conversation

@DeanoC

@DeanoC DeanoC commented Feb 10, 2026

Copy link
Copy Markdown
Owner

Implements gateway-side support for node health telemetry frames sent by nodes.

What changed

  • Validate + accept node.health.frame node events (Ajv/TypeBox) before storing.
  • Persist recent frames per node in gateway memory (rolling window, max 20 per node; TTL eviction).
  • Expose RPC node.health.get:
    • {} → latest entry per node
    • { nodeId, limit? } → recent entries for a node (oldest → newest)
  • Protocol: exports node-health related types (NodeHealth* + telemetry variants) for consumers.

Why

Unblocks consumers (e.g. dashboards) from having to scrape logs to display node telemetry/health.

Manual verification

  1. Start the gateway.
  2. Connect a node client.
  3. From the node, send a node.event with event: "node.health.frame" and payload like:
    { "ts": 123, "kind": "telemetry", "data": { "ok": true } }
  4. From an operator client, call node.health.get and confirm the stored entry is returned.

Tests

  • pnpm vitest -c vitest.gateway.config.ts

Label: no-auto-merge}

@DeanoC DeanoC added the no-auto-merge Do not auto-merge this PR label Feb 10, 2026

@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: becae1db26

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

@DeanoC

DeanoC commented Feb 10, 2026

Copy link
Copy Markdown
Owner Author

Addressed the Codex inline note about whitespace-only nodeId: now rejects blank/whitespace nodeId (schema tightened to require a non-whitespace char + defensive runtime check) and includes a regression test. Commit: 4792e1f.

@DeanoC

DeanoC commented Feb 10, 2026

Copy link
Copy Markdown
Owner Author

Follow-up: the specific method is node.health.get (whitespace-only nodeId now rejected). (Sorry: my first comment ate the method name due to shell backticks.)

@DeanoC DeanoC removed the no-auto-merge Do not auto-merge this PR label Feb 10, 2026
@DeanoC
DeanoC merged commit a7a75fb into main Feb 10, 2026
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