@inkeep/agents-run-api 0.0.0-dev-20251120164037 → 0.0.0-dev-20251120164852

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/index.cjs CHANGED
@@ -2766,7 +2766,16 @@ var _ModelFactory = class _ModelFactory {
2766
2766
  if (!providerOptions) {
2767
2767
  return {};
2768
2768
  }
2769
- const excludedKeys = ["apiKey", "baseURL", "baseUrl", "maxDuration", "headers", "gateway", "nim", "custom"];
2769
+ const excludedKeys = [
2770
+ "apiKey",
2771
+ "baseURL",
2772
+ "baseUrl",
2773
+ "maxDuration",
2774
+ "headers",
2775
+ "gateway",
2776
+ "nim",
2777
+ "custom"
2778
+ ];
2770
2779
  const params = {};
2771
2780
  for (const [key, value] of Object.entries(providerOptions)) {
2772
2781
  if (!excludedKeys.includes(key) && value !== void 0) {
@@ -4872,8 +4881,10 @@ ${this.statusUpdateState?.config.prompt?.trim() || ""}`;
4872
4881
  }
4873
4882
  });
4874
4883
  const result = object;
4884
+ logger9.info({ result: JSON.stringify(result) }, "DEBUG: Result");
4875
4885
  const summaries = [];
4876
4886
  for (const [componentId, data] of Object.entries(result)) {
4887
+ logger9.info({ componentId, data: JSON.stringify(data) }, "DEBUG: Component data");
4877
4888
  if (componentId === "no_relevant_updates") {
4878
4889
  continue;
4879
4890
  }
@@ -5440,10 +5451,10 @@ var AgentSessionManager = class {
5440
5451
  /**
5441
5452
  * Initialize status updates for a session
5442
5453
  */
5443
- initializeStatusUpdates(sessionId, config, summarizerModel) {
5454
+ initializeStatusUpdates(sessionId, config, summarizerModel, baseModel) {
5444
5455
  const session = this.sessions.get(sessionId);
5445
5456
  if (session) {
5446
- session.initializeStatusUpdates(config, summarizerModel);
5457
+ session.initializeStatusUpdates(config, summarizerModel, baseModel);
5447
5458
  } else {
5448
5459
  logger9.error(
5449
5460
  {
@@ -12162,11 +12173,42 @@ var ExecutionHandler = class {
12162
12173
  scopes: { tenantId, projectId, agentId }
12163
12174
  });
12164
12175
  if (agentConfig?.statusUpdates && agentConfig.statusUpdates.enabled !== false) {
12165
- agentSessionManager.initializeStatusUpdates(
12166
- requestId2,
12167
- agentConfig.statusUpdates,
12168
- agentConfig.models?.summarizer
12169
- );
12176
+ try {
12177
+ const agentWithDefault = await agentsCore.getAgentWithDefaultSubAgent(dbClient_default)({
12178
+ scopes: { tenantId, projectId, agentId }
12179
+ });
12180
+ if (agentWithDefault?.defaultSubAgent) {
12181
+ const resolvedModels = await resolveModelConfig(
12182
+ agentId,
12183
+ agentWithDefault.defaultSubAgent
12184
+ );
12185
+ agentSessionManager.initializeStatusUpdates(
12186
+ requestId2,
12187
+ agentConfig.statusUpdates,
12188
+ resolvedModels.summarizer,
12189
+ resolvedModels.base
12190
+ );
12191
+ } else {
12192
+ agentSessionManager.initializeStatusUpdates(
12193
+ requestId2,
12194
+ agentConfig.statusUpdates,
12195
+ agentConfig.models?.summarizer
12196
+ );
12197
+ }
12198
+ } catch (modelError) {
12199
+ logger24.warn(
12200
+ {
12201
+ error: modelError instanceof Error ? modelError.message : "Unknown error",
12202
+ agentId
12203
+ },
12204
+ "Failed to resolve models for status updates, using agent-level config"
12205
+ );
12206
+ agentSessionManager.initializeStatusUpdates(
12207
+ requestId2,
12208
+ agentConfig.statusUpdates,
12209
+ agentConfig.models?.summarizer
12210
+ );
12211
+ }
12170
12212
  }
12171
12213
  } catch (error) {
12172
12214
  logger24.error(
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import { env } from './chunk-UZXC6MEO.js';
5
5
  import { getLogger } from './chunk-A2S7GSHL.js';
6
6
  import { STREAM_PARSER_MAX_SNAPSHOT_SIZE, STREAM_PARSER_MAX_STREAMED_SIZE, STREAM_PARSER_MAX_COLLECTED_PARTS, STREAM_BUFFER_MAX_SIZE_BYTES, SESSION_CLEANUP_INTERVAL_MS, STREAM_MAX_LIFETIME_MS, STREAM_TEXT_GAP_THRESHOLD_MS, AGENT_EXECUTION_MAX_CONSECUTIVE_ERRORS, SESSION_TOOL_RESULT_CACHE_TIMEOUT_MS, ARTIFACT_GENERATION_MAX_RETRIES, ARTIFACT_SESSION_MAX_PENDING, STATUS_UPDATE_DEFAULT_INTERVAL_SECONDS, STATUS_UPDATE_DEFAULT_NUM_EVENTS, ARTIFACT_SESSION_MAX_PREVIOUS_SUMMARIES, ARTIFACT_GENERATION_BACKOFF_INITIAL_MS, ARTIFACT_GENERATION_BACKOFF_MAX_MS, AGENT_EXECUTION_MAX_GENERATION_STEPS, FUNCTION_TOOL_SANDBOX_VCPUS_DEFAULT, FUNCTION_TOOL_EXECUTION_TIMEOUT_MS_DEFAULT, LLM_GENERATION_MAX_ALLOWED_TIMEOUT_MS, LLM_GENERATION_FIRST_CALL_TIMEOUT_MS_STREAMING, LLM_GENERATION_FIRST_CALL_TIMEOUT_MS_NON_STREAMING, LLM_GENERATION_SUBSEQUENT_CALL_TIMEOUT_MS, DELEGATION_TOOL_BACKOFF_MAX_ELAPSED_TIME_MS, DELEGATION_TOOL_BACKOFF_EXPONENT, DELEGATION_TOOL_BACKOFF_MAX_INTERVAL_MS, DELEGATION_TOOL_BACKOFF_INITIAL_INTERVAL_MS } from './chunk-IVALDC72.js';
7
7
  import { __publicField } from './chunk-PKBMQBKP.js';
8
- import { getTracer, HeadersScopeSchema, getRequestExecutionContext, createApiError, getAgentWithDefaultSubAgent, contextValidationMiddleware, getConversationId, getFullAgent, createOrGetConversation, getActiveAgentForConversation, setActiveAgentForConversation, getSubAgentById, handleContextResolution, createMessage, generateId, commonGetErrorResponses, loggerFactory, createDefaultCredentialStores, CredentialStoreRegistry, listTaskIdsByContextId, getTask, getLedgerArtifacts, upsertLedgerArtifact, createTask, updateTask, setSpanWithError, AGENT_EXECUTION_TRANSFER_COUNT_DEFAULT, updateConversation, handleApiError, CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT, CONVERSATION_HISTORY_DEFAULT_LIMIT, TaskState, setActiveAgentForThread, getConversation, getAgentById, getRelatedAgentsForAgent, getExternalAgentsForSubAgent, getTeamAgentsForSubAgent, getToolsForAgent, getDataComponentsForAgent, getArtifactComponentsForAgent, dbResultToMcpTool, validateAndGetApiKey, verifyServiceToken, validateTargetAgent, getProject, ContextResolver, CredentialStuffer, MCPServerType, getCredentialReference, McpClient, getFunctionToolsForSubAgent, getFunction, getContextConfigById, getFullAgentDefinition, TemplateEngine, agentHasArtifactComponents, MCPTransportType, SPAN_KEYS, headers, generateServiceToken } from '@inkeep/agents-core';
8
+ import { getTracer, HeadersScopeSchema, getRequestExecutionContext, createApiError, getAgentWithDefaultSubAgent, contextValidationMiddleware, getConversationId, getFullAgent, createOrGetConversation, getActiveAgentForConversation, setActiveAgentForConversation, getSubAgentById, handleContextResolution, createMessage, generateId, commonGetErrorResponses, loggerFactory, createDefaultCredentialStores, CredentialStoreRegistry, listTaskIdsByContextId, getTask, getLedgerArtifacts, upsertLedgerArtifact, createTask, updateTask, setSpanWithError, AGENT_EXECUTION_TRANSFER_COUNT_DEFAULT, updateConversation, handleApiError, CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT, CONVERSATION_HISTORY_DEFAULT_LIMIT, TaskState, getAgentById, getProject, setActiveAgentForThread, getConversation, getRelatedAgentsForAgent, getExternalAgentsForSubAgent, getTeamAgentsForSubAgent, getToolsForAgent, getDataComponentsForAgent, getArtifactComponentsForAgent, dbResultToMcpTool, validateAndGetApiKey, verifyServiceToken, validateTargetAgent, ContextResolver, CredentialStuffer, MCPServerType, getCredentialReference, McpClient, getFunctionToolsForSubAgent, getFunction, getContextConfigById, getFullAgentDefinition, TemplateEngine, agentHasArtifactComponents, MCPTransportType, SPAN_KEYS, headers, generateServiceToken } from '@inkeep/agents-core';
9
9
  import { otel } from '@hono/otel';
10
10
  import { OpenAPIHono, createRoute, z as z$1 } from '@hono/zod-openapi';
11
11
  import { trace, propagation, context, SpanStatusCode } from '@opentelemetry/api';
@@ -1120,7 +1120,16 @@ var _ModelFactory = class _ModelFactory {
1120
1120
  if (!providerOptions) {
1121
1121
  return {};
1122
1122
  }
1123
- const excludedKeys = ["apiKey", "baseURL", "baseUrl", "maxDuration", "headers", "gateway", "nim", "custom"];
1123
+ const excludedKeys = [
1124
+ "apiKey",
1125
+ "baseURL",
1126
+ "baseUrl",
1127
+ "maxDuration",
1128
+ "headers",
1129
+ "gateway",
1130
+ "nim",
1131
+ "custom"
1132
+ ];
1124
1133
  const params = {};
1125
1134
  for (const [key, value] of Object.entries(providerOptions)) {
1126
1135
  if (!excludedKeys.includes(key) && value !== void 0) {
@@ -3208,8 +3217,10 @@ ${this.statusUpdateState?.config.prompt?.trim() || ""}`;
3208
3217
  }
3209
3218
  });
