polygram 0.38.2 → 0.38.4
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/.claude-plugin/plugin.json +1 -1
- package/lib/approvals/store.js +45 -7
- package/lib/codex/runtime-controller.js +107 -1
- package/lib/db/event-detail-schema.js +524 -0
- package/lib/db/pairings.js +9 -1
- package/lib/db/secret-sweep.js +6 -3
- package/lib/db/sessions.js +2 -2
- package/lib/db.js +308 -49
- package/lib/handlers/abort.js +20 -3
- package/lib/handlers/approvals.js +2 -2
- package/lib/handlers/config-callback.js +7 -7
- package/lib/handlers/dispatcher.js +11 -9
- package/lib/handlers/questions.js +546 -45
- package/lib/handlers/slash-commands.js +54 -13
- package/lib/handlers/voice.js +1 -1
- package/lib/ops/clean-shutdown.js +5 -0
- package/lib/questions/questions.js +51 -0
- package/lib/questions/store.js +61 -5
- package/lib/rewind/execute.js +12 -2
- package/lib/rewind/rewind.js +1 -1
- package/lib/sdk/build-options.js +2 -2
- package/lib/sdk/callbacks.js +14 -9
- package/lib/secret-detect.js +280 -12
- package/lib/telegram/api.js +10 -2
- package/lib/telegram/rich-edit.js +9 -5
- package/lib/telegram/rich-send.js +6 -6
- package/migrations/020-drop-secret-fingerprint.sql +13 -0
- package/package.json +2 -2
- package/polygram.js +82 -45
|
@@ -315,13 +315,14 @@ function createDispatcher({
|
|
|
315
315
|
logEvent('handler-error', {
|
|
316
316
|
chat_id: chatId, session_key: sessionKey,
|
|
317
317
|
msg_id: msg?.message_id,
|
|
318
|
-
|
|
318
|
+
error_class: err.name || 'Error',
|
|
319
|
+
error_len: err.message?.length ?? 0,
|
|
319
320
|
code: err.code || undefined,
|
|
320
321
|
cause_code: err.cause?.code || undefined,
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
322
|
+
// A spawn failure's stderr is process output, not a field: its size
|
|
323
|
+
// says whether the child said anything at all, which is the signal
|
|
324
|
+
// that distinguishes "tmux refused" from "tmux said nothing".
|
|
325
|
+
stderr_len: typeof err.stderr === 'string' ? err.stderr.length : undefined,
|
|
325
326
|
aborted: wasAborted || undefined,
|
|
326
327
|
replay: isReplay || undefined,
|
|
327
328
|
oom_shutdown: oomShutdown || undefined,
|
|
@@ -342,7 +343,7 @@ function createDispatcher({
|
|
|
342
343
|
logger.error?.(`[${sessionKey}] failed to clear lost session: ${resetErr.message}`);
|
|
343
344
|
logEvent('session-reset-after-process-loss-failed', {
|
|
344
345
|
chat_id: chatId, session_key: sessionKey, msg_id: msg?.message_id,
|
|
345
|
-
|
|
346
|
+
error_class: resetErr.name || 'Error',
|
|
346
347
|
});
|
|
347
348
|
}
|
|
348
349
|
}
|
|
@@ -378,7 +379,8 @@ function createDispatcher({
|
|
|
378
379
|
logger.error?.(`[auth] (${botName}) Claude access DISABLED by Anthropic — turn rejected immediately instead of wedging; check the account/billing.`);
|
|
379
380
|
logEvent('auth-disabled', {
|
|
380
381
|
chat_id: chatId, session_key: sessionKey, msg_id: msg?.message_id,
|
|
381
|
-
|
|
382
|
+
error_class: err.name || 'Error',
|
|
383
|
+
error_len: err.message?.length ?? 0,
|
|
382
384
|
});
|
|
383
385
|
// Never let the gate itself become a new failure mode — AUTH_DISABLED
|
|
384
386
|
// is account-wide, so a bad gate would throw on every concurrent
|
|
@@ -496,7 +498,7 @@ function createDispatcher({
|
|
|
496
498
|
autoResumeTracker.markAttempt(sessionKey);
|
|
497
499
|
logEvent('auto-resume-attempted', {
|
|
498
500
|
chat_id: chatId, session_key: sessionKey, msg_id: msg.message_id,
|
|
499
|
-
|
|
501
|
+
error_class: err.name || 'Error',
|
|
500
502
|
});
|
|
501
503
|
return attemptAutoResume(sessionKey, chatId, msg, bot, {
|
|
502
504
|
provider,
|
|
@@ -512,7 +514,7 @@ function createDispatcher({
|
|
|
512
514
|
logger.error?.(`[${sessionKey}] auto-resume failed: ${resumeErr?.message}`);
|
|
513
515
|
logEvent('auto-resume-failed', {
|
|
514
516
|
chat_id: chatId, session_key: sessionKey, msg_id: msg.message_id,
|
|
515
|
-
|
|
517
|
+
error_class: resumeErr?.name || 'Error',
|
|
516
518
|
});
|
|
517
519
|
// Music topic incident (2026-06-01): a channels session whose
|
|
518
520
|
// context grew large enough to auto-/compact on resume loses its
|