instar 1.3.679 → 1.3.681

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 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA8CH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAU3D,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AAwBjG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAwH7D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AA+EtD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC1C,OAAO,CAUT;AAyID,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA84CD,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,eAAe,EACzB,cAAc,EAAE,cAAc,EAC9B,YAAY,CAAC,EAAE,YAAY,EAC3B,WAAW,CAAC,EAAE,WAAW,EACzB,WAAW,CAAC,EAAE,WAAW,EACzB,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,EAGvE,UAAU,CAAC,EAAE,MAAM,OAAO,8BAA8B,EAAE,WAAW,GAAG,IAAI,EAK5E,qBAAqB,CAAC,EAAE,MAAM,OAAO,gCAAgC,EAAE,kBAAkB,GAAG,IAAI,EAKhG,mBAAmB,CAAC,EAAE,M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E,WAAW,EACzB,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,EAGvE,UAAU,CAAC,EAAE,MAAM,OAAO,8BAA8B,EAAE,WAAW,GAAG,IAAI,EAK5E,qBAAqB,CAAC,EAAE,MAAM,OAAO,gCAAgC,EAAE,kBAAkB,GAAG,IAAI,EAKhG,mBAAmB,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,GACpD,IAAI,CAigBN;AA2lBD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA+rhBtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
@@ -51,6 +51,7 @@ import { AgentServer } from '../server/AgentServer.js';
51
51
  import { BootHealthBeacon } from '../server/BootHealthBeacon.js';
52
52
  import { TelegramAdapter, TOPIC_STYLE, selectTopicEmoji } from '../messaging/TelegramAdapter.js';
53
53
  import { getTelegramInboundDir } from '../messaging/shared/telegramInboundFiles.js';
54
+ import { buildColdStartFallbackReply } from '../messaging/ColdStartFallbackReply.js';
54
55
  import { RelationshipManager } from '../core/RelationshipManager.js';
55
56
  import { getFeatureMetricsRecorder } from '../core/CircuitBreakingIntelligenceProvider.js';
56
57
  import { configureLlmCircuitBreaker, llmCircuitAvailable } from '../core/LlmCircuitBreaker.js';
@@ -2070,11 +2071,18 @@ getAttentionTopicId) {
2070
2071
  respawnSessionForTopic(sessionManager, telegram, targetSession, topicId, text, topicMemory, resolvedUser ?? undefined)
2071
2072
  .catch(err => {
2072
2073
  console.error(`[telegram→session] Respawn failed:`, err);
2073
- const errMsg = err instanceof Error ? err.message : String(err);
2074
- const userMsg = errMsg.includes('session limit') || errMsg.includes('limit')
2075
- ? `❌ Session restart failed session limit reached. Close an existing session or increase maxSessions in your config, then try again.`
2076
- : `❌ Session restart failed. Try sending your message again in a moment.`;
2077
- telegram.sendToTopic(topicId, userMsg).catch(() => { });
2074
+ // G1 "Agent Is Always Reachable" corollary (2): no silent resource
2075
+ // rejection. On a restart failure, hand the user WHY + a pointer to the
2076
+ // always-alive Lifeline topic + a copy-paste debug message on the
2077
+ // deterministic delivery path (sendToTopic, never the LLM tone gate).
2078
+ const { userMessage } = buildColdStartFallbackReply({
2079
+ error: err,
2080
+ topicId,
2081
+ topicName: storedTopicName,
2082
+ lifelineTopicId: telegram.getLifelineTopicId() ?? null,
2083
+ kind: 'restart',
2084
+ });
2085
+ telegram.sendToTopic(topicId, userMessage).catch(() => { });
2078
2086
  })
2079
2087
  .finally(() => {
2080
2088
  spawningTopics.clear(topicId, _spawnTokB);
@@ -2109,11 +2117,18 @@ getAttentionTopicId) {
2109
2117
  console.log(`[telegram→session] Auto-spawned "${newSessionName}" for topic ${topicId}`);
2110
2118
  }).catch((err) => {
2111
2119
  console.error(`[telegram→session] Auto-spawn failed:`, err);
2112
- const errMsg = err instanceof Error ? err.message : String(err);
2113
- const userMsg = errMsg.includes('session limit') || errMsg.includes('limit')
2114
- ? `❌ Unable to start session session limit reached. Close an existing session or increase maxSessions in your config, then try again.`
2115
- : 'Having trouble starting a session right now. Try sending your message again in a moment.';
2116
- telegram.sendToTopic(topicId, userMsg).catch(() => { });
2120
+ // G1 "Agent Is Always Reachable" corollary (2): no silent resource rejection.
2121
+ // On a cold-start failure, hand the user WHY + a pointer to the always-alive
2122
+ // Lifeline topic + a copy-paste debug message on the deterministic delivery
2123
+ // path (sendToTopic, never the LLM tone gate that can fail closed under load).
2124
+ const { userMessage } = buildColdStartFallbackReply({
2125
+ error: err,
2126
+ topicId,
2127
+ topicName: spawnName,
2128
+ lifelineTopicId: telegram.getLifelineTopicId() ?? null,
2129
+ kind: 'spawn',
2130
+ });
2131
+ telegram.sendToTopic(topicId, userMessage).catch(() => { });
2117
2132
  }).finally(() => {
2118
2133
  spawningTopics.clear(topicId, _spawnTokC);
2119
2134
  });
@@ -7281,6 +7296,12 @@ export async function startServer(options) {
7281
7296
  // always on; autoResumeStalePause gates only Layer 2.
7282
7297
  staleEmergencyPauseAutoResumeMin: rqCfg.staleEmergencyPauseAutoResumeMin ?? 60,
7283
7298
  autoResumeStalePause: rqCfg.autoResumeStalePause ?? true,
7299
+ // G2 (agent-always-reachable): a pressure-held revival surfaces ONE
7300
+ // plain-English notice after this window through the SAME deterministic
7301
+ // raiseAggregated funnel (attention queue, never the tone-gated reply
7302
+ // path) — closes the topic-28744 silent-no-revival gap. CODE-defaulted
7303
+ // like the other resumeQueue.* keys.
7304
+ pressureHeldNoticeMs: rqCfg.pressureHeldNoticeMs ?? 20 * 60_000,
7284
7305
  });
7285
7306
  resumeDrainer.start();
7286
7307
  console.log(pc.green(` ResumeQueue started (${(rqCfg.dryRun ?? !resolveDevAgentGate(undefined, config)) ? 'dry-run observe-only' : 'LIVE'}; drainer ${rqCfg.drainIntervalSec ?? 60}s tick)`));