3210
3219
  const result = object;
3220
+ logger8.info({ result: JSON.stringify(result) }, "DEBUG: Result");
3211
3221
  const summaries = [];
3212
3222
  for (const [componentId, data] of Object.entries(result)) {
3223
+ logger8.info({ componentId, data: JSON.stringify(data) }, "DEBUG: Component data");
3213
3224
  if (componentId === "no_relevant_updates") {
3214
3225
  continue;
3215
3226
  }
@@ -3776,10 +3787,10 @@ var AgentSessionManager = class {
3776
3787
  /**
3777
3788
  * Initialize status updates for a session
3778
3789
  */
3779
- initializeStatusUpdates(sessionId, config, summarizerModel) {
3790
+ initializeStatusUpdates(sessionId, config, summarizerModel, baseModel) {
3780
3791
  const session = this.sessions.get(sessionId);
3781
3792
  if (session) {
3782
- session.initializeStatusUpdates(config, summarizerModel);
3793
+ session.initializeStatusUpdates(config, summarizerModel, baseModel);
3783
3794
  } else {
3784
3795
  logger8.error(
3785
3796
  {
@@ -10451,11 +10462,42 @@ var ExecutionHandler = class {
10451
10462
  scopes: { tenantId, projectId, agentId }
10452
10463
  });
10453
10464
  if (agentConfig?.statusUpdates && agentConfig.statusUpdates.enabled !== false) {
10454
- agentSessionManager.initializeStatusUpdates(
10455
- requestId2,
10456
- agentConfig.statusUpdates,
10457
- agentConfig.models?.summarizer
10458
- );
10465
+ try {
10466
+ const agentWithDefault = await getAgentWithDefaultSubAgent(dbClient_default)({
10467
+ scopes: { tenantId, projectId, agentId }
10468
+ });
10469
+ if (agentWithDefault?.defaultSubAgent) {
10470
+ const resolvedModels = await resolveModelConfig(
10471
+ agentId,
10472
+ agentWithDefault.defaultSubAgent
10473
+ );
10474
+ agentSessionManager.initializeStatusUpdates(
10475
+ requestId2,
10476
+ agentConfig.statusUpdates,
10477
+ resolvedModels.summarizer,
10478
+ resolvedModels.base
10479
+ );
10480
+ } else {
10481
+ agentSessionManager.initializeStatusUpdates(
10482
+ requestId2,
10483
+ agentConfig.statusUpdates,
10484
+ agentConfig.models?.summarizer
10485
+ );
10486
+ }
10487
+ } catch (modelError) {
10488
+ logger20.warn(
10489
+ {
10490
+ error: modelError instanceof Error ? modelError.message : "Unknown error",
10491
+ agentId
10492
+ },
10493
+ "Failed to resolve models for status updates, using agent-level config"
10494
+ );
10495
+ agentSessionManager.initializeStatusUpdates(
10496
+ requestId2,
10497
+ agentConfig.statusUpdates,
10498
+ agentConfig.models?.summarizer
10499
+ );
10500
+ }
10459
10501
  }
10460
10502
  } catch (error) {
10461
10503
  logger20.error(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-run-api",
3
- "version": "0.0.0-dev-20251120164037",
3
+ "version": "0.0.0-dev-20251120164852",
4
4
  "description": "Agents Run API for Inkeep Agent Framework - handles chat, agent execution, and streaming",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -54,7 +54,7 @@
54
54
  "traverse": "^0.6.11",
55
55
  "ts-pattern": "^5.7.1",
56
56
  "zod": "4.1.5",
57
- "@inkeep/agents-core": "^0.0.0-dev-20251120164037"
57
+ "@inkeep/agents-core": "^0.0.0-dev-20251120164852"
58
58
  },
59
59
  "optionalDependencies": {
60
60
  "keytar": "^7.9.0"