Commit Graph
67 Commits
Author SHA1 Message Date
kamilkrzywda 0722c82359 Merge pull request 'Reconnect tuning: 1 min idle timeout + 5 min periodic autoreconnect (v0.21.3)' (#46) from fix/reconnect-tuning into main
CI / build + unit (push) Failing after 42s
v0.21.3
2026-09-26 11:37:41 +02:00
kamilkrzywda 1ae8d7a926 Idle timeout default 60 s; lazy periodic autoreconnect every 5 min (v0.21.3)
CI / build + unit (pull_request) Failing after 22s
The v0.21.2 frame-based watchdog works in production (it fired today: 'no
decoded bridge frames for 628474 ms — forcing reconnect', and the reconnect
delivered queued packets), but the bridge/radio side at 192.168.1.4 keeps
killing inbound RX within ~20 min of a fresh sync, repeatedly. Two tuning
changes requested by the owner:

- MESH_IDLE_TIMEOUT_MS default lowered from 600000 (10 min) to 60000 (1 min).
- New lazy periodic autoreconnect: MESH_RECONNECT_INTERVAL_MS (new env,
  default 300000 = 5 min, read at construction like the others). An interval
  started in onModuleInit unconditionally logs and destroys the socket so the
  existing close -> scheduleReconnect loop re-establishes with a fresh sync on
  schedule; cleared in onModuleDestroy. When not connected at tick time,
  destroy is a no-op and the retry loop owns recovery — no special-casing.

Tests: 171 -> 172 — periodic reconnect observed end-to-end with an overridden
short interval (fake bridge disconnect + re-establish); existing watchdog tests
pass unchanged, comments updated to the new 60 s default.
2026-09-26 09:34:30 +00:00
kamilkrzywda 77459adc13 Merge pull request 'Watchdog: track decoded frames, not raw bytes (v0.21.2)' (#45) from fix/watchdog-frame-tracking into main
CI / build + unit (push) Failing after 21s
v0.21.2
2026-09-26 10:53:28 +02:00
kamilkrzywda 33a88f3d83 Watchdog tracks decoded frames, not raw bytes; buffer-overflow backstop (v0.21.2)
CI / build + unit (pull_request) Failing after 39s
Second production zombie slipped past v0.21.1's watchdog: text+telemetry RX
dead for >1 h while TX worked and the watchdog never fired. Root cause proven
at runtime via /proc/net/snmp — InSegs delta = 2 segments per 30 s (OutSegs 0):
the bridge peer keeps dribbling small NON-frame bytes (~every 15 s, keepalive
noise or a desynced stream) and v0.21.1 updated lastPacketAt on EVERY socket
chunk, so 'no traffic for MESH_IDLE_TIMEOUT_MS' was never true even though zero
valid Meshtastic frames decoded.

- The 'data' handler no longer updates lastPacketAt per chunk; it is updated
  only when extractFrames yields >=1 valid packet (the reset in the 'connect'
  handler is unchanged), so a stream that decodes nothing trips the watchdog
  after MESH_IDLE_TIMEOUT_MS even while raw bytes keep arriving.
- Buffer-overflow backstop: if the undecoded frame buffer exceeds
  MESH_MAX_FRAME_BUFFER (new env, default 256000) — e.g. one data event of a
  desynced stream that never forms frames — log ERROR and destroy the socket;
  the existing close -> scheduleReconnect loop self-heals it. The undecoded
  buffer is also reset on every (re)connect so leftover garbage from a dead
  session can't re-trigger the backstop or corrupt the first frames of a
  healthy new stream.

Tests: 169 -> 171 — raw non-frame bytes do NOT keep the watchdog alive
(garbage-only stream forces disconnect + reconnect, today's incident shape),
and an undecoded chunk over MESH_MAX_FRAME_BUFFER triggers destroy + a fresh
session that decodes normally (cap env-overridden to 100 since Node delivers
socket data in ~64 KB events, far below the 256_000 default).
2026-09-26 08:50:27 +00:00
kamilkrzywda 306756c63b Merge pull request 'Bridge idle watchdog + forced reconnect (v0.21.1)' (#44) from fix/bridge-idle-reconnect into main
CI / build + unit (push) Successful in 45s
v0.21.1
2026-09-26 08:53:06 +02:00
kamilkrzywda af1c77fd54 Force reconnect when the bridge connection goes silent (v0.21.1)
CI / build + unit (pull_request) Successful in 1m8s
Production incident: the bridge TCP connection went zombie — outbound sends
kept working for ~10 h while inbound packets stopped entirely, and
/api/status stayed connected:true because nothing detects inbound silence on
an established connection.

- Track lastPacketAt: updated on every chunk received from the bridge in the
  lowest-level socket 'data' path (any frame kind, decodable or not) and reset
  when a connection successfully starts, so a fresh connection can't
  self-trigger.
- Idle watchdog: a 30 s interval checks connected AND now - lastPacketAt >
  MESH_IDLE_TIMEOUT_MS (new env, default 600000 = 10 min) — logs WARN with the
  idle duration and destroys the socket so the EXISTING connect/retry loop
  re-establishes it with a fresh sync. No changes to connect-error retry or
  backoff; this only adds detection for established-but-silent connections.
- TCP keepalive: socket.setKeepAlive(true, 30_000) on the bridge socket —
  cheap insurance against dead peers at the TCP level.

Tests (fake-bridge based): silence past an overridden timeout forces a
disconnect + reconnect; inbound traffic keeps resetting the idle clock so no
false trigger; the default timeout does not fire in a test window; and
setKeepAlive(true, 30_000) is asserted on the socket. checkIdle() is public so
tests drive a tick without waiting for the real interval (like flushHistory()).
2026-09-26 06:50:01 +00:00
kamilkrzywda 73ce49c741 Merge pull request '#rss get: 3-5 separate messages with short headers (v0.21.0)' (#43) from feat/rss-multi-message into main
CI / build + unit (push) Successful in 41s
v0.21.0
2026-09-25 22:12:05 +02:00
kamilkrzywda cdd52a3ddb Send #rss get summaries as 3-5 separate mesh messages (v0.21.0)
CI / build + unit (pull_request) Successful in 1m20s
The single-message summary was too small (owner request). The summarizer
prompt now asks for exactly 3-5 lines, one item per line, in the format
'<short header>: <one or two short sentences>' with a <=20-char header,
no intro/outro/numbering. maxTokens stays 2500 (reasoning-token headroom).

The reply is parsed into items: drop empty lines and lines without a ':'
header separator, cap at 5; fewer than 3 valid lines sends what we got
(no failure/retry), zero valid lines sends nothing. Each item goes out as
its own mesh message via respond(id, line) - all threaded to the trigger
packet id on its channel. Per-item backstop fitOneLine() hard-cuts any
line >185 chars at a word boundary near 180 so every item fits one packet;
the old whole-reply fitOnePacket() cut is gone.

CommandService sends array replies line by line through the same routing
as single replies (respond per line, or legacy sendText fallback per line
when there is no packet id). LLM failure path unchanged: single
'summary failed' reply.
2026-09-25 20:09:16 +00:00
kamilkrzywda 172e7bed9c Merge pull request 'Cap #rss get summaries to one mesh packet (v0.20.1)' (#42) from fix/rss-summary-length into main
CI / build + unit (push) Successful in 1m10s
v0.20.1
2026-09-25 21:25:02 +02:00
kamilkrzywda e2d712a26c Cap #rss get summaries to one mesh packet (v0.20.1)
CI / build + unit (pull_request) Successful in 42s
Replies >~190 chars fragment into fire-and-forget packets recipients
often never receive; old prompt produced ~326-334 char replies.

Prompt now asks for at most 3 short bullet lines, each under 45 chars,
bullets only (verified live: exactly 3 compliant bullets, ~110 chars).
fitOnePacket() backstop cuts any over-length reply at complete-bullet
boundaries so delivery is one packet even if the model ignores the prompt.

maxTokens 200 -> 2500 on the summary chat(): empirically verified that
this server's reasoning tokens count against max_tokens (cap 150 ->
completion 150 of which 105 were reasoning; cap 500 fully consumed by
reasoning, zero visible content) and thinking is uncontrollable
server-side (/no_think, chat_template_kwargs.enable_thinking,
thinking_budget all ignored), observed 32..1776 tokens for this task.
2500 covers every observed run + ~80 content tokens, worst case ~42 s
under the 60 s LLM timeout.
2026-09-25 19:22:13 +00:00
kamilkrzywda a8ce04d3f8 Merge pull request 'Add #rss command family with LLM tags and summaries (v0.20.0)' (#41) from feat/rss-command into main
CI / build + unit (push) Successful in 40s
Add #rss command family with LLM tags and summaries (v0.20.0) (#41)
v0.20.0
2026-09-25 20:46:56 +02:00
kamilkrzywda eda1cbd125 Add #rss command family with LLM tags and summaries (v0.20.0)
CI / build + unit (pull_request) Successful in 1m15s
#rss subcommands on the command channel: help / add <url> <name> /
remove <name> / tags / sources / get <name|#tag>. Sources are stored in
a new rss_sources table in the existing MESH_DB_PATH file (second
node:sqlite connection, case-insensitive names); feeds parsed with
fast-xml-parser (RSS 2.0 + Atom); AI tags and headline summaries via
injected LlmService.chat() with bounded maxTokens (50/200).

CommandService gains prefix registration so one handler owns the whole
#rss family while #ping stays an exact match; wired in CommandModule's
factory — still no constructor-level cycle, no forwardRef. One dead feed
does not sink a tag summary.
2026-09-25 18:44:06 +00:00
kamilkrzywda 023cd3eef3 Merge pull request 'Add OpenAI-compatible LLM client service (v0.19.0)' (#40) from feat/llm-client into main
CI / build + unit (push) Successful in 40s
Add OpenAI-compatible LLM client service (v0.19.0) (#40)
v0.19.0
2026-09-25 20:09:32 +02:00
kamilkrzywda c5a2815c01 Add OpenAI-compatible LLM client service (v0.19.0)
CI / build + unit (pull_request) Successful in 1m14s
LlmService wraps the local OpenAI-compatible server (default
http://192.168.1.70:1111/v1, no auth) with native fetch only — no new
dependencies. listModels() -> data[].id; chat(messages, opts?) ->
choices[0].message.content (non-2xx throws with status + body snippet);
summarize(text) = chat() with a concise-summary system prompt.

Env: LLM_API_BASE / LLM_MODEL (qwen3.8-27b) / LLM_TIMEOUT_MS (60000,
AbortSignal.timeout). Plain feature module wired into app.module.ts;
docs synced (AGENTS.md, README env list).
2026-09-25 18:07:21 +00:00
kamilkrzywda 55e59d4963 Merge pull request 'Route command replies through respond() — same channel, threaded quote (v0.18.1)' (#39) from fix/command-replies-respond into main
CI / build + unit (push) Successful in 1m10s
v0.18.1
2026-09-25 19:32:31 +02:00
kamilkrzywda 9d4c9594af Route command replies through MeshService.respond() — same channel, threaded quote (v0.18.1)
CI / build + unit (pull_request) Successful in 42s
2026-09-25 17:30:28 +00:00
kamilkrzywda d375f2a943 Merge pull request 'v0.18.0: channel-2 auto-responder with extensible #command boilerplate' (#38) from feat/channel2-autoresponder into main
CI / build + unit (push) Successful in 1m16s
v0.18.0
2026-09-25 19:14:15 +02:00
kamilkrzywda 931b42bb1e Add channel-2 #command auto-responder (v0.18.0)
CI / build + unit (pull_request) Successful in 41s
Event-driven CommandService dispatches exact case-sensitive #command
matches on COMMAND_CHANNEL (default 2) through a single-registration-point
registry; first command #ping -> #pong!. Replies ride COMMAND_CHANNEL:
directed DM back to the sender when present, else broadcast. Failing
handler/send only logs a warn.

DI: CommandModule's factory injects MeshService and attaches itself via
MeshService.attachCommands() — a constructor-level cycle leaves one side
null in NestJS 12's injector (verified), so no forwardRef is used.

Tests 106 -> 121; docs synced (AGENTS.md, MESHTASTIC.md, README).
2026-09-25 17:11:52 +00:00
kamilkrzywda 2b2e494023 Merge pull request 'Multi-channel notify gate + ch0 DM-only filtering (v0.17.0)' (#37) from feat/multi-channel-notify into main
CI / build + unit (push) Successful in 40s
v0.17.0
2026-09-25 18:21:16 +02:00
kamilkrzywda 4ae932befe mesh: MESH_NOTIFY_CHANNEL as comma-separated list + ch0 DM-only notify gate; v0.17.0
CI / build + unit (pull_request) Successful in 1m8s
2026-09-25 16:18:07 +00:00
kamilkrzywda ff57f3eae1 Merge pull request 'v0.15.0+v0.16.0: /api/respond reply endpoint + message-id in notifier wrapper, GET /api/forwarded ring' (#36) from feat/respond-endpoint into main
CI / build + unit (push) Successful in 1m17s
v0.16.0
2026-09-25 17:53:55 +02:00
kamilkrzywda b7b2044d84 mesh: GET /api/forwarded — last 100 messages forwarded to opencode; v0.16.0 docs
CI / build + unit (pull_request) Successful in 41s
2026-09-25 15:51:43 +00:00
kamilkrzywda e62f831ee5 mesh: in-memory ring of the last 100 messages forwarded to opencode 2026-09-25 15:48:09 +00:00
kamilkrzywda bd18bdfd8a docs: v0.15.0 changelog, README/AGENTS respond + notifier wrapper updates, version bump 2026-09-25 15:39:52 +00:00
kamilkrzywda c33f4613b5 mesh: POST /api/respond + MCP respond tool — reply to a message by packet id 2026-09-25 15:32:34 +00:00
kamilkrzywda 88b617f8b7 opencode: notifier wrapper gains the packet id (id <n>) 2026-09-25 15:06:31 +00:00
kamilkrzywda 34e7bfe0bb mesh: persist destination (to) on captured rx history records 2026-09-25 15:02:21 +00:00
kamilkrzywda b677c05681 Merge pull request 'v0.14.0 — in-process opencode notifier replaces the forwarder service' (#35) from feat/opencode-notifier into main
CI / build + unit (push) Successful in 42s
v0.14.0
2026-09-25 16:17:39 +02:00
kamilkrzywda 83e47c9609 docs+changelog: v0.14.0 — in-process opencode notifier replaces the forwarder
CI / build + unit (pull_request) Successful in 1m0s
2026-09-25 14:14:37 +00:00
kamilkrzywda 5eb1a79e70 mesh: replace notify webhook with in-process opencode notifier; drop forwarder service 2026-09-25 14:14:37 +00:00
kamilkrzywda 7d7c569d08 opencode: add in-process OpencodeService notifier (port of ops/forwarder) 2026-09-25 14:06:25 +00:00
kamilkrzywda c0c069ef08 Merge pull request 'Battery alerts → testowy channel (ch2) — v0.13.1' (#34) from fix/battery-alert-channel into main
CI / build + unit (push) Successful in 39s
v0.13.1
2026-09-25 15:04:11 +02:00
kamilkrzywda 1b712f7eee battery: send alerts on channel "testowy" (index 2), not the pinned send channel
CI / build + unit (pull_request) Successful in 1m0s
Owner request. BatteryAlertService reads new env BATTERY_ALERT_CHANNEL
(default 2) at construction and passes it through MeshService.sendText,
which gains an optional trailing channel argument defaulting to the
pinned MESH_SEND_CHANNEL — every other sender is untouched. Threshold,
cooldown, merged one-message-per-cycle format and @mentions unchanged.
2026-09-25 13:02:56 +00:00
kamilkrzywda 6f6b704dcf Merge pull request 'v0.13.0 — battery-low alert module (merged broadcasts, @mentions, cooldown)' (#33) from feat/battery-alerts into main
CI / build + unit (push) Successful in 43s
v0.13.0
2026-09-25 14:53:01 +02:00
kamilkrzywda fe8d2dbe0b battery: merge multiple low-battery nodes into one broadcast per cycle
CI / build + unit (pull_request) Successful in 1m0s
Owner follow-up: 'if multiple ppl shows at once — merge messages to one'.
check() now collects every qualifying node (at/below threshold and not
within its per-node cooldown) and sends AT MOST ONE broadcast per cycle
containing all of them, recording the alert timestamp for each after
sending; nothing is sent when none qualify. Format: '⚠️ battery low:
@!<hex> (<name>) <X>%[, @!<hex> (<name>) <Y>%]' — single-node case uses
the same one-entry template. Cooldown semantics unchanged.
2026-09-25 12:51:25 +00:00
kamilkrzywda d0b71e6e91 battery: low-battery alert module (v0.13.0)
BatteryAlertModule + BatteryAlertService wired into app.module like
the weather module. Every BATTERY_CHECK_INTERVAL_MS (default 60 s) the
service scans the node state backing GET /api/nodes and broadcasts a
single-packet '⚠️ @!<8-hex> battery low: <X>% (<name>)' alert for every
node at or below BATTERY_ALERT_THRESHOLD percent (default 20, <= on
purpose) not alerted within BATTERY_ALERT_COOLDOWN_MS (default 6 h,
in-memory map — resets on restart). Sends ride the pinned send channel
via MeshService.sendText like every other bot send.
2026-09-25 12:39:45 +00:00
kamilkrzywda 8ddd91d4b5 mesh: update node batteryLevel from live NODEINFO_APP packets
battery_level was only populated during the initial sync; NodeInfo
frames streamed as NODEINFO_APP (port 4) now refresh deviceMetrics in
the node database so /api/nodes and downstream consumers see current
values between syncs. decodeNodeInfo + PORT_NODEINFO_APP added to the
codec, one branch in the existing packet-handling path.
2026-09-25 12:39:45 +00:00
kamilkrzywda 6ce0b1ae7b MESHTASTIC.md: questions get their answer on the channel (owner standing rule) (#32)
CI / build + unit (push) Successful in 20s
v0.12.8
2026-09-25 14:09:10 +02:00
kamilkrzywda 15d93ec2a4 Optional replyId on send (API + MCP) — protocol-level threaded replies (#31)
CI / build + unit (push) Successful in 33s
v0.12.7
2026-09-25 13:53:47 +02:00
kamilkrzywda 0909fbc6e2 MESHTASTIC.md: back to channel-only replies (no DMs) (#30)
CI / build + unit (push) Successful in 33s
v0.12.6
2026-09-25 13:00:05 +02:00
kamilkrzywda b8ae5d39f7 MESHTASTIC.md: reply to senders as DMs; always respond before starting work (#29)
CI / build + unit (push) Successful in 33s
v0.12.5
2026-09-25 12:52:11 +02:00
kamilkrzywda 5999159e17 Forwarder: resolve opencode workspace/session dynamically per request (#28)
CI / build + unit (push) Successful in 32s
v0.12.4
2026-09-25 12:24:39 +02:00
kamilkrzywda 36021ec2e8 Retry notify webhook POST with backoff (2 s / 10 s / 30 s) before dropping (#27)
CI / build + unit (push) Successful in 1m2s
v0.12.3
2026-09-25 11:48:39 +02:00
kamilkrzywda dca0dfa894 Run notify forwarder as a compose service (host networking, restart policy) (#26)
CI / build + unit (push) Successful in 19s
v0.12.2
2026-09-25 10:49:51 +02:00
kamilkrzywda 5e03546f40 Fix weather module DI (MeshService export + value import) and pass WEATHER_CRON through compose (#25)
CI / build + unit (push) Successful in 31s
v0.12.1
2026-09-25 10:01:38 +02:00
kamilkrzywda 261f7ed18c Hourly cron weather report for Lublin (Open-Meteo) broadcast on mesh (#24)
CI / build + unit (push) Successful in 1m5s
v0.12.0
2026-09-25 09:48:03 +02:00
kamilkrzywda 180a9ce134 Add MESHTASTIC.md communication rules + AGENTS.md mention (#23)
CI / build + unit (push) Successful in 1m5s
v0.11.3
2026-09-25 09:37:30 +02:00
kamilkrzywda d3d1913b83 Self-echo filter for notify webhook (skip own-node messages) (#22)
CI / build + unit (push) Successful in 43s
v0.11.2
2026-09-25 08:51:03 +02:00
kamilkrzywda 3d0e369230 Notify webhook also fires for injected messages (channel match) + compose env passthroughs (#21)
CI / build + unit (push) Successful in 35s
v0.11.1
2026-09-25 03:56:53 +02:00
kamilkrzywda 024dabda97 Outbound notification webhook (MESH_NOTIFY_URL) on RX text — issue #17 (#20)
CI / build + unit (push) Successful in 36s
v0.11.0
2026-09-25 03:35:50 +02:00