Files
openclaw/extensions/telegram/src/preview-streaming.ts
T
Ayaan Zaidi 06aa81a73f fix(channels): show tool lines under the progress status headline
A status headline replaced the rolling tool lines instead of sitting above
them, so a default Discord draft showed one preamble sentence for an entire
tool-heavy turn. Operators reached for `/verbose` to see any activity, which
delivers durable per-tool-call messages and floods the channel.

- Render the headline above the lines; both stay visible in one message.
- Shorten the start gate from 5s to 1.5s. The gate only creates the draft
  when the timer fires and finalize cancels it, so quick answers still post
  no draft while a 3s tool turn stops being silent.
- Drop Discord's label-gated tool-progress default so
  resolveChannelStreamingPreviewToolProgress is the single owner. An explicit
  `toolProgress: false` still silences the lines.
- Resolve that toggle against a "progress" mode guess when `streaming.mode`
  is unset, so the progress-draft channels stop ignoring an explicit
  `progress.toolProgress` opt-out.

Telegram now defaults to `streaming.mode: "progress"` like Discord; set
`"partial"` to keep streamed answer text. Its renderer draws work lines from
the compositor's structured lines, so `rendersRollingLinesNatively` keeps
them out of the composed text rather than printing every line twice.
2026-07-30 13:36:21 +09:00

17 lines
599 B
TypeScript

// Telegram plugin module implements preview streaming behavior.
import {
resolveChannelPreviewStreamMode,
type StreamingMode,
} from "openclaw/plugin-sdk/channel-outbound";
export function resolveTelegramPreviewStreamMode(
params: {
streaming?: unknown;
} = {},
): StreamingMode {
// Telegram defaults to the progress draft like Discord: on tool-heavy turns a
// status draft answers "is it working?", which streamed answer text cannot.
// Operators who prefer streamed answer text set `streaming.mode: "partial"`.
return resolveChannelPreviewStreamMode(params, "progress");
}