@llblab/pi-telegram 0.26.14 → 0.26.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.26.16: Follower Edit Normalization Hotfix
4
+
5
+ - `Follower Edit Normalization`: The bus-routed `editMessageText` path now treats Telegram's "message is not modified" rejection as an unchanged edit instead of a failure, matching the direct transport path. Impact: reasoning activity on follower instances no longer freezes its thinking block when an edit targets identical content (for example a repeated reasoning-end flush), because the failed edit no longer marks the whole block as blocked.
6
+
7
+ ## 0.26.15: Follower Bus Timeout Hotfix
8
+
9
+ - `Follower Bus Timeout`: Restored the 30-second default for follower-client bus calls (update forwarding, thread-target control, and API calls) after an entrypoint compression pass dropped the explicit timeout and left the forwarding path falling through to the 1-second transport default. The shared default now lives on the follower client runtime as `TELEGRAM_BUS_FOLLOWER_CLIENT_TIMEOUT_MS`. Impact: leader-to-follower update forwarding no longer times out under load, so polling stops re-fetching and re-downloading the same update (which previously delivered one voice message as three identical turns).
10
+
3
11
  ## 0.26.14: Reasoning Activity Throttle
4
12
 
5
13
  - `Reasoning Throttle`: Added a minimum interval between reasoning-block edits (`TELEGRAM_REASONING_MIN_INTERVAL_MS = 1_200`) so the first frame publishes immediately while later frames wait until both the interval and the 160-char delta threshold pass. The final `reasoning-end`/`agent-end` flush stays unconditional, and the 24-frame cap is unchanged. Impact: fast-token models with very large reasoning blocks no longer push an edit per character burst, so parallel threads stop saturating the bus and inbound Telegram messages arrive without multi-second delay.
package/lib/bus-api.ts CHANGED
@@ -5,6 +5,7 @@
5
5
  */
6
6
 
7
7
  import { stripTelegramBusApiMetadata } from "./bus.ts";
8
+ import { isTelegramMessageNotModifiedError } from "./telegram-api.ts";
8
9
  import type {
9
10
  TelegramAnswerGuestQueryOptions,
10
11
  TelegramApiCallOptions,
@@ -262,8 +263,13 @@ export function createTelegramBusAwareApiRuntime(
262
263
  body: TelegramEditMessageTextBody,
263
264
  ): Promise<"edited" | "unchanged"> {
264
265
  if (deps.ownsDirect()) return deps.directRuntime.editMessageText(body);
265
- await deps.callFollowerApi("call", ["editMessageText", body]);
266
- return "edited";
266
+ try {
267
+ await deps.callFollowerApi("call", ["editMessageText", body]);
268
+ return "edited";
269
+ } catch (error) {
270
+ if (isTelegramMessageNotModifiedError(error)) return "unchanged";
271
+ throw error;
272
+ }
267
273
  },
268
274
  async editMessageReplyMarkup(
269
275
  chatId: number,
@@ -35,6 +35,7 @@ import {
35
35
 
36
36
  export const TELEGRAM_BUS_FOLLOWER_PROMOTION_GRACE_MS = 2_500;
37
37
  export const TELEGRAM_FOLLOWER_SESSION_HANDOFF_TTL_MS = 30_000;
38
+ export const TELEGRAM_BUS_FOLLOWER_CLIENT_TIMEOUT_MS = 30_000;
38
39
  export const TELEGRAM_BUS_FOLLOWER_REGISTRATION_RETRY_ATTEMPTS =
39
40
  TELEGRAM_BUS_REGISTRATION_RETRY.attempts;
40
41
  export const TELEGRAM_BUS_FOLLOWER_REGISTRATION_RETRY_DELAY_MS =
@@ -720,10 +721,12 @@ export function createTelegramBusFollowerClientRuntime<
720
721
  TMessage = unknown,
721
722
  >(deps: TelegramBusFollowerClientRuntimeDeps<TMessage>) {
722
723
  const createRequestId = createTelegramBusRequestIdFactory(deps.instanceId);
724
+ const timeoutMs =
725
+ deps.timeoutMs ?? TELEGRAM_BUS_FOLLOWER_CLIENT_TIMEOUT_MS;
723
726
  const sharedClientDeps = {
724
727
  socketPath: deps.socketPath,
725
728
  createRequestId,
726
- timeoutMs: deps.timeoutMs,
729
+ timeoutMs,
727
730
  };
728
731
  return {
729
732
  createRequestId,
@@ -756,7 +759,8 @@ export function createTelegramBusFollowerApiCaller(
756
759
  deps: TelegramBusFollowerApiCallerDeps,
757
760
  ): (method: string, args: unknown[]) => Promise<unknown> {
758
761
  const getNowMs = deps.getNowMs ?? Date.now;
759
- const timeoutMs = deps.timeoutMs ?? 30000;
762
+ const timeoutMs =
763
+ deps.timeoutMs ?? TELEGRAM_BUS_FOLLOWER_CLIENT_TIMEOUT_MS;
760
764
  return async (method, args) => {
761
765
  const socketPath = resolveTelegramBusSocketPath(deps.socketPath);
762
766
  let response: TelegramBusEnvelope | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llblab/pi-telegram",
3
- "version": "0.26.14",
3
+ "version": "0.26.16",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"