polygram 0.8.0-rc.22 → 0.8.0-rc.24

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.22",
4
+ "version": "0.8.0-rc.24",
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",
@@ -224,19 +224,21 @@ function createReactionManager({
224
224
  // (no point arming over QUEUED/STALL/TIMEOUT itself).
225
225
  armStallTimers();
226
226
 
227
- const elapsed = Date.now() - lastFlushTs;
228
- if (elapsed >= throttleMs) {
229
- if (pendingTimer) { clearTimeout(pendingTimer); pendingTimer = null; }
230
- return flush(stateName);
231
- }
232
- // Inside throttle window: schedule for the soonest safe flush.
233
- if (!pendingTimer) {
234
- pendingTimer = setTimeout(() => {
235
- pendingTimer = null;
236
- flush(currentState);
237
- }, throttleMs - elapsed);
238
- pendingTimer.unref?.();
239
- }
227
+ // 0.8.0-rc.24: drop the 800ms throttle. Pre-rc.24, when a tool-
228
+ // using turn fired QUEUED → THINKING → TOOL within a few ms,
229
+ // the throttle squashed THINKING (pendingTimer flushed
230
+ // currentState which was already overwritten to TOOL by the
231
+ // time the timer fired). Users saw 👀 → ❰long pause❱ → 🔥 →
232
+ // 🥱, missing the 🤔 transition entirely.
233
+ //
234
+ // Why the throttle is now redundant: rc.11 added applyChain
235
+ // which serializes every apply() call to Telegram in
236
+ // setState() invocation order. So three rapid setStates in
237
+ // 30ms produce three sequential network calls, each ~200-300ms
238
+ // round-trip. User sees 👀 → 🤔 → 🔥 progress, smoothly
239
+ // paced by network latency.
240
+ if (pendingTimer) { clearTimeout(pendingTimer); pendingTimer = null; }
241
+ return flush(stateName);
240
242
  };
241
243
 
242
244
  const clear = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polygram",
3
- "version": "0.8.0-rc.22",
3
+ "version": "0.8.0-rc.24",
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
@@ -2022,10 +2022,10 @@ async function handleMessage(sessionKey, chatId, msg, bot) {
2022
2022
  chat_id: chatId, text_len: text.length,
2023
2023
  user: cmdUser, user_id: cmdUserId,
2024
2024
  });
2025
- const preserveBit = text.length > '/compact'.length
2026
- ? ' with your preservation instructions'
2027
- : '';
2028
- await sendReply(`🗜️ Compacting${preserveBit}…`);
2025
+ const hasHint = text.length > '/compact'.length + 1;
2026
+ await sendReply(hasHint
2027
+ ? '🗜️ Compacting with your hint…'
2028
+ : '🗜️ Compacting…');
2029
2029
  } catch (err) {
2030
2030
  console.error(`[${label}] /compact push: ${err.message}`);
2031
2031
  await sendReply(`🗜️ Couldn't trigger compact: ${err.message}`);
@@ -2658,7 +2658,7 @@ async function handleMessage(sessionKey, chatId, msg, bot) {
2658
2658
  `📚 Context window ${pct.toFixed(0)}% full. Three options:`,
2659
2659
  '',
2660
2660
  '• `/new` — start fresh; this conversation ends.',
2661
- '• `/compact <preserve text>` — summarise older messages, keep what you specify.',
2661
+ '• `/compact` — summarise older messages. Add a hint after the command (e.g. `/compact keep the Q3 commission decisions`) and that becomes the compactor\'s guidance.',
2662
2662
  '• Keep chatting — I\'ll auto-compact when needed; key context is preserved automatically.',
2663
2663
  ].join('\n');
2664
2664
  return tg(bot, 'sendMessage', {