@oneharness/sdk 0.11.4 → 0.12.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.
@@ -69,7 +69,10 @@ export type HistoryRecord = {
69
69
  history_id: string;
70
70
  labels?: HistoryLabels | undefined;
71
71
  /**
72
- * The effective top-level model for the run, if any.
72
+ * The model this run **requested** — the value oneharness put on the
73
+ * harness's model flag or protocol frame — if any. Copied from
74
+ * [`RunResult::model`], so it keeps meaning the requested model even where
75
+ * `observed_model` below is present.
73
76
  */
74
77
  model: string | null;
75
78
  model_ms: number;
@@ -78,6 +81,22 @@ export type HistoryRecord = {
78
81
  * every record so a reader can resolve a session by name from any line.
79
82
  */
80
83
  name: string;
84
+ /**
85
+ * The model the harness **itself** reported the conversation would run
86
+ * under, read off its own protocol before any token was spent — for codex
87
+ * over `app-server`, `result.model` of the `thread/start` /
88
+ * `thread/resume` response. Copied from [`RunResult::observed_model`]:
89
+ * never inferred and never copied from `model`, and omitted on the wire on
90
+ * every path that reports none.
91
+ *
92
+ * On a completed app-server turn the two agree, because a turn whose
93
+ * reported model differed from the requested one was refused before it
94
+ * ran (`model_mismatch`) — so a completed record's `model` is what codex
95
+ * ran, and the record can no longer say one model while another was
96
+ * billed. They differ only on such a refused record, and where no model
97
+ * was requested at all. Gated to [`FIRST_MODEL_OBSERVATION_SCHEMA_VERSION`].
98
+ */
99
+ observed_model?: string | null | undefined;
81
100
  observed_tool_ms?: never | undefined;
82
101
  /**
83
102
  * The normalized approval mode requested for the run.
@@ -93,7 +112,7 @@ export type HistoryRecord = {
93
112
  * run's single prompt).
94
113
  */
95
114
  prompt: string;
96
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7";
115
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
97
116
  /**
98
117
  * The oneharness session id this run belongs to (the history file's stem).
99
118
  */
@@ -211,7 +230,10 @@ export type HistoryRecord = {
211
230
  history_id: string;
212
231
  labels?: HistoryLabels1 | undefined;
213
232
  /**
214
- * The effective top-level model for the run, if any.
233
+ * The model this run **requested** — the value oneharness put on the
234
+ * harness's model flag or protocol frame — if any. Copied from
235
+ * [`RunResult::model`], so it keeps meaning the requested model even where
236
+ * `observed_model` below is present.
215
237
  */
216
238
  model: string | null;
217
239
  model_ms: number;
@@ -220,6 +242,22 @@ export type HistoryRecord = {
220
242
  * every record so a reader can resolve a session by name from any line.
221
243
  */
222
244
  name: string;
245
+ /**
246
+ * The model the harness **itself** reported the conversation would run
247
+ * under, read off its own protocol before any token was spent — for codex
248
+ * over `app-server`, `result.model` of the `thread/start` /
249
+ * `thread/resume` response. Copied from [`RunResult::observed_model`]:
250
+ * never inferred and never copied from `model`, and omitted on the wire on
251
+ * every path that reports none.
252
+ *
253
+ * On a completed app-server turn the two agree, because a turn whose
254
+ * reported model differed from the requested one was refused before it
255
+ * ran (`model_mismatch`) — so a completed record's `model` is what codex
256
+ * ran, and the record can no longer say one model while another was
257
+ * billed. They differ only on such a refused record, and where no model
258
+ * was requested at all. Gated to [`FIRST_MODEL_OBSERVATION_SCHEMA_VERSION`].
259
+ */
260
+ observed_model?: string | null | undefined;
223
261
  observed_tool_ms?: never | undefined;
224
262
  /**
225
263
  * The normalized approval mode requested for the run.
@@ -331,7 +369,10 @@ export type HistoryRecord = {
331
369
  history_id: string;
332
370
  labels?: HistoryLabels2 | undefined;
333
371
  /**
334
- * The effective top-level model for the run, if any.
372
+ * The model this run **requested** — the value oneharness put on the
373
+ * harness's model flag or protocol frame — if any. Copied from
374
+ * [`RunResult::model`], so it keeps meaning the requested model even where
375
+ * `observed_model` below is present.
335
376
  */
336
377
  model: string | null;
337
378
  model_ms?: never | undefined;
@@ -340,6 +381,22 @@ export type HistoryRecord = {
340
381
  * every record so a reader can resolve a session by name from any line.
341
382
  */
342
383
  name: string;
384
+ /**
385
+ * The model the harness **itself** reported the conversation would run
386
+ * under, read off its own protocol before any token was spent — for codex
387
+ * over `app-server`, `result.model` of the `thread/start` /
388
+ * `thread/resume` response. Copied from [`RunResult::observed_model`]:
389
+ * never inferred and never copied from `model`, and omitted on the wire on
390
+ * every path that reports none.
391
+ *
392
+ * On a completed app-server turn the two agree, because a turn whose
393
+ * reported model differed from the requested one was refused before it
394
+ * ran (`model_mismatch`) — so a completed record's `model` is what codex
395
+ * ran, and the record can no longer say one model while another was
396
+ * billed. They differ only on such a refused record, and where no model
397
+ * was requested at all. Gated to [`FIRST_MODEL_OBSERVATION_SCHEMA_VERSION`].
398
+ */
399
+ observed_model?: string | null | undefined;
343
400
  observed_tool_ms?: never | undefined;
344
401
  /**
345
402
  * The normalized approval mode requested for the run.
@@ -355,7 +412,7 @@ export type HistoryRecord = {
355
412
  * run's single prompt).
356
413
  */
357
414
  prompt: string;
358
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7";
415
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
359
416
  /**
360
417
  * The oneharness session id this run belongs to (the history file's stem).
361
418
  */
@@ -439,7 +496,10 @@ export type HistoryRecord = {
439
496
  history_id: string;
440
497
  labels?: HistoryLabels3 | undefined;
441
498
  /**
442
- * The effective top-level model for the run, if any.
499
+ * The model this run **requested** — the value oneharness put on the
500
+ * harness's model flag or protocol frame — if any. Copied from
501
+ * [`RunResult::model`], so it keeps meaning the requested model even where
502
+ * `observed_model` below is present.
443
503
  */
444
504
  model: string | null;
445
505
  model_ms?: never | undefined;
@@ -448,6 +508,22 @@ export type HistoryRecord = {
448
508
  * every record so a reader can resolve a session by name from any line.
449
509
  */
450
510
  name: string;
511
+ /**
512
+ * The model the harness **itself** reported the conversation would run
513
+ * under, read off its own protocol before any token was spent — for codex
514
+ * over `app-server`, `result.model` of the `thread/start` /
515
+ * `thread/resume` response. Copied from [`RunResult::observed_model`]:
516
+ * never inferred and never copied from `model`, and omitted on the wire on
517
+ * every path that reports none.
518
+ *
519
+ * On a completed app-server turn the two agree, because a turn whose
520
+ * reported model differed from the requested one was refused before it
521
+ * ran (`model_mismatch`) — so a completed record's `model` is what codex
522
+ * ran, and the record can no longer say one model while another was
523
+ * billed. They differ only on such a refused record, and where no model
524
+ * was requested at all. Gated to [`FIRST_MODEL_OBSERVATION_SCHEMA_VERSION`].
525
+ */
526
+ observed_model?: string | null | undefined;
451
527
  observed_tool_ms: number;
452
528
  /**
453
529
  * The normalized approval mode requested for the run.
@@ -463,7 +539,7 @@ export type HistoryRecord = {
463
539
  * run's single prompt).
464
540
  */
465
541
  prompt: string;
466
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7";
542
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
467
543
  /**
468
544
  * The oneharness session id this run belongs to (the history file's stem).
469
545
  */
@@ -547,7 +623,10 @@ export type HistoryRecord = {
547
623
  history_id: string;
548
624
  labels?: HistoryLabels4 | undefined;
549
625
  /**
550
- * The effective top-level model for the run, if any.
626
+ * The model this run **requested** — the value oneharness put on the
627
+ * harness's model flag or protocol frame — if any. Copied from
628
+ * [`RunResult::model`], so it keeps meaning the requested model even where
629
+ * `observed_model` below is present.
551
630
  */
552
631
  model: string | null;
553
632
  model_ms?: never | undefined;
@@ -556,6 +635,22 @@ export type HistoryRecord = {
556
635
  * every record so a reader can resolve a session by name from any line.
557
636
  */
558
637
  name: string;
638
+ /**
639
+ * The model the harness **itself** reported the conversation would run
640
+ * under, read off its own protocol before any token was spent — for codex
641
+ * over `app-server`, `result.model` of the `thread/start` /
642
+ * `thread/resume` response. Copied from [`RunResult::observed_model`]:
643
+ * never inferred and never copied from `model`, and omitted on the wire on
644
+ * every path that reports none.
645
+ *
646
+ * On a completed app-server turn the two agree, because a turn whose
647
+ * reported model differed from the requested one was refused before it
648
+ * ran (`model_mismatch`) — so a completed record's `model` is what codex
649
+ * ran, and the record can no longer say one model while another was
650
+ * billed. They differ only on such a refused record, and where no model
651
+ * was requested at all. Gated to [`FIRST_MODEL_OBSERVATION_SCHEMA_VERSION`].
652
+ */
653
+ observed_model?: string | null | undefined;
559
654
  observed_tool_ms?: never | undefined;
560
655
  /**
561
656
  * The normalized approval mode requested for the run.
@@ -571,7 +666,7 @@ export type HistoryRecord = {
571
666
  * run's single prompt).
572
667
  */
573
668
  prompt: string;
574
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7";
669
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
575
670
  /**
576
671
  * The oneharness session id this run belongs to (the history file's stem).
577
672
  */
@@ -655,7 +750,10 @@ export type HistoryRecord = {
655
750
  history_id: string;
656
751
  labels?: HistoryLabels5 | undefined;
657
752
  /**
658
- * The effective top-level model for the run, if any.
753
+ * The model this run **requested** — the value oneharness put on the
754
+ * harness's model flag or protocol frame — if any. Copied from
755
+ * [`RunResult::model`], so it keeps meaning the requested model even where
756
+ * `observed_model` below is present.
659
757
  */
660
758
  model: string | null;
661
759
  model_ms?: never | undefined;
@@ -664,6 +762,22 @@ export type HistoryRecord = {
664
762
  * every record so a reader can resolve a session by name from any line.
665
763
  */
666
764
  name: string;
765
+ /**
766
+ * The model the harness **itself** reported the conversation would run
767
+ * under, read off its own protocol before any token was spent — for codex
768
+ * over `app-server`, `result.model` of the `thread/start` /
769
+ * `thread/resume` response. Copied from [`RunResult::observed_model`]:
770
+ * never inferred and never copied from `model`, and omitted on the wire on
771
+ * every path that reports none.
772
+ *
773
+ * On a completed app-server turn the two agree, because a turn whose
774
+ * reported model differed from the requested one was refused before it
775
+ * ran (`model_mismatch`) — so a completed record's `model` is what codex
776
+ * ran, and the record can no longer say one model while another was
777
+ * billed. They differ only on such a refused record, and where no model
778
+ * was requested at all. Gated to [`FIRST_MODEL_OBSERVATION_SCHEMA_VERSION`].
779
+ */
780
+ observed_model?: string | null | undefined;
667
781
  observed_tool_ms?: never | undefined;
668
782
  /**
669
783
  * The normalized approval mode requested for the run.
@@ -679,7 +793,7 @@ export type HistoryRecord = {
679
793
  * run's single prompt).
680
794
  */
681
795
  prompt: string;
682
- schema_version: "1.3" | "1.4" | "1.5" | "1.6" | "1.7";
796
+ schema_version: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
683
797
  /**
684
798
  * The oneharness session id this run belongs to (the history file's stem).
685
799
  */
@@ -766,7 +880,10 @@ export type HistoryRecord = {
766
880
  history_id: string;
767
881
  labels?: HistoryLabels6 | undefined;
768
882
  /**
769
- * The effective top-level model for the run, if any.
883
+ * The model this run **requested** — the value oneharness put on the
884
+ * harness's model flag or protocol frame — if any. Copied from
885
+ * [`RunResult::model`], so it keeps meaning the requested model even where
886
+ * `observed_model` below is present.
770
887
  */
771
888
  model: string | null;
772
889
  model_ms?: never | undefined;
@@ -775,6 +892,22 @@ export type HistoryRecord = {
775
892
  * every record so a reader can resolve a session by name from any line.
776
893
  */
777
894
  name: string;
895
+ /**
896
+ * The model the harness **itself** reported the conversation would run
897
+ * under, read off its own protocol before any token was spent — for codex
898
+ * over `app-server`, `result.model` of the `thread/start` /
899
+ * `thread/resume` response. Copied from [`RunResult::observed_model`]:
900
+ * never inferred and never copied from `model`, and omitted on the wire on
901
+ * every path that reports none.
902
+ *
903
+ * On a completed app-server turn the two agree, because a turn whose
904
+ * reported model differed from the requested one was refused before it
905
+ * ran (`model_mismatch`) — so a completed record's `model` is what codex
906
+ * ran, and the record can no longer say one model while another was
907
+ * billed. They differ only on such a refused record, and where no model
908
+ * was requested at all. Gated to [`FIRST_MODEL_OBSERVATION_SCHEMA_VERSION`].
909
+ */
910
+ observed_model?: string | null | undefined;
778
911
  observed_tool_ms?: never | undefined;
779
912
  /**
780
913
  * The normalized approval mode requested for the run.
@@ -889,7 +1022,10 @@ export type HistoryRecord = {
889
1022
  history_id: string;
890
1023
  labels?: HistoryLabels7 | undefined;
891
1024
  /**
892
- * The effective top-level model for the run, if any.
1025
+ * The model this run **requested** — the value oneharness put on the
1026
+ * harness's model flag or protocol frame — if any. Copied from
1027
+ * [`RunResult::model`], so it keeps meaning the requested model even where
1028
+ * `observed_model` below is present.
893
1029
  */
894
1030
  model: string | null;
895
1031
  model_ms?: never | undefined;
@@ -898,6 +1034,22 @@ export type HistoryRecord = {
898
1034
  * every record so a reader can resolve a session by name from any line.
899
1035
  */
900
1036
  name: string;
1037
+ /**
1038
+ * The model the harness **itself** reported the conversation would run
1039
+ * under, read off its own protocol before any token was spent — for codex
1040
+ * over `app-server`, `result.model` of the `thread/start` /
1041
+ * `thread/resume` response. Copied from [`RunResult::observed_model`]:
1042
+ * never inferred and never copied from `model`, and omitted on the wire on
1043
+ * every path that reports none.
1044
+ *
1045
+ * On a completed app-server turn the two agree, because a turn whose
1046
+ * reported model differed from the requested one was refused before it
1047
+ * ran (`model_mismatch`) — so a completed record's `model` is what codex
1048
+ * ran, and the record can no longer say one model while another was
1049
+ * billed. They differ only on such a refused record, and where no model
1050
+ * was requested at all. Gated to [`FIRST_MODEL_OBSERVATION_SCHEMA_VERSION`].
1051
+ */
1052
+ observed_model?: string | null | undefined;
901
1053
  observed_tool_ms?: never | undefined;
902
1054
  /**
903
1055
  * The normalized approval mode requested for the run.
@@ -1000,7 +1152,10 @@ export type HistoryRecord = {
1000
1152
  history_id: string;
1001
1153
  labels?: HistoryLabels8 | undefined;
1002
1154
  /**
1003
- * The effective top-level model for the run, if any.
1155
+ * The model this run **requested** — the value oneharness put on the
1156
+ * harness's model flag or protocol frame — if any. Copied from
1157
+ * [`RunResult::model`], so it keeps meaning the requested model even where
1158
+ * `observed_model` below is present.
1004
1159
  */
1005
1160
  model: string | null;
1006
1161
  model_ms?: number | null | undefined;
@@ -1009,6 +1164,22 @@ export type HistoryRecord = {
1009
1164
  * every record so a reader can resolve a session by name from any line.
1010
1165
  */
1011
1166
  name: string;
1167
+ /**
1168
+ * The model the harness **itself** reported the conversation would run
1169
+ * under, read off its own protocol before any token was spent — for codex
1170
+ * over `app-server`, `result.model` of the `thread/start` /
1171
+ * `thread/resume` response. Copied from [`RunResult::observed_model`]:
1172
+ * never inferred and never copied from `model`, and omitted on the wire on
1173
+ * every path that reports none.
1174
+ *
1175
+ * On a completed app-server turn the two agree, because a turn whose
1176
+ * reported model differed from the requested one was refused before it
1177
+ * ran (`model_mismatch`) — so a completed record's `model` is what codex
1178
+ * ran, and the record can no longer say one model while another was
1179
+ * billed. They differ only on such a refused record, and where no model
1180
+ * was requested at all. Gated to [`FIRST_MODEL_OBSERVATION_SCHEMA_VERSION`].
1181
+ */
1182
+ observed_model?: string | null | undefined;
1012
1183
  /**
1013
1184
  * Union of tool intervals observed at the stdout pipe. Unlike `tool_ms`,
1014
1185
  * this is not provider-measured and has no model-latency counterpart.
@@ -1095,7 +1266,7 @@ export type TimingSource = "provider_measured" | "stdout_observed";
1095
1266
  * the report, history) one definition to share instead of scattered string
1096
1267
  * literals.
1097
1268
  */
1098
- export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large";
1269
+ export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch";
1099
1270
  /**
1100
1271
  * The outcome of attempting to run one harness.
1101
1272
  */
@@ -1125,7 +1296,7 @@ export type HistoryRecords = (({
1125
1296
  [k: string]: unknown;
1126
1297
  } | ({
1127
1298
  error: string;
1128
- schema_version?: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | undefined;
1299
+ schema_version?: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | undefined;
1129
1300
  [k: string]: unknown;
1130
1301
  } & ({
1131
1302
  status?: "nonzero" | "timeout" | "cancelled" | "spawn-error" | "skipped" | undefined;
@@ -1137,27 +1308,40 @@ export type HistoryRecords = (({
1137
1308
  work?: null | undefined;
1138
1309
  [k: string]: unknown;
1139
1310
  } | {
1140
- schema_version?: "1.7" | undefined;
1311
+ schema_version?: "1.7" | "1.8" | undefined;
1141
1312
  status?: "nonzero" | "timeout" | "cancelled" | undefined;
1142
1313
  work: "done" | "none";
1143
1314
  [k: string]: unknown;
1315
+ }) & ({
1316
+ observed_model?: null | undefined;
1317
+ [k: string]: unknown;
1318
+ } | {
1319
+ observed_model: string;
1320
+ schema_version?: "1.8" | undefined;
1321
+ [k: string]: unknown;
1144
1322
  }) & ({
1145
1323
  status?: "ok" | "nonzero" | "timeout" | "spawn-error" | "skipped" | "planned" | undefined;
1146
1324
  [k: string]: unknown;
1147
1325
  } | {
1148
- schema_version?: "1.4" | "1.5" | "1.6" | "1.7" | undefined;
1326
+ schema_version?: "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | undefined;
1149
1327
  [k: string]: unknown;
1150
1328
  }) & (({
1151
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "tool_deferred" | "untrusted_directory" | "input_too_large" | null;
1329
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | null;
1330
+ [k: string]: unknown;
1331
+ } | {
1332
+ schema_version?: "1.5" | "1.6" | "1.7" | "1.8" | undefined;
1333
+ [k: string]: unknown;
1334
+ }) & ({
1335
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "model_mismatch" | null;
1152
1336
  [k: string]: unknown;
1153
1337
  } | {
1154
- schema_version?: "1.5" | "1.6" | "1.7" | undefined;
1338
+ schema_version?: "1.6" | "1.7" | "1.8" | undefined;
1155
1339
  [k: string]: unknown;
1156
1340
  }) & ({
1157
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | null;
1341
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | null;
1158
1342
  [k: string]: unknown;
1159
1343
  } | {
1160
- schema_version?: "1.6" | "1.7" | undefined;
1344
+ schema_version?: "1.8" | undefined;
1161
1345
  [k: string]: unknown;
1162
1346
  })) & HistoryRecord)[];
1163
1347
  /**