polygram 0.12.0-rc.40 → 0.12.0-rc.41

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.
@@ -84,6 +84,12 @@ const PATTERNS = {
84
84
  // to "unknown".
85
85
  format: /invalid[_ ]request|invalid[_ ]json|malformed|bad request/i,
86
86
 
87
+ // CLI/channels backend: the claude process exited unexpectedly mid-life
88
+ // ("Claude Code process exited with code N" — e.g. 129/SIGHUP seen on
89
+ // shumabit). A respawn fixes it, so it's transient; the user gets a calm
90
+ // line, never the raw exit code. (known-issue #2.1)
91
+ processExit: /process exited with code|claude code process exited|exited with (signal|code)/i,
92
+
87
93
  // Transient HTTP (5xx upstream Anthropic outage / overload). Only
88
94
  // these get retried by pm. 521-524/529 are Cloudflare codes seen
89
95
  // when Anthropic's edge is degraded.
@@ -104,6 +110,7 @@ const USER_MESSAGES = {
104
110
  imageProcess: '🖼 One of the images in this conversation can\'t be re-processed by Claude — likely an older one in the history. Starting a fresh session for this chat.',
105
111
  timeout: '⏳ I went quiet too long without finishing. Try resending or simplifying.',
106
112
  format: '⚠️ Invalid request format. Try rephrasing or /new.',
113
+ processExit: '🔄 My Claude process stopped unexpectedly — resend in a moment and I\'ll restart it.',
107
114
  // Used both for in-flight retry attempts AND for the post-retry-failed
108
115
  // bubble-up message. Avoid promising "retrying once" since by the
109
116
  // time the user reads it pm has already retried and given up.
@@ -265,7 +272,7 @@ function classify(err) {
265
272
  return {
266
273
  kind,
267
274
  userMessage: USER_MESSAGES[kind],
268
- isTransient: kind === 'transient5xx' || kind === 'rateLimit',
275
+ isTransient: kind === 'transient5xx' || kind === 'rateLimit' || kind === 'processExit',
269
276
  autoRecover: AUTO_RECOVER[kind] ?? null,
270
277
  };
271
278
  }
@@ -285,13 +292,15 @@ function classify(err) {
285
292
  if (sdkResultSubtype) return sdkResultSubtype;
286
293
  }
287
294
 
288
- // Fall-through: surface a snippet of the raw error so users at
289
- // least know SOMETHING happened. Same shape as before, just
290
- // routed through the classifier so callers get a uniform return.
291
- const reason = msg.split('\n')[0].slice(0, 120);
295
+ // Fall-through: an error we couldn't classify. Do NOT echo the raw text
296
+ // to the user (known-issue #2.2) it leaks internal identifiers (tmux
297
+ // names, gate vocabulary, pane dumps; the 2026-06-03 incident). The full
298
+ // raw string is preserved by callers in the events log
299
+ // (handler-error.detail_json) for forensics; the user gets a calm,
300
+ // generic, actionable line.
292
301
  return {
293
302
  kind: 'unknown',
294
- userMessage: `Hit a snag: ${reason || 'unknown error'}. Try resending.`,
303
+ userMessage: '⚠️ Something went wrong on my end — try resending. If it keeps happening, send /new.',
295
304
  isTransient: false,
296
305
  autoRecover: null,
297
306
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polygram",
3
- "version": "0.12.0-rc.40",
3
+ "version": "0.12.0-rc.41",
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": {