From 5c66e8273bc9d72b88d3813056243185cac43a8f Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 26 Nov 2025 02:43:24 +0100 Subject: [PATCH] chore: update changelog and surface web relay settings --- CHANGELOG.md | 7 +++++-- src/cli/program.ts | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f61cbbcbb..4fd8c141e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ # Changelog -## 1.1.0 — 2025-11-25 +## 1.1.0 — 2025-11-26 -### Pending +### Changes - Web auto-replies now resize/recompress media and honor `inbound.reply.mediaMaxMb` in `~/.warelay/warelay.json` (default 5 MB) to avoid provider/API limits. - Web provider now detects media kind (image/audio/video/document), logs the source path, and enforces provider caps: images ≤6 MB, audio/video ≤16 MB, documents ≤100 MB; images still target the configurable cap above with resize + JPEG recompress. - Sessions can now send the system prompt only once: set `inbound.reply.session.sendSystemOnce` (optional `sessionIntro` for the first turn) to avoid re-sending large prompts every message. @@ -10,6 +10,9 @@ - Optional voice-note transcription: set `inbound.transcribeAudio.command` (e.g., OpenAI Whisper CLI) to turn inbound audio into text before templating/Claude; verbose logs surface when transcription runs. Prompts now include the original media path plus a `Transcript:` block so models see both. - Auto-reply command replies now return structured `{ payload, meta }`, respect `mediaMaxMb` for local media, log Claude metadata, and include the command `cwd` in timeout messages for easier debugging. - Added unit coverage for command helper edge cases (Claude flags, session args, media tokens, timeouts) and transcription download/command invocation. +- Split the monolithic web provider into focused modules under `src/web/` plus a barrel; added logout command, no-fallback relay behavior, and web-only relay start helper. +- Introduced structured reconnect/heartbeat logging (`web-reconnect`, `web-heartbeat`), bounded exponential backoff with CLI and config knobs, and a troubleshooting guide at `docs/refactor/web-relay-troubleshooting.md`. +- Relay help now prints effective heartbeat/backoff settings when running in web mode for quick triage. ## 1.0.4 — 2025-11-25 diff --git a/src/cli/program.ts b/src/cli/program.ts index 40ddb6ef5..068c1a2b0 100644 --- a/src/cli/program.ts +++ b/src/cli/program.ts @@ -3,6 +3,7 @@ import { Command } from "commander"; import { sendCommand } from "../commands/send.js"; import { statusCommand } from "../commands/status.js"; import { webhookCommand } from "../commands/webhook.js"; +import { loadConfig } from "../config/config.js"; import { ensureTwilioEnv } from "../env.js"; import { danger, info, setVerbose, setYes } from "../globals.js"; import { @@ -15,6 +16,10 @@ import { import { defaultRuntime } from "../runtime.js"; import type { Provider } from "../utils.js"; import { VERSION } from "../version.js"; +import { + resolveHeartbeatSeconds, + resolveReconnectPolicy, +} from "../web/reconnect.js"; import { createDefaultDeps, logTwilioFrom, @@ -201,6 +206,7 @@ Examples: warelay relay --provider web # force personal web session warelay relay --provider twilio # force twilio poll warelay relay --provider twilio --interval 2 --lookback 30 + # Troubleshooting: docs/refactor/web-relay-troubleshooting.md `, ) .action(async (opts) => { @@ -287,6 +293,20 @@ Examples: if (provider === "web") { logWebSelfId(defaultRuntime, true); + const cfg = loadConfig(); + const effectiveHeartbeat = resolveHeartbeatSeconds( + cfg, + webTuning.heartbeatSeconds, + ); + const effectivePolicy = resolveReconnectPolicy( + cfg, + webTuning.reconnect, + ); + defaultRuntime.log( + info( + `Web relay health: heartbeat ${effectiveHeartbeat}s, retries ${effectivePolicy.maxAttempts || "∞"}, backoff ${effectivePolicy.initialMs}→${effectivePolicy.maxMs}ms x${effectivePolicy.factor} (jitter ${Math.round(effectivePolicy.jitter * 100)}%)`, + ), + ); try { await monitorWebProvider( Boolean(opts.verbose),