polygram 0.8.0-rc.43 → 0.8.0-rc.44

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://anthropic.com/claude-code/plugin.schema.json",
3
3
  "name": "polygram",
4
- "version": "0.8.0-rc.43",
4
+ "version": "0.8.0-rc.44",
5
5
  "description": "Telegram integration for Claude Code that preserves the OpenClaw per-chat session model. Migration target for OpenClaw users. Multi-bot, multi-chat, per-topic isolation; SQLite transcripts; inline-keyboard approvals. Bundles /polygram:status|logs|pair-code|approvals admin commands and a history skill.",
6
6
  "keywords": [
7
7
  "telegram",
@@ -55,6 +55,14 @@ function createStreamer({
55
55
  schedule = setTimeout,
56
56
  cancel = clearTimeout,
57
57
  logger = console,
58
+ // rc.44: by default, KEEP intermediate "thinking out loud" bubbles
59
+ // when forceNewMessage transitions to a fresh bubble for a new
60
+ // top-level assistant message. Pre-rc.44 those were pushed onto
61
+ // archived[] and deleted at turn-end, leaving only the final
62
+ // answer visible — but users wanted the full reasoning trail
63
+ // visible, especially in DM debugging contexts. Set to false to
64
+ // restore the 0.7.2 "delete intermediate" behaviour.
65
+ preserveIntermediateBubbles = true,
58
66
  } = {}) {
59
67
  throttleMs = Math.max(THROTTLE_FLOOR_MS, throttleMs);
60
68
  let state = 'idle'; // 'idle' | 'live' | 'finalized'
@@ -158,15 +166,26 @@ function createStreamer({
158
166
  // emits a new top-level assistant message mid-turn (post tool-result):
159
167
  // we want it in its own bubble below the previous one, not appended
160
168
  // via editMessageText to the original.
169
+ //
170
+ // rc.44: by default, the previous bubble is PRESERVED (not archived
171
+ // for end-of-turn deletion). Users wanted the full reasoning trail
172
+ // visible — "thinking out loud" + tool-use intermediates document
173
+ // what the agent actually did, which is valuable transparency. The
174
+ // 0.7.2 deletion behaviour assumed users wanted only the final
175
+ // answer; for chat-style DM debugging that's wrong. Opt back into
176
+ // the old behaviour with `preserveIntermediateBubbles: false`.
177
+ //
178
+ // When preserving, we still cancel the pending throttled edit (it
179
+ // wouldn't fire after we transition to a new bubble anyway) but
180
+ // there may be a recently-flushed edit in flight whose result we
181
+ // don't await — the bubble will display whatever its last
182
+ // successful edit landed, which is typically very close to the
183
+ // segment's final text (throttle is 250ms; segments take seconds).
161
184
  function forceNewMessage() {
162
185
  if (pendingEdit) { cancel(pendingEdit); pendingEdit = null; }
163
- // Don't await flushPromise the caller has decided to start a new
164
- // message; whatever the old bubble shows is "done".
165
- // 0.7.2: track the previous bubble's msgId for end-of-turn cleanup.
166
- // Without this, every intermediate "thinking out loud" assistant
167
- // message in a tool-heavy turn leaves a permanent bubble in the
168
- // chat — the user wants only the final answer's bubble visible.
169
- if (msgId != null) archived.push(msgId);
186
+ if (msgId != null && !preserveIntermediateBubbles) {
187
+ archived.push(msgId);
188
+ }
170
189
  msgId = null;
171
190
  currentText = '';
172
191
  latestText = '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polygram",
3
- "version": "0.8.0-rc.43",
3
+ "version": "0.8.0-rc.44",
4
4
  "description": "Telegram daemon for Claude Code that preserves the OpenClaw per-chat session model. Migration path for OpenClaw users moving to Claude Code.",
5
5
  "main": "lib/ipc-client.js",
6
6
  "bin": {
package/polygram.js CHANGED
@@ -2303,6 +2303,15 @@ async function handleMessage(sessionKey, chatId, msg, bot) {
2303
2303
  },
2304
2304
  minChars: botCfg.streamMinChars,
2305
2305
  throttleMs: botCfg.streamThrottleMs,
2306
+ // rc.44: preserve intermediate "thinking out loud" bubbles by
2307
+ // default. Per-chat / per-bot opt-out via
2308
+ // `preserveIntermediateBubbles: false` for chats where the
2309
+ // partner-facing UX wants only the final answer (e.g. UMI Group).
2310
+ preserveIntermediateBubbles: chatConfig.preserveIntermediateBubbles != null
2311
+ ? chatConfig.preserveIntermediateBubbles
2312
+ : (botCfg.preserveIntermediateBubbles != null
2313
+ ? botCfg.preserveIntermediateBubbles
2314
+ : true),
2306
2315
  logger: { error: (m) => console.error(`[${label}] ${m}`) },
2307
2316
  });
2308
2317
  // streamer is registered with this turn via pm.send's context (below)