@sema-agent/server 1.267.0 → 1.269.0

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/dist/main.js CHANGED
@@ -26,7 +26,7 @@ import { normalizeSuggestNextPrompts, normalizeResilience, normalizeAttachments,
26
26
  import { createBrain, brainSummary } from "./brain.js";
27
27
  import { loadConfig, logConfigDiagnostics } from "./config.js";
28
28
  import { resourceSuspendOptIn } from "./resource-suspend.js";
29
- import { createSessionStore, ensureSessionDurable } from "./plugins/session-store.js";
29
+ import { createSessionStore, ensureChildSessionDurableWithPromotion } from "./plugins/session-store.js";
30
30
  import { ForkRoutingSessionStore } from "./plugins/fork-routing-session-store.js";
31
31
  import { createStoreBackend } from "./plugins/store-backend.js";
32
32
  import { e2bExecutionEnvFactory } from "./plugins/remote-env-e2b.js";
@@ -1141,6 +1141,7 @@ async function main() {
1141
1141
  logger.info("session_auto_title_enabled", {});
1142
1142
  const workflowsCapable = workflowsCapability(runnerDeps);
1143
1143
  const checkpointStore = backend?.checkpoint && config.durableApproval ? backend.checkpoint(logger) : undefined;
1144
+ const subRunnerSessions = new ForkRoutingSessionStore(sessionStore, new TtlSessionStore({ defaultTtlDays: 1 / 24 }));
1144
1145
  const subRunner = new Runner({
1145
1146
  brain,
1146
1147
  models: config.models,
@@ -1149,7 +1150,7 @@ async function main() {
1149
1150
  pricing,
1150
1151
  tracer,
1151
1152
  promptSource,
1152
- sessionStore: new ForkRoutingSessionStore(sessionStore, new TtlSessionStore({ defaultTtlDays: 1 / 24 })),
1153
+ sessionStore: subRunnerSessions,
1153
1154
  ...(executionEnvFactory ? { executionEnvFactory } : {}),
1154
1155
  ...(lspManager ? { lspManager } : {}),
1155
1156
  ...(backgroundAgentStore ? { backgroundAgentStore } : {}),
@@ -1259,7 +1260,7 @@ async function main() {
1259
1260
  const webSearch = webSearchCfg ? createWebSearchBackend(webSearchCfg) : undefined;
1260
1261
  if (webSearch)
1261
1262
  logger.info(`WebSearch enabled (provider=${webSearchCfg.provider}, maxResults=${webSearch.maxResults})`);
1262
- const ensureChildSessionDurable = checkpointStore && config.sessionBackend === "tidb" ? (sessionId) => ensureSessionDurable(sessionStore, sessionId) : undefined;
1263
+ const ensureChildSessionDurable = checkpointStore && config.sessionBackend === "tidb" ? (sessionId) => ensureChildSessionDurableWithPromotion(sessionStore, subRunnerSessions, sessionId) : undefined;
1263
1264
  const scenarioDeps = {
1264
1265
  runner, subRunner, model: "default", skills, repoClient, requirePrincipal: config.requirePrincipal,
1265
1266
  ...(webSearch ? { webSearch } : {}), metrics, logger,