@oneharness/sdk 0.12.2 → 0.13.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.
@@ -158,6 +158,11 @@ export declare const CAPABILITIES: {
158
158
  readonly flag: "--schema-max-retries";
159
159
  readonly kind: "value";
160
160
  readonly unless: null;
161
+ }, {
162
+ readonly option: "serverOverloadedMaxRetries";
163
+ readonly flag: "--server-overloaded-max-retries";
164
+ readonly kind: "value";
165
+ readonly unless: null;
161
166
  }, {
162
167
  readonly option: "outputDir";
163
168
  readonly flag: "--output-dir";
@@ -393,6 +398,11 @@ export declare const CAPABILITIES: {
393
398
  readonly flag: "--schema-max-retries";
394
399
  readonly kind: "value";
395
400
  readonly unless: null;
401
+ }, {
402
+ readonly option: "serverOverloadedMaxRetries";
403
+ readonly flag: "--server-overloaded-max-retries";
404
+ readonly kind: "value";
405
+ readonly unless: null;
396
406
  }, {
397
407
  readonly option: "outputDir";
398
408
  readonly flag: "--output-dir";
@@ -143,6 +143,12 @@ export const CAPABILITIES = {
143
143
  kind: "value",
144
144
  unless: null,
145
145
  },
146
+ {
147
+ option: "serverOverloadedMaxRetries",
148
+ flag: "--server-overloaded-max-retries",
149
+ kind: "value",
150
+ unless: null,
151
+ },
146
152
  {
147
153
  option: "outputDir",
148
154
  flag: "--output-dir",
@@ -425,6 +431,12 @@ export const CAPABILITIES = {
425
431
  kind: "value",
426
432
  unless: null,
427
433
  },
434
+ {
435
+ option: "serverOverloadedMaxRetries",
436
+ flag: "--server-overloaded-max-retries",
437
+ kind: "value",
438
+ unless: null,
439
+ },
428
440
  {
429
441
  option: "outputDir",
430
442
  flag: "--output-dir",
@@ -68,6 +68,7 @@ export interface ConfigReport {
68
68
  schema_file: Field3;
69
69
  schema_max_retries: Field7;
70
70
  schema_version: string;
71
+ server_overloaded_max_retries: Field7;
71
72
  stream: Field1;
72
73
  system: Field3;
73
74
  timeout: Field5;
@@ -57,7 +57,7 @@ export type ControlVerb = "interrupt";
57
57
  * new variant is a report `schema_version` bump like any other enum value, since
58
58
  * a consumer matching exhaustively learns of it only from the version.
59
59
  */
60
- export type FallThroughReason = "not-installed" | "spawn-error" | "auth" | "quota" | "session-not-found" | "untrusted-directory" | "input-too-large" | "model-mismatch" | "model-not-found" | "rate-limit";
60
+ export type FallThroughReason = "not-installed" | "spawn-error" | "auth" | "quota" | "session-not-found" | "untrusted-directory" | "input-too-large" | "model-mismatch" | "model-not-found" | "rate-limit" | "server-overloaded";
61
61
  export type ToolCallStatus = "completed" | "failed" | "timeout" | "interrupted";
62
62
  /**
63
63
  * How a normalized tool interval was obtained.
@@ -68,13 +68,13 @@ export type TimingSource = "provider_measured" | "stdout_observed";
68
68
  * harness's output. It is the single source for the `failure_kind` contract
69
69
  * value: serialized as the snake_case token a consumer reads in the report
70
70
  * (`auth`, `rate_limit`, `model_not_found`, `quota`, `session_not_found`,
71
- * `tool_deferred`), so the wire shape is unchanged — modeling it as an enum
71
+ * `tool_deferred`, `server_overloaded`), so the wire shape is unchanged — modeling it as an enum
72
72
  * keeps a misspelled or invalid kind unrepresentable and gives every
73
73
  * producer/consumer (classifier, `is_failure`, the fallback fall-through rule,
74
74
  * the report, history) one definition to share instead of scattered string
75
75
  * literals.
76
76
  */
77
- export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch";
77
+ export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded";
78
78
  /**
79
79
  * How a harness emits its result, which decides how `text` is extracted.
80
80
  *
@@ -421,11 +421,11 @@ export interface RunResult {
421
421
  * `status`, which records oneharness's relationship to the process. Two
422
422
  * families: coarse reasons for a non-zero run (`auth`, `rate_limit`,
423
423
  * `model_not_found`, `quota`, `session_not_found`, `untrusted_directory`,
424
- * `input_too_large`, `model_mismatch`), and `tool_deferred` — a run that exited
425
- * *cleanly* but only deferred a builtin tool call instead of executing it
426
- * (Claude Code bridge/managed deployments), so it did no useful work. The
427
- * deferred case is the only `failure_kind` that can appear on a `status: ok`
428
- * run, and it also marks the run as failed for exit-code purposes.
424
+ * `input_too_large`, `model_mismatch`, `server_overloaded`), and
425
+ * `tool_deferred` — a run that only deferred a builtin tool call instead of
426
+ * executing it (Claude Code bridge/managed deployments), so it did no useful
427
+ * work. Both `tool_deferred` and `server_overloaded` can accompany a clean
428
+ * transport exit; either still marks the run as failed for exit-code purposes.
429
429
  * Serialized as its snake_case token (see [`FailureKind`]).
430
430
  */
431
431
  failure_kind: FailureKind | null;
@@ -6,7 +6,7 @@ export type HistoryLine = ({
6
6
  harness: string;
7
7
  harness_id?: string | null | undefined;
8
8
  run_id: string;
9
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
9
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
10
10
  type: "event";
11
11
  variant?: string | null | undefined;
12
12
  [k: string]: unknown;
@@ -27,7 +27,7 @@ export type HistoryLine = ({
27
27
  [k: string]: unknown;
28
28
  } | ({
29
29
  error: string;
30
- schema_version?: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | undefined;
30
+ schema_version?: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | undefined;
31
31
  [k: string]: unknown;
32
32
  } & ({
33
33
  status?: "nonzero" | "timeout" | "cancelled" | "spawn-error" | "skipped" | undefined;
@@ -39,7 +39,7 @@ export type HistoryLine = ({
39
39
  work?: null | undefined;
40
40
  [k: string]: unknown;
41
41
  } | {
42
- schema_version?: "1.7" | "1.8" | undefined;
42
+ schema_version?: "1.7" | "1.8" | "1.9" | undefined;
43
43
  status?: "nonzero" | "timeout" | "cancelled" | undefined;
44
44
  work: "done" | "none";
45
45
  [k: string]: unknown;
@@ -48,31 +48,37 @@ export type HistoryLine = ({
48
48
  [k: string]: unknown;
49
49
  } | {
50
50
  observed_model: string;
51
- schema_version?: "1.8" | undefined;
51
+ schema_version?: "1.8" | "1.9" | undefined;
52
52
  [k: string]: unknown;
53
53
  }) & ({
54
54
  status?: "ok" | "nonzero" | "timeout" | "spawn-error" | "skipped" | "planned" | undefined;
55
55
  [k: string]: unknown;
56
56
  } | {
57
- schema_version?: "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | undefined;
57
+ schema_version?: "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | undefined;
58
58
  [k: string]: unknown;
59
59
  }) & (({
60
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | null;
60
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded" | null;
61
61
  [k: string]: unknown;
62
62
  } | {
63
- schema_version?: "1.5" | "1.6" | "1.7" | "1.8" | undefined;
63
+ schema_version?: "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | undefined;
64
64
  [k: string]: unknown;
65
65
  }) & ({
66
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "model_mismatch" | null;
66
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "model_mismatch" | "server_overloaded" | null;
67
67
  [k: string]: unknown;
68
68
  } | {
69
- schema_version?: "1.6" | "1.7" | "1.8" | undefined;
69
+ schema_version?: "1.6" | "1.7" | "1.8" | "1.9" | undefined;
70
70
  [k: string]: unknown;
71
71
  }) & ({
72
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | null;
72
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "server_overloaded" | null;
73
73
  [k: string]: unknown;
74
74
  } | {
75
- schema_version?: "1.8" | undefined;
75
+ schema_version?: "1.8" | "1.9" | undefined;
76
+ [k: string]: unknown;
77
+ }) & ({
78
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | null;
79
+ [k: string]: unknown;
80
+ } | {
81
+ schema_version?: "1.9" | undefined;
76
82
  [k: string]: unknown;
77
83
  })) & ({
78
84
  duration_ms: number;
@@ -100,7 +106,7 @@ export type HistoryLine = ({
100
106
  permission_mode: PermissionMode;
101
107
  project: string;
102
108
  prompt: string;
103
- schema_version: "1.0" | "1.1" | "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
109
+ schema_version: "1.0" | "1.1" | "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
104
110
  session: string;
105
111
  session_id: string | null;
106
112
  started_at: string;
@@ -145,7 +151,7 @@ export type HistoryLine = ({
145
151
  permission_mode: PermissionMode;
146
152
  project: string;
147
153
  prompt: string;
148
- schema_version: "1.0" | "1.1" | "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
154
+ schema_version: "1.0" | "1.1" | "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
149
155
  session: string;
150
156
  session_id: string | null;
151
157
  started_at: string;
@@ -190,7 +196,7 @@ export type HistoryLine = ({
190
196
  permission_mode: PermissionMode;
191
197
  project: string;
192
198
  prompt: string;
193
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
199
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
194
200
  session: string;
195
201
  session_id: string | null;
196
202
  started_at?: never | undefined;
@@ -235,7 +241,7 @@ export type HistoryLine = ({
235
241
  permission_mode: PermissionMode;
236
242
  project: string;
237
243
  prompt: string;
238
- schema_version: "1.0" | "1.1" | "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
244
+ schema_version: "1.0" | "1.1" | "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
239
245
  session: string;
240
246
  session_id: string | null;
241
247
  started_at?: never | undefined;
@@ -280,7 +286,7 @@ export type HistoryLine = ({
280
286
  permission_mode: PermissionMode;
281
287
  project: string;
282
288
  prompt: string;
283
- schema_version: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
289
+ schema_version: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
284
290
  session: string;
285
291
  session_id: string | null;
286
292
  started_at: string;
@@ -325,7 +331,7 @@ export type HistoryLine = ({
325
331
  permission_mode: PermissionMode;
326
332
  project: string;
327
333
  prompt: string;
328
- schema_version: "1.0" | "1.1" | "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
334
+ schema_version: "1.0" | "1.1" | "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
329
335
  session: string;
330
336
  session_id: string | null;
331
337
  started_at?: never | undefined;
@@ -355,13 +361,13 @@ export type TimingSource = "provider_measured" | "stdout_observed";
355
361
  * harness's output. It is the single source for the `failure_kind` contract
356
362
  * value: serialized as the snake_case token a consumer reads in the report
357
363
  * (`auth`, `rate_limit`, `model_not_found`, `quota`, `session_not_found`,
358
- * `tool_deferred`), so the wire shape is unchanged — modeling it as an enum
364
+ * `tool_deferred`, `server_overloaded`), so the wire shape is unchanged — modeling it as an enum
359
365
  * keeps a misspelled or invalid kind unrepresentable and gives every
360
366
  * producer/consumer (classifier, `is_failure`, the fallback fall-through rule,
361
367
  * the report, history) one definition to share instead of scattered string
362
368
  * literals.
363
369
  */
364
- export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch";
370
+ export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded";
365
371
  /**
366
372
  * The unified approval mode, from least to most autonomy. A harness may not
367
373
  * support every value (see [`crate::domain::harness::HarnessSpec::mode`]); the
@@ -112,7 +112,7 @@ export type HistoryRecord = {
112
112
  * run's single prompt).
113
113
  */
114
114
  prompt: string;
115
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
115
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
116
116
  /**
117
117
  * The oneharness session id this run belongs to (the history file's stem).
118
118
  */
@@ -412,7 +412,7 @@ export type HistoryRecord = {
412
412
  * run's single prompt).
413
413
  */
414
414
  prompt: string;
415
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
415
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
416
416
  /**
417
417
  * The oneharness session id this run belongs to (the history file's stem).
418
418
  */
@@ -539,7 +539,7 @@ export type HistoryRecord = {
539
539
  * run's single prompt).
540
540
  */
541
541
  prompt: string;
542
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
542
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
543
543
  /**
544
544
  * The oneharness session id this run belongs to (the history file's stem).
545
545
  */
@@ -666,7 +666,7 @@ export type HistoryRecord = {
666
666
  * run's single prompt).
667
667
  */
668
668
  prompt: string;
669
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
669
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
670
670
  /**
671
671
  * The oneharness session id this run belongs to (the history file's stem).
672
672
  */
@@ -793,7 +793,7 @@ export type HistoryRecord = {
793
793
  * run's single prompt).
794
794
  */
795
795
  prompt: string;
796
- schema_version: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
796
+ schema_version: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
797
797
  /**
798
798
  * The oneharness session id this run belongs to (the history file's stem).
799
799
  */
@@ -1260,13 +1260,13 @@ export type TimingSource = "provider_measured" | "stdout_observed";
1260
1260
  * harness's output. It is the single source for the `failure_kind` contract
1261
1261
  * value: serialized as the snake_case token a consumer reads in the report
1262
1262
  * (`auth`, `rate_limit`, `model_not_found`, `quota`, `session_not_found`,
1263
- * `tool_deferred`), so the wire shape is unchanged — modeling it as an enum
1263
+ * `tool_deferred`, `server_overloaded`), so the wire shape is unchanged — modeling it as an enum
1264
1264
  * keeps a misspelled or invalid kind unrepresentable and gives every
1265
1265
  * producer/consumer (classifier, `is_failure`, the fallback fall-through rule,
1266
1266
  * the report, history) one definition to share instead of scattered string
1267
1267
  * literals.
1268
1268
  */
1269
- export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch";
1269
+ export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded";
1270
1270
  /**
1271
1271
  * The outcome of attempting to run one harness.
1272
1272
  */
@@ -1297,7 +1297,7 @@ export type HistoryRecords = (({
1297
1297
  [k: string]: unknown;
1298
1298
  } | ({
1299
1299
  error: string;
1300
- schema_version?: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | undefined;
1300
+ schema_version?: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | undefined;
1301
1301
  [k: string]: unknown;
1302
1302
  } & ({
1303
1303
  status?: "nonzero" | "timeout" | "cancelled" | "spawn-error" | "skipped" | undefined;
@@ -1309,7 +1309,7 @@ export type HistoryRecords = (({
1309
1309
  work?: null | undefined;
1310
1310
  [k: string]: unknown;
1311
1311
  } | {
1312
- schema_version?: "1.7" | "1.8" | undefined;
1312
+ schema_version?: "1.7" | "1.8" | "1.9" | undefined;
1313
1313
  status?: "nonzero" | "timeout" | "cancelled" | undefined;
1314
1314
  work: "done" | "none";
1315
1315
  [k: string]: unknown;
@@ -1318,31 +1318,37 @@ export type HistoryRecords = (({
1318
1318
  [k: string]: unknown;
1319
1319
  } | {
1320
1320
  observed_model: string;
1321
- schema_version?: "1.8" | undefined;
1321
+ schema_version?: "1.8" | "1.9" | undefined;
1322
1322
  [k: string]: unknown;
1323
1323
  }) & ({
1324
1324
  status?: "ok" | "nonzero" | "timeout" | "spawn-error" | "skipped" | "planned" | undefined;
1325
1325
  [k: string]: unknown;
1326
1326
  } | {
1327
- schema_version?: "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | undefined;
1327
+ schema_version?: "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | undefined;
1328
1328
  [k: string]: unknown;
1329
1329
  }) & (({
1330
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | null;
1330
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded" | null;
1331
1331
  [k: string]: unknown;
1332
1332
  } | {
1333
- schema_version?: "1.5" | "1.6" | "1.7" | "1.8" | undefined;
1333
+ schema_version?: "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | undefined;
1334
1334
  [k: string]: unknown;
1335
1335
  }) & ({
1336
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "model_mismatch" | null;
1336
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "model_mismatch" | "server_overloaded" | null;
1337
1337
  [k: string]: unknown;
1338
1338
  } | {
1339
- schema_version?: "1.6" | "1.7" | "1.8" | undefined;
1339
+ schema_version?: "1.6" | "1.7" | "1.8" | "1.9" | undefined;
1340
1340
  [k: string]: unknown;
1341
1341
  }) & ({
1342
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | null;
1342
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "server_overloaded" | null;
1343
1343
  [k: string]: unknown;
1344
1344
  } | {
1345
- schema_version?: "1.8" | undefined;
1345
+ schema_version?: "1.8" | "1.9" | undefined;
1346
+ [k: string]: unknown;
1347
+ }) & ({
1348
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | null;
1349
+ [k: string]: unknown;
1350
+ } | {
1351
+ schema_version?: "1.9" | undefined;
1346
1352
  [k: string]: unknown;
1347
1353
  })) & HistoryRecord)[];
1348
1354
  /**
@@ -14,7 +14,7 @@ export type HistoryStreamEnvelope = {
14
14
  [k: string]: unknown;
15
15
  } | ({
16
16
  error: string;
17
- schema_version?: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | undefined;
17
+ schema_version?: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | undefined;
18
18
  [k: string]: unknown;
19
19
  } & ({
20
20
  status?: "nonzero" | "timeout" | "cancelled" | "spawn-error" | "skipped" | undefined;
@@ -26,7 +26,7 @@ export type HistoryStreamEnvelope = {
26
26
  work?: null | undefined;
27
27
  [k: string]: unknown;
28
28
  } | {
29
- schema_version?: "1.7" | "1.8" | undefined;
29
+ schema_version?: "1.7" | "1.8" | "1.9" | undefined;
30
30
  status?: "nonzero" | "timeout" | "cancelled" | undefined;
31
31
  work: "done" | "none";
32
32
  [k: string]: unknown;
@@ -35,31 +35,37 @@ export type HistoryStreamEnvelope = {
35
35
  [k: string]: unknown;
36
36
  } | {
37
37
  observed_model: string;
38
- schema_version?: "1.8" | undefined;
38
+ schema_version?: "1.8" | "1.9" | undefined;
39
39
  [k: string]: unknown;
40
40
  }) & ({
41
41
  status?: "ok" | "nonzero" | "timeout" | "spawn-error" | "skipped" | "planned" | undefined;
42
42
  [k: string]: unknown;
43
43
  } | {
44
- schema_version?: "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | undefined;
44
+ schema_version?: "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | undefined;
45
45
  [k: string]: unknown;
46
46
  }) & (({
47
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | null;
47
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded" | null;
48
48
  [k: string]: unknown;
49
49
  } | {
50
- schema_version?: "1.5" | "1.6" | "1.7" | "1.8" | undefined;
50
+ schema_version?: "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | undefined;
51
51
  [k: string]: unknown;
52
52
  }) & ({
53
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "model_mismatch" | null;
53
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "model_mismatch" | "server_overloaded" | null;
54
54
  [k: string]: unknown;
55
55
  } | {
56
- schema_version?: "1.6" | "1.7" | "1.8" | undefined;
56
+ schema_version?: "1.6" | "1.7" | "1.8" | "1.9" | undefined;
57
57
  [k: string]: unknown;
58
58
  }) & ({
59
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | null;
59
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "server_overloaded" | null;
60
60
  [k: string]: unknown;
61
61
  } | {
62
- schema_version?: "1.8" | undefined;
62
+ schema_version?: "1.8" | "1.9" | undefined;
63
+ [k: string]: unknown;
64
+ }) & ({
65
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | null;
66
+ [k: string]: unknown;
67
+ } | {
68
+ schema_version?: "1.9" | undefined;
63
69
  [k: string]: unknown;
64
70
  })) & HistoryRecord;
65
71
  type: "record";
@@ -183,7 +189,7 @@ export type HistoryRecord = {
183
189
  * run's single prompt).
184
190
  */
185
191
  prompt: string;
186
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
192
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
187
193
  /**
188
194
  * The oneharness session id this run belongs to (the history file's stem).
189
195
  */
@@ -483,7 +489,7 @@ export type HistoryRecord = {
483
489
  * run's single prompt).
484
490
  */
485
491
  prompt: string;
486
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
492
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
487
493
  /**
488
494
  * The oneharness session id this run belongs to (the history file's stem).
489
495
  */
@@ -610,7 +616,7 @@ export type HistoryRecord = {
610
616
  * run's single prompt).
611
617
  */
612
618
  prompt: string;
613
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
619
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
614
620
  /**
615
621
  * The oneharness session id this run belongs to (the history file's stem).
616
622
  */
@@ -737,7 +743,7 @@ export type HistoryRecord = {
737
743
  * run's single prompt).
738
744
  */
739
745
  prompt: string;
740
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
746
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
741
747
  /**
742
748
  * The oneharness session id this run belongs to (the history file's stem).
743
749
  */
@@ -864,7 +870,7 @@ export type HistoryRecord = {
864
870
  * run's single prompt).
865
871
  */
866
872
  prompt: string;
867
- schema_version: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
873
+ schema_version: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
868
874
  /**
869
875
  * The oneharness session id this run belongs to (the history file's stem).
870
876
  */
@@ -1331,13 +1337,13 @@ export type TimingSource = "provider_measured" | "stdout_observed";
1331
1337
  * harness's output. It is the single source for the `failure_kind` contract
1332
1338
  * value: serialized as the snake_case token a consumer reads in the report
1333
1339
  * (`auth`, `rate_limit`, `model_not_found`, `quota`, `session_not_found`,
1334
- * `tool_deferred`), so the wire shape is unchanged — modeling it as an enum
1340
+ * `tool_deferred`, `server_overloaded`), so the wire shape is unchanged — modeling it as an enum
1335
1341
  * keeps a misspelled or invalid kind unrepresentable and gives every
1336
1342
  * producer/consumer (classifier, `is_failure`, the fallback fall-through rule,
1337
1343
  * the report, history) one definition to share instead of scattered string
1338
1344
  * literals.
1339
1345
  */
1340
- export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch";
1346
+ export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded";
1341
1347
  /**
1342
1348
  * The outcome of attempting to run one harness.
1343
1349
  */
@@ -1368,7 +1374,7 @@ export type HistoryEventLine = {
1368
1374
  harness: string;
1369
1375
  harness_id?: string | null | undefined;
1370
1376
  run_id: string;
1371
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
1377
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
1372
1378
  variant?: string | null | undefined;
1373
1379
  [k: string]: unknown;
1374
1380
  } | {
@@ -8,7 +8,7 @@ export type HistoryRecord = ({
8
8
  [k: string]: unknown;
9
9
  } | ({
10
10
  error: string;
11
- schema_version?: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | undefined;
11
+ schema_version?: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | undefined;
12
12
  [k: string]: unknown;
13
13
  } & ({
14
14
  status?: "nonzero" | "timeout" | "cancelled" | "spawn-error" | "skipped" | undefined;
@@ -20,7 +20,7 @@ export type HistoryRecord = ({
20
20
  work?: null | undefined;
21
21
  [k: string]: unknown;
22
22
  } | {
23
- schema_version?: "1.7" | "1.8" | undefined;
23
+ schema_version?: "1.7" | "1.8" | "1.9" | undefined;
24
24
  status?: "nonzero" | "timeout" | "cancelled" | undefined;
25
25
  work: "done" | "none";
26
26
  [k: string]: unknown;
@@ -29,31 +29,37 @@ export type HistoryRecord = ({
29
29
  [k: string]: unknown;
30
30
  } | {
31
31
  observed_model: string;
32
- schema_version?: "1.8" | undefined;
32
+ schema_version?: "1.8" | "1.9" | undefined;
33
33
  [k: string]: unknown;
34
34
  }) & ({
35
35
  status?: "ok" | "nonzero" | "timeout" | "spawn-error" | "skipped" | "planned" | undefined;
36
36
  [k: string]: unknown;
37
37
  } | {
38
- schema_version?: "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | undefined;
38
+ schema_version?: "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | undefined;
39
39
  [k: string]: unknown;
40
40
  }) & (({
41
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | null;
41
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded" | null;
42
42
  [k: string]: unknown;
43
43
  } | {
44
- schema_version?: "1.5" | "1.6" | "1.7" | "1.8" | undefined;
44
+ schema_version?: "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | undefined;
45
45
  [k: string]: unknown;
46
46
  }) & ({
47
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "model_mismatch" | null;
47
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "model_mismatch" | "server_overloaded" | null;
48
48
  [k: string]: unknown;
49
49
  } | {
50
- schema_version?: "1.6" | "1.7" | "1.8" | undefined;
50
+ schema_version?: "1.6" | "1.7" | "1.8" | "1.9" | undefined;
51
51
  [k: string]: unknown;
52
52
  }) & ({
53
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | null;
53
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "server_overloaded" | null;
54
54
  [k: string]: unknown;
55
55
  } | {
56
- schema_version?: "1.8" | undefined;
56
+ schema_version?: "1.8" | "1.9" | undefined;
57
+ [k: string]: unknown;
58
+ }) & ({
59
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | null;
60
+ [k: string]: unknown;
61
+ } | {
62
+ schema_version?: "1.9" | undefined;
57
63
  [k: string]: unknown;
58
64
  })) & ({
59
65
  duration_ms: number;
@@ -169,7 +175,7 @@ export type HistoryRecord = ({
169
175
  * run's single prompt).
170
176
  */
171
177
  prompt: string;
172
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
178
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
173
179
  /**
174
180
  * The oneharness session id this run belongs to (the history file's stem).
175
181
  */
@@ -469,7 +475,7 @@ export type HistoryRecord = ({
469
475
  * run's single prompt).
470
476
  */
471
477
  prompt: string;
472
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
478
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
473
479
  /**
474
480
  * The oneharness session id this run belongs to (the history file's stem).
475
481
  */
@@ -596,7 +602,7 @@ export type HistoryRecord = ({
596
602
  * run's single prompt).
597
603
  */
598
604
  prompt: string;
599
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
605
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
600
606
  /**
601
607
  * The oneharness session id this run belongs to (the history file's stem).
602
608
  */
@@ -723,7 +729,7 @@ export type HistoryRecord = ({
723
729
  * run's single prompt).
724
730
  */
725
731
  prompt: string;
726
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
732
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
727
733
  /**
728
734
  * The oneharness session id this run belongs to (the history file's stem).
729
735
  */
@@ -850,7 +856,7 @@ export type HistoryRecord = ({
850
856
  * run's single prompt).
851
857
  */
852
858
  prompt: string;
853
- schema_version: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
859
+ schema_version: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
854
860
  /**
855
861
  * The oneharness session id this run belongs to (the history file's stem).
856
862
  */
@@ -1317,13 +1323,13 @@ export type TimingSource = "provider_measured" | "stdout_observed";
1317
1323
  * harness's output. It is the single source for the `failure_kind` contract
1318
1324
  * value: serialized as the snake_case token a consumer reads in the report
1319
1325
  * (`auth`, `rate_limit`, `model_not_found`, `quota`, `session_not_found`,
1320
- * `tool_deferred`), so the wire shape is unchanged — modeling it as an enum
1326
+ * `tool_deferred`, `server_overloaded`), so the wire shape is unchanged — modeling it as an enum
1321
1327
  * keeps a misspelled or invalid kind unrepresentable and gives every
1322
1328
  * producer/consumer (classifier, `is_failure`, the fallback fall-through rule,
1323
1329
  * the report, history) one definition to share instead of scattered string
1324
1330
  * literals.
1325
1331
  */
1326
- export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch";
1332
+ export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded";
1327
1333
  /**
1328
1334
  * The outcome of attempting to run one harness.
1329
1335
  */
@@ -130,6 +130,10 @@ export interface RunOptions {
130
130
  * Max retries when a response fails schema validation.
131
131
  */
132
132
  schemaMaxRetries?: number | undefined;
133
+ /**
134
+ * Max retries for a zero-work Codex server-overloaded refusal.
135
+ */
136
+ serverOverloadedMaxRetries?: number | undefined;
133
137
  session?: string | undefined;
134
138
  /**
135
139
  * Directory the `session` store lives in.