@kortyx/agent 0.37.1 → 0.38.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,64 @@
1
1
  # Changelog
2
2
 
3
+ ## Unreleased
4
+
5
+ - Preserve completed tool results and addressed human answers across root and child execution-budget continuations. Continue renews only the saved allowance and does not answer a later review.
6
+
7
+ - Add bounded, idempotent queued eval execution with shared consumer capacity,
8
+ event replay, explicit cancellation and optional PostgreSQL recovery.
9
+
10
+
11
+ ## [0.38.1](https://github.com/kortyx-io/kortyx/compare/agent-v0.38.0...agent-v0.38.1) (2026-10-14)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * **runtime:** preserve interrupt state across pauses and resume ([#348](https://github.com/kortyx-io/kortyx/issues/348)) ([03b49f2](https://github.com/kortyx-io/kortyx/commit/03b49f2b8b6b44a2852d16fd4fe1b3e199316072))
17
+
18
+
19
+ ### Dependencies
20
+
21
+ * The following workspace dependencies were updated
22
+ * dependencies
23
+ * @kortyx/runtime bumped to 0.24.1
24
+ * @kortyx/utils bumped to 0.3.8
25
+ * devDependencies
26
+ * @kortyx/hooks bumped to 0.34.3
27
+
28
+ ## [0.38.0](https://github.com/kortyx-io/kortyx/compare/agent-v0.37.1...agent-v0.38.0) (2026-10-13)
29
+
30
+
31
+ ### ⚠ BREAKING CHANGES
32
+
33
+ * **runtime:** Consumer eval routes cap active attempts at 20 by default. Set maxActiveAttempts before upgrading consumers with higher concurrency. Upgrade API and Studio together for the new case-dispatch progress events.
34
+ * **agent:** Consumer eval routes cap active attempts at 20 by default. Set maxActiveAttempts before upgrading consumers with higher concurrency. Upgrade API and Studio together for the new case-dispatch progress events.
35
+
36
+ ### Features
37
+
38
+ * **agent:** make concurrent eval execution resilient ([#339](https://github.com/kortyx-io/kortyx/issues/339)) ([84d0e4f](https://github.com/kortyx-io/kortyx/commit/84d0e4fe3d35e5cf80713f7550ef2b1d83e5a2ec))
39
+ * **runtime:** add opt-in workflow data reducers ([#340](https://github.com/kortyx-io/kortyx/issues/340)) ([8be2c81](https://github.com/kortyx-io/kortyx/commit/8be2c81f74c5c51ab98443144f3491d4e8d54a88))
40
+
41
+
42
+ ### Bug Fixes
43
+
44
+ * **evals:** preserve diagnostics and separate postcondition failures ([#337](https://github.com/kortyx-io/kortyx/issues/337)) ([d4fce4e](https://github.com/kortyx-io/kortyx/commit/d4fce4e670971d3b755835fc681c8125f67a9c70))
45
+
46
+
47
+ ### Dependencies
48
+
49
+ * The following workspace dependencies were updated
50
+ * dependencies
51
+ * @kortyx/core bumped to 0.14.0
52
+ * @kortyx/providers bumped to 0.9.3
53
+ * @kortyx/runtime bumped to 0.24.0
54
+ * @kortyx/stream bumped to 0.15.5
55
+ * @kortyx/utils bumped to 0.3.7
56
+ * @kortyx/prompts bumped to 0.2.1
57
+ * @kortyx/usage-telemetry bumped to 0.3.0
58
+ * devDependencies
59
+ * @kortyx/hooks bumped to 0.34.2
60
+ * @kortyx/openai bumped to 0.5.9
61
+
3
62
  ## [0.37.1](https://github.com/kortyx-io/kortyx/compare/agent-v0.37.0...agent-v0.37.1) (2026-10-13)
4
63
 
5
64
 
package/README.md CHANGED
@@ -95,3 +95,19 @@ Versions are optional. These deterministic checks run before semantic criteria
95
95
  and only match finalized visible outputs from the current step. See the
96
96
  [conversation eval guide](https://kortyx.io/docs/guides/conversation-evals) for
97
97
  SDK setup, Studio execution and custom executor requirements.
98
+
99
+ Eval issues preserve declared-safe failures and native diagnostic references.
100
+ Configure native diagnostic capture on the agent to inspect original hook errors
101
+ in Studio. Use `verify` for postconditions (false means Failed), and `teardown` for
102
+ reset (a thrown fault means Error). Setup, execution and verification have separate
103
+ cooperative budgets. See [eval error migration](../../docs/evals/error-contract-migration.md)
104
+ before upgrading a mixed SDK/API/Studio deployment.
105
+
106
+ ## Evaluation execution recovery
107
+
108
+ `createEvalRouteHandler` supports queued, idempotent execution with cursor-based
109
+ observation and explicit cancellation. Use `createPostgresEvalExecutionStore` from
110
+ `@kortyx/runtime` (or `kortyx`) for shared capacity and recovery across replicas.
111
+ The default memory store only survives within its process. See
112
+ [execution resilience](../../docs/evals/execution-resilience.md) for configuration,
113
+ retention, legacy compatibility and upgrade order.
package/dist/evals.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- export { C as CreateEvalsOptions, E as EvalCase, a as EvalCaseResult, b as EvalCaseResultSchema, c as EvalCommand, d as EvalConfigurationError, e as EvalContext, f as EvalCriterion, g as EvalCriterionResult, h as EvalDefaults, i as EvalEvidenceEvent, j as EvalEvidenceEventType, k as EvalEvidenceFilters, l as EvalEvidencePolicy, m as EvalEvidencePolicySchema, n as EvalExecution, o as EvalExecutionStatus, p as EvalExpectation, q as EvalGradeInput, r as EvalHandlerRef, s as EvalInterrupt, t as EvalIssue, u as EvalJson, v as EvalJudge, w as EvalJudgeEvidence, x as EvalJudgeIdentity, y as EvalJudgeIdentitySchema, z as EvalJudgeOptions, A as EvalJudgeUsage, B as EvalJudgeUsageSchema, D as EvalManifest, F as EvalManifestSchema, G as EvalObservation, H as EvalObservationSchema, I as EvalOutputExpectation, J as EvalOutputSelector, K as EvalPhase, L as EvalProgress, M as EvalProgressSchema, N as EvalRemoteRunRequest, O as EvalRemoteRunRequestSchema, P as EvalResponder, Q as EvalResumeResponseSchema, R as EvalRunOptions, S as EvalRunResult, T as EvalRunResultSchema, U as EvalRuntimeExecution, V as EvalSetupContext, W as EvalStatus, X as EvalStep, Y as EvalStepResult, Z as EvalStepResultSchema, _ as EvalSuite, $ as EvalSuiteSchema, a0 as EvalVerdict, a1 as EvalVerdictSchema, a2 as EvalWireEvent, a3 as EvalWireEventSchema, a4 as EvaluationMetadataSchema, a5 as StudioEvalJudgeOptions, a6 as StudioEvalJudgeRequestSchema, a7 as StudioEvalJudgeResponseSchema, a8 as StudioEvalStartRequestSchema, a9 as StudioEvaluationDetail, aa as StudioEvaluationDetailSchema, ab as StudioEvaluationHistorySchema, ac as StudioEvaluationResultsSchema, ad as StudioEvaluationStartRequest, ae as StudioEvaluationStartRequestSchema, af as StudioEvaluationSummary, ag as StudioEvaluationSummarySchema, ah as createStudioEvalJudge, ai as defineSuite, aj as getEvalGradeEvidence, ak as parseEvalSuite } from './studio-judge-Dsz6KDY2.js';
1
+ export { C as CreateEvalsOptions, E as EvalCase, a as EvalCaseResult, b as EvalCaseResultSchema, c as EvalCommand, d as EvalConfigurationError, e as EvalContext, f as EvalCriterion, g as EvalCriterionResult, h as EvalDefaults, i as EvalEvidenceEvent, j as EvalEvidenceEventType, k as EvalEvidenceFilters, l as EvalEvidencePolicy, m as EvalEvidencePolicySchema, n as EvalExecution, o as EvalExecutionStatus, p as EvalExpectation, q as EvalGradeInput, r as EvalHandlerRef, s as EvalInterrupt, t as EvalIssue, u as EvalIssueSchema, v as EvalJson, w as EvalJudge, x as EvalJudgeEvidence, y as EvalJudgeIdentity, z as EvalJudgeIdentitySchema, A as EvalJudgeOptions, B as EvalJudgeUsage, D as EvalJudgeUsageSchema, F as EvalManifest, G as EvalManifestSchema, H as EvalObservation, I as EvalObservationSchema, J as EvalOutputExpectation, K as EvalOutputSelector, L as EvalPhase, M as EvalProgress, N as EvalProgressSchema, O as EvalRemoteRunRequest, P as EvalRemoteRunRequestSchema, Q as EvalResponder, R as EvalResumeResponseSchema, S as EvalRunOptions, T as EvalRunResult, U as EvalRunResultSchema, V as EvalRuntimeExecution, W as EvalSetupContext, X as EvalStatus, Y as EvalStep, Z as EvalStepResult, _ as EvalStepResultSchema, $ as EvalSuite, a0 as EvalSuiteSchema, a1 as EvalVerdict, a2 as EvalVerdictSchema, a3 as EvalWireEvent, a4 as EvalWireEventSchema, a5 as EvaluationMetadataSchema, a6 as StudioEvalJudgeOptions, a7 as StudioEvalJudgeRequestSchema, a8 as StudioEvalJudgeResponseSchema, a9 as StudioEvalStartRequestSchema, aa as StudioEvaluationDetail, ab as StudioEvaluationDetailSchema, ac as StudioEvaluationHistorySchema, ad as StudioEvaluationResultsSchema, ae as StudioEvaluationStartRequest, af as StudioEvaluationStartRequestSchema, ag as StudioEvaluationSummary, ah as StudioEvaluationSummarySchema, ai as createEvalIssue, aj as createStudioEvalJudge, ak as defineSuite, al as getEvalGradeEvidence, am as parseEvalSuite } from './studio-judge-DCAw3v60.js';
2
+ import * as _kortyx_core from '@kortyx/core';
2
3
  import { z } from 'zod';
3
4
  import '@kortyx/prompts';
4
- import '@kortyx/providers';
5
5
  import '@kortyx/core/errors';
6
+ import '@kortyx/providers';
6
7
  import '@kortyx/stream';
7
- import '@kortyx/core';
8
8
  import '@kortyx/runtime';
9
9
  import '@kortyx/hooks';
10
10
  import './chat-message-D4EsFcr1.js';
@@ -838,6 +838,22 @@ declare const StudioEvalDetailSchema: z.ZodObject<{
838
838
  ungraded: z.ZodOptional<z.ZodNumber>;
839
839
  }, z.core.$strict>;
840
840
  cases: z.ZodArray<z.ZodObject<{
841
+ verification: z.ZodOptional<z.ZodObject<{
842
+ passed: z.ZodBoolean;
843
+ reason: z.ZodString;
844
+ evidence: z.ZodArray<z.ZodString>;
845
+ }, z.core.$strict>>;
846
+ phaseDurationsMs: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
847
+ params: "params";
848
+ execute: "execute";
849
+ setup: "setup";
850
+ responder: "responder";
851
+ reference: "reference";
852
+ grading: "grading";
853
+ verification: "verification";
854
+ cleanup: "cleanup";
855
+ reporting: "reporting";
856
+ }> & z.core.$partial, z.ZodNumber>>;
841
857
  caseId: z.ZodString;
842
858
  repetition: z.ZodNumber;
843
859
  attemptId: z.ZodOptional<z.ZodUUID>;
@@ -859,6 +875,8 @@ declare const StudioEvalDetailSchema: z.ZodObject<{
859
875
  version: z.ZodLiteral<"compact-v1">;
860
876
  history: z.ZodBoolean;
861
877
  observation: z.ZodObject<{
878
+ failure: z.ZodOptional<z.ZodPipe<z.ZodCustom<_kortyx_core.FailureDescriptor, _kortyx_core.FailureDescriptor>, z.ZodTransform<_kortyx_core.SerializedFailureDescriptor, _kortyx_core.FailureDescriptor>>>;
879
+ diagnosticId: z.ZodOptional<z.ZodUUID>;
862
880
  promptUsage: z.ZodOptional<z.ZodArray<z.ZodObject<{
863
881
  id: z.ZodString;
864
882
  version: z.ZodNumber;
@@ -933,6 +951,8 @@ declare const StudioEvalDetailSchema: z.ZodObject<{
933
951
  reference: z.ZodOptional<z.ZodJSONSchema>;
934
952
  }, z.core.$strict>;
935
953
  observation: z.ZodObject<{
954
+ failure: z.ZodOptional<z.ZodPipe<z.ZodCustom<_kortyx_core.FailureDescriptor, _kortyx_core.FailureDescriptor>, z.ZodTransform<_kortyx_core.SerializedFailureDescriptor, _kortyx_core.FailureDescriptor>>>;
955
+ diagnosticId: z.ZodOptional<z.ZodUUID>;
936
956
  promptUsage: z.ZodOptional<z.ZodArray<z.ZodObject<{
937
957
  id: z.ZodString;
938
958
  version: z.ZodNumber;
@@ -1017,6 +1037,8 @@ declare const StudioEvalDetailSchema: z.ZodObject<{
1017
1037
  }, z.core.$strict>>;
1018
1038
  }, z.core.$strict>>;
1019
1039
  errors: z.ZodArray<z.ZodObject<{
1040
+ failure: z.ZodOptional<z.ZodPipe<z.ZodCustom<_kortyx_core.FailureDescriptor, _kortyx_core.FailureDescriptor>, z.ZodTransform<_kortyx_core.SerializedFailureDescriptor, _kortyx_core.FailureDescriptor>>>;
1041
+ diagnosticId: z.ZodOptional<z.ZodUUID>;
1020
1042
  phase: z.ZodEnum<{
1021
1043
  params: "params";
1022
1044
  execute: "execute";
@@ -1024,6 +1046,7 @@ declare const StudioEvalDetailSchema: z.ZodObject<{
1024
1046
  responder: "responder";
1025
1047
  reference: "reference";
1026
1048
  grading: "grading";
1049
+ verification: "verification";
1027
1050
  cleanup: "cleanup";
1028
1051
  reporting: "reporting";
1029
1052
  }>;
@@ -1032,6 +1055,8 @@ declare const StudioEvalDetailSchema: z.ZodObject<{
1032
1055
  }, z.core.$strict>>;
1033
1056
  }, z.core.$strict>>;
1034
1057
  errors: z.ZodArray<z.ZodObject<{
1058
+ failure: z.ZodOptional<z.ZodPipe<z.ZodCustom<_kortyx_core.FailureDescriptor, _kortyx_core.FailureDescriptor>, z.ZodTransform<_kortyx_core.SerializedFailureDescriptor, _kortyx_core.FailureDescriptor>>>;
1059
+ diagnosticId: z.ZodOptional<z.ZodUUID>;
1035
1060
  phase: z.ZodEnum<{
1036
1061
  params: "params";
1037
1062
  execute: "execute";
@@ -1039,6 +1064,7 @@ declare const StudioEvalDetailSchema: z.ZodObject<{
1039
1064
  responder: "responder";
1040
1065
  reference: "reference";
1041
1066
  grading: "grading";
1067
+ verification: "verification";
1042
1068
  cleanup: "cleanup";
1043
1069
  reporting: "reporting";
1044
1070
  }>;
@@ -1049,6 +1075,19 @@ declare const StudioEvalDetailSchema: z.ZodObject<{
1049
1075
  events: z.ZodArray<z.ZodObject<{
1050
1076
  id: z.ZodNumber;
1051
1077
  event: z.ZodDiscriminatedUnion<[z.ZodObject<{
1078
+ type: z.ZodLiteral<"case-dispatch">;
1079
+ caseId: z.ZodString;
1080
+ repetition: z.ZodNumber;
1081
+ status: z.ZodEnum<{
1082
+ queued: "queued";
1083
+ retrying: "retrying";
1084
+ reconnecting: "reconnecting";
1085
+ }>;
1086
+ retryAt: z.ZodOptional<z.ZodISODateTime>;
1087
+ httpStatus: z.ZodOptional<z.ZodNumber>;
1088
+ executionId: z.ZodOptional<z.ZodUUID>;
1089
+ generation: z.ZodOptional<z.ZodUUID>;
1090
+ }, z.core.$strict>, z.ZodObject<{
1052
1091
  type: z.ZodLiteral<"case-runtime-associated">;
1053
1092
  caseId: z.ZodString;
1054
1093
  repetition: z.ZodNumber;
@@ -1073,6 +1112,7 @@ declare const StudioEvalDetailSchema: z.ZodObject<{
1073
1112
  responder: "responder";
1074
1113
  reference: "reference";
1075
1114
  grading: "grading";
1115
+ verification: "verification";
1076
1116
  cleanup: "cleanup";
1077
1117
  reporting: "reporting";
1078
1118
  }>;
@@ -1092,6 +1132,8 @@ declare const StudioEvalDetailSchema: z.ZodObject<{
1092
1132
  version: z.ZodLiteral<"compact-v1">;
1093
1133
  history: z.ZodBoolean;
1094
1134
  observation: z.ZodObject<{
1135
+ failure: z.ZodOptional<z.ZodPipe<z.ZodCustom<_kortyx_core.FailureDescriptor, _kortyx_core.FailureDescriptor>, z.ZodTransform<_kortyx_core.SerializedFailureDescriptor, _kortyx_core.FailureDescriptor>>>;
1136
+ diagnosticId: z.ZodOptional<z.ZodUUID>;
1095
1137
  promptUsage: z.ZodOptional<z.ZodArray<z.ZodObject<{
1096
1138
  id: z.ZodString;
1097
1139
  version: z.ZodNumber;
@@ -1166,6 +1208,8 @@ declare const StudioEvalDetailSchema: z.ZodObject<{
1166
1208
  reference: z.ZodOptional<z.ZodJSONSchema>;
1167
1209
  }, z.core.$strict>;
1168
1210
  observation: z.ZodObject<{
1211
+ failure: z.ZodOptional<z.ZodPipe<z.ZodCustom<_kortyx_core.FailureDescriptor, _kortyx_core.FailureDescriptor>, z.ZodTransform<_kortyx_core.SerializedFailureDescriptor, _kortyx_core.FailureDescriptor>>>;
1212
+ diagnosticId: z.ZodOptional<z.ZodUUID>;
1169
1213
  promptUsage: z.ZodOptional<z.ZodArray<z.ZodObject<{
1170
1214
  id: z.ZodString;
1171
1215
  version: z.ZodNumber;
@@ -1252,6 +1296,22 @@ declare const StudioEvalDetailSchema: z.ZodObject<{
1252
1296
  }, z.core.$strict>, z.ZodObject<{
1253
1297
  type: z.ZodLiteral<"case-completed">;
1254
1298
  result: z.ZodObject<{
1299
+ verification: z.ZodOptional<z.ZodObject<{
1300
+ passed: z.ZodBoolean;
1301
+ reason: z.ZodString;
1302
+ evidence: z.ZodArray<z.ZodString>;
1303
+ }, z.core.$strict>>;
1304
+ phaseDurationsMs: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
1305
+ params: "params";
1306
+ execute: "execute";
1307
+ setup: "setup";
1308
+ responder: "responder";
1309
+ reference: "reference";
1310
+ grading: "grading";
1311
+ verification: "verification";
1312
+ cleanup: "cleanup";
1313
+ reporting: "reporting";
1314
+ }> & z.core.$partial, z.ZodNumber>>;
1255
1315
  caseId: z.ZodString;
1256
1316
  repetition: z.ZodNumber;
1257
1317
  attemptId: z.ZodOptional<z.ZodUUID>;
@@ -1273,6 +1333,8 @@ declare const StudioEvalDetailSchema: z.ZodObject<{
1273
1333
  version: z.ZodLiteral<"compact-v1">;
1274
1334
  history: z.ZodBoolean;
1275
1335
  observation: z.ZodObject<{
1336
+ failure: z.ZodOptional<z.ZodPipe<z.ZodCustom<_kortyx_core.FailureDescriptor, _kortyx_core.FailureDescriptor>, z.ZodTransform<_kortyx_core.SerializedFailureDescriptor, _kortyx_core.FailureDescriptor>>>;
1337
+ diagnosticId: z.ZodOptional<z.ZodUUID>;
1276
1338
  promptUsage: z.ZodOptional<z.ZodArray<z.ZodObject<{
1277
1339
  id: z.ZodString;
1278
1340
  version: z.ZodNumber;
@@ -1347,6 +1409,8 @@ declare const StudioEvalDetailSchema: z.ZodObject<{
1347
1409
  reference: z.ZodOptional<z.ZodJSONSchema>;
1348
1410
  }, z.core.$strict>;
1349
1411
  observation: z.ZodObject<{
1412
+ failure: z.ZodOptional<z.ZodPipe<z.ZodCustom<_kortyx_core.FailureDescriptor, _kortyx_core.FailureDescriptor>, z.ZodTransform<_kortyx_core.SerializedFailureDescriptor, _kortyx_core.FailureDescriptor>>>;
1413
+ diagnosticId: z.ZodOptional<z.ZodUUID>;
1350
1414
  promptUsage: z.ZodOptional<z.ZodArray<z.ZodObject<{
1351
1415
  id: z.ZodString;
1352
1416
  version: z.ZodNumber;
@@ -1431,6 +1495,8 @@ declare const StudioEvalDetailSchema: z.ZodObject<{
1431
1495
  }, z.core.$strict>>;
1432
1496
  }, z.core.$strict>>;
1433
1497
  errors: z.ZodArray<z.ZodObject<{
1498
+ failure: z.ZodOptional<z.ZodPipe<z.ZodCustom<_kortyx_core.FailureDescriptor, _kortyx_core.FailureDescriptor>, z.ZodTransform<_kortyx_core.SerializedFailureDescriptor, _kortyx_core.FailureDescriptor>>>;
1499
+ diagnosticId: z.ZodOptional<z.ZodUUID>;
1434
1500
  phase: z.ZodEnum<{
1435
1501
  params: "params";
1436
1502
  execute: "execute";
@@ -1438,6 +1504,7 @@ declare const StudioEvalDetailSchema: z.ZodObject<{
1438
1504
  responder: "responder";
1439
1505
  reference: "reference";
1440
1506
  grading: "grading";
1507
+ verification: "verification";
1441
1508
  cleanup: "cleanup";
1442
1509
  reporting: "reporting";
1443
1510
  }>;