@skj1724/oh-my-opencode 3.19.7 → 3.19.8

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/cli/index.js CHANGED
@@ -8467,7 +8467,7 @@ var import_picocolors2 = __toESM(require_picocolors(), 1);
8467
8467
  // package.json
8468
8468
  var package_default = {
8469
8469
  name: "@skj1724/oh-my-opencode",
8470
- version: "3.19.7",
8470
+ version: "3.19.8",
8471
8471
  description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
8472
8472
  main: "dist/index.js",
8473
8473
  types: "dist/index.d.ts",
@@ -25014,6 +25014,23 @@ var BuiltinCommandNameSchema = exports_external.enum([
25014
25014
  "init-deep",
25015
25015
  "start-work"
25016
25016
  ]);
25017
+ var ProviderModelStringSchema = exports_external.string().refine((value) => {
25018
+ const separatorIndex = value.indexOf("/");
25019
+ return separatorIndex > 0 && separatorIndex < value.length - 1;
25020
+ }, "Expected provider/model format");
25021
+ var NonEmptyStringSchema = exports_external.string().min(1);
25022
+ var FallbackModelEntrySchema = exports_external.union([
25023
+ exports_external.object({
25024
+ model: ProviderModelStringSchema,
25025
+ variant: exports_external.string().optional()
25026
+ }).strict(),
25027
+ exports_external.object({
25028
+ providerID: NonEmptyStringSchema,
25029
+ modelID: NonEmptyStringSchema,
25030
+ variant: exports_external.string().optional()
25031
+ }).strict()
25032
+ ]);
25033
+ var FallbackModelsSchema = exports_external.array(FallbackModelEntrySchema);
25017
25034
  var AgentOverrideConfigSchema = exports_external.object({
25018
25035
  model: exports_external.string().optional(),
25019
25036
  variant: exports_external.string().optional(),
@@ -25028,7 +25045,8 @@ var AgentOverrideConfigSchema = exports_external.object({
25028
25045
  description: exports_external.string().optional(),
25029
25046
  mode: exports_external.enum(["subagent", "primary", "all"]).optional(),
25030
25047
  color: exports_external.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
25031
- permission: AgentPermissionSchema.optional()
25048
+ permission: AgentPermissionSchema.optional(),
25049
+ fallback_models: FallbackModelsSchema.optional()
25032
25050
  });
25033
25051
  var AgentOverridesSchema = exports_external.object({
25034
25052
  build: AgentOverrideConfigSchema.optional(),
@@ -25064,6 +25082,7 @@ var CategoryConfigSchema = exports_external.object({
25064
25082
  description: exports_external.string().optional(),
25065
25083
  model: exports_external.string().optional(),
25066
25084
  variant: exports_external.string().optional(),
25085
+ fallback_models: FallbackModelsSchema.optional(),
25067
25086
  temperature: exports_external.number().min(0).max(2).optional(),
25068
25087
  top_p: exports_external.number().min(0).max(1).optional(),
25069
25088
  maxTokens: exports_external.number().optional(),
@@ -1,2 +1,2 @@
1
- export { OhMyOpenCodeConfigSchema, AgentOverrideConfigSchema, AgentOverridesSchema, McpNameSchema, AgentNameSchema, HookNameSchema, BuiltinCommandNameSchema, SisyphusAgentConfigSchema, ExperimentalConfigSchema, RalphLoopConfigSchema, } from "./schema";
2
- export type { OhMyOpenCodeConfig, AgentOverrideConfig, AgentOverrides, McpName, AgentName, HookName, BuiltinCommandName, SisyphusAgentConfig, ExperimentalConfig, DynamicContextPruningConfig, RalphLoopConfig, } from "./schema";
1
+ export { OhMyOpenCodeConfigSchema, AgentOverrideConfigSchema, AgentOverridesSchema, McpNameSchema, AgentNameSchema, HookNameSchema, BuiltinCommandNameSchema, SisyphusAgentConfigSchema, ExperimentalConfigSchema, RalphLoopConfigSchema, FallbackModelEntrySchema, } from "./schema";
2
+ export type { OhMyOpenCodeConfig, AgentOverrideConfig, AgentOverrides, McpName, AgentName, HookName, BuiltinCommandName, SisyphusAgentConfig, ExperimentalConfig, DynamicContextPruningConfig, RalphLoopConfig, RuntimeFallbackConfig, FallbackModelEntry, } from "./schema";
@@ -79,6 +79,14 @@ export declare const BuiltinCommandNameSchema: z.ZodEnum<{
79
79
  "start-work": "start-work";
80
80
  "init-deep": "init-deep";
81
81
  }>;
82
+ export declare const FallbackModelEntrySchema: z.ZodUnion<readonly [z.ZodObject<{
83
+ model: z.ZodString;
84
+ variant: z.ZodOptional<z.ZodString>;
85
+ }, z.core.$strict>, z.ZodObject<{
86
+ providerID: z.ZodString;
87
+ modelID: z.ZodString;
88
+ variant: z.ZodOptional<z.ZodString>;
89
+ }, z.core.$strict>]>;
82
90
  export declare const AgentOverrideConfigSchema: z.ZodObject<{
83
91
  model: z.ZodOptional<z.ZodString>;
84
92
  variant: z.ZodOptional<z.ZodString>;
@@ -128,6 +136,14 @@ export declare const AgentOverrideConfigSchema: z.ZodObject<{
128
136
  ask: "ask";
129
137
  }>>;
130
138
  }, z.core.$strip>>;
139
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
140
+ model: z.ZodString;
141
+ variant: z.ZodOptional<z.ZodString>;
142
+ }, z.core.$strict>, z.ZodObject<{
143
+ providerID: z.ZodString;
144
+ modelID: z.ZodString;
145
+ variant: z.ZodOptional<z.ZodString>;
146
+ }, z.core.$strict>]>>>;
131
147
  }, z.core.$strip>;
132
148
  export declare const AgentOverridesSchema: z.ZodObject<{
133
149
  build: z.ZodOptional<z.ZodObject<{
@@ -179,6 +195,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
179
195
  ask: "ask";
180
196
  }>>;
181
197
  }, z.core.$strip>>;
198
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
199
+ model: z.ZodString;
200
+ variant: z.ZodOptional<z.ZodString>;
201
+ }, z.core.$strict>, z.ZodObject<{
202
+ providerID: z.ZodString;
203
+ modelID: z.ZodString;
204
+ variant: z.ZodOptional<z.ZodString>;
205
+ }, z.core.$strict>]>>>;
182
206
  }, z.core.$strip>>;
183
207
  plan: z.ZodOptional<z.ZodObject<{
184
208
  model: z.ZodOptional<z.ZodString>;
@@ -229,6 +253,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
229
253
  ask: "ask";
230
254
  }>>;
231
255
  }, z.core.$strip>>;
256
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
257
+ model: z.ZodString;
258
+ variant: z.ZodOptional<z.ZodString>;
259
+ }, z.core.$strict>, z.ZodObject<{
260
+ providerID: z.ZodString;
261
+ modelID: z.ZodString;
262
+ variant: z.ZodOptional<z.ZodString>;
263
+ }, z.core.$strict>]>>>;
232
264
  }, z.core.$strip>>;
233
265
  sisyphus: z.ZodOptional<z.ZodObject<{
234
266
  model: z.ZodOptional<z.ZodString>;
@@ -279,6 +311,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
279
311
  ask: "ask";
280
312
  }>>;
281
313
  }, z.core.$strip>>;
314
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
315
+ model: z.ZodString;
316
+ variant: z.ZodOptional<z.ZodString>;
317
+ }, z.core.$strict>, z.ZodObject<{
318
+ providerID: z.ZodString;
319
+ modelID: z.ZodString;
320
+ variant: z.ZodOptional<z.ZodString>;
321
+ }, z.core.$strict>]>>>;
282
322
  }, z.core.$strip>>;
283
323
  "sisyphus-junior": z.ZodOptional<z.ZodObject<{
284
324
  model: z.ZodOptional<z.ZodString>;
@@ -329,6 +369,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
329
369
  ask: "ask";
330
370
  }>>;
331
371
  }, z.core.$strip>>;
372
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
373
+ model: z.ZodString;
374
+ variant: z.ZodOptional<z.ZodString>;
375
+ }, z.core.$strict>, z.ZodObject<{
376
+ providerID: z.ZodString;
377
+ modelID: z.ZodString;
378
+ variant: z.ZodOptional<z.ZodString>;
379
+ }, z.core.$strict>]>>>;
332
380
  }, z.core.$strip>>;
333
381
  "OpenCode-Builder": z.ZodOptional<z.ZodObject<{
334
382
  model: z.ZodOptional<z.ZodString>;
@@ -379,6 +427,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
379
427
  ask: "ask";
380
428
  }>>;
381
429
  }, z.core.$strip>>;
430
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
431
+ model: z.ZodString;
432
+ variant: z.ZodOptional<z.ZodString>;
433
+ }, z.core.$strict>, z.ZodObject<{
434
+ providerID: z.ZodString;
435
+ modelID: z.ZodString;
436
+ variant: z.ZodOptional<z.ZodString>;
437
+ }, z.core.$strict>]>>>;
382
438
  }, z.core.$strip>>;
383
439
  prometheus: z.ZodOptional<z.ZodObject<{
384
440
  model: z.ZodOptional<z.ZodString>;
@@ -429,6 +485,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
429
485
  ask: "ask";
430
486
  }>>;
431
487
  }, z.core.$strip>>;
488
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
489
+ model: z.ZodString;
490
+ variant: z.ZodOptional<z.ZodString>;
491
+ }, z.core.$strict>, z.ZodObject<{
492
+ providerID: z.ZodString;
493
+ modelID: z.ZodString;
494
+ variant: z.ZodOptional<z.ZodString>;
495
+ }, z.core.$strict>]>>>;
432
496
  }, z.core.$strip>>;
433
497
  metis: z.ZodOptional<z.ZodObject<{
434
498
  model: z.ZodOptional<z.ZodString>;
@@ -479,6 +543,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
479
543
  ask: "ask";
480
544
  }>>;
481
545
  }, z.core.$strip>>;
546
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
547
+ model: z.ZodString;
548
+ variant: z.ZodOptional<z.ZodString>;
549
+ }, z.core.$strict>, z.ZodObject<{
550
+ providerID: z.ZodString;
551
+ modelID: z.ZodString;
552
+ variant: z.ZodOptional<z.ZodString>;
553
+ }, z.core.$strict>]>>>;
482
554
  }, z.core.$strip>>;
483
555
  momus: z.ZodOptional<z.ZodObject<{
484
556
  model: z.ZodOptional<z.ZodString>;
@@ -529,6 +601,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
529
601
  ask: "ask";
530
602
  }>>;
531
603
  }, z.core.$strip>>;
604
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
605
+ model: z.ZodString;
606
+ variant: z.ZodOptional<z.ZodString>;
607
+ }, z.core.$strict>, z.ZodObject<{
608
+ providerID: z.ZodString;
609
+ modelID: z.ZodString;
610
+ variant: z.ZodOptional<z.ZodString>;
611
+ }, z.core.$strict>]>>>;
532
612
  }, z.core.$strip>>;
533
613
  oracle: z.ZodOptional<z.ZodObject<{
534
614
  model: z.ZodOptional<z.ZodString>;
@@ -579,6 +659,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
579
659
  ask: "ask";
580
660
  }>>;
581
661
  }, z.core.$strip>>;
662
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
663
+ model: z.ZodString;
664
+ variant: z.ZodOptional<z.ZodString>;
665
+ }, z.core.$strict>, z.ZodObject<{
666
+ providerID: z.ZodString;
667
+ modelID: z.ZodString;
668
+ variant: z.ZodOptional<z.ZodString>;
669
+ }, z.core.$strict>]>>>;
582
670
  }, z.core.$strip>>;
583
671
  librarian: z.ZodOptional<z.ZodObject<{
584
672
  model: z.ZodOptional<z.ZodString>;
@@ -629,6 +717,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
629
717
  ask: "ask";
630
718
  }>>;
631
719
  }, z.core.$strip>>;
720
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
721
+ model: z.ZodString;
722
+ variant: z.ZodOptional<z.ZodString>;
723
+ }, z.core.$strict>, z.ZodObject<{
724
+ providerID: z.ZodString;
725
+ modelID: z.ZodString;
726
+ variant: z.ZodOptional<z.ZodString>;
727
+ }, z.core.$strict>]>>>;
632
728
  }, z.core.$strip>>;
633
729
  explore: z.ZodOptional<z.ZodObject<{
634
730
  model: z.ZodOptional<z.ZodString>;
@@ -679,6 +775,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
679
775
  ask: "ask";
680
776
  }>>;
681
777
  }, z.core.$strip>>;
778
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
779
+ model: z.ZodString;
780
+ variant: z.ZodOptional<z.ZodString>;
781
+ }, z.core.$strict>, z.ZodObject<{
782
+ providerID: z.ZodString;
783
+ modelID: z.ZodString;
784
+ variant: z.ZodOptional<z.ZodString>;
785
+ }, z.core.$strict>]>>>;
682
786
  }, z.core.$strip>>;
683
787
  "multimodal-looker": z.ZodOptional<z.ZodObject<{
684
788
  model: z.ZodOptional<z.ZodString>;
@@ -729,6 +833,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
729
833
  ask: "ask";
730
834
  }>>;
731
835
  }, z.core.$strip>>;
836
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
837
+ model: z.ZodString;
838
+ variant: z.ZodOptional<z.ZodString>;
839
+ }, z.core.$strict>, z.ZodObject<{
840
+ providerID: z.ZodString;
841
+ modelID: z.ZodString;
842
+ variant: z.ZodOptional<z.ZodString>;
843
+ }, z.core.$strict>]>>>;
732
844
  }, z.core.$strip>>;
733
845
  atlas: z.ZodOptional<z.ZodObject<{
734
846
  model: z.ZodOptional<z.ZodString>;
@@ -779,6 +891,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
779
891
  ask: "ask";
780
892
  }>>;
781
893
  }, z.core.$strip>>;
894
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
895
+ model: z.ZodString;
896
+ variant: z.ZodOptional<z.ZodString>;
897
+ }, z.core.$strict>, z.ZodObject<{
898
+ providerID: z.ZodString;
899
+ modelID: z.ZodString;
900
+ variant: z.ZodOptional<z.ZodString>;
901
+ }, z.core.$strict>]>>>;
782
902
  }, z.core.$strip>>;
783
903
  }, z.core.$strip>;
784
904
  export declare const ClaudeCodeConfigSchema: z.ZodObject<{
@@ -800,6 +920,14 @@ export declare const CategoryConfigSchema: z.ZodObject<{
800
920
  description: z.ZodOptional<z.ZodString>;
801
921
  model: z.ZodOptional<z.ZodString>;
802
922
  variant: z.ZodOptional<z.ZodString>;
923
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
924
+ model: z.ZodString;
925
+ variant: z.ZodOptional<z.ZodString>;
926
+ }, z.core.$strict>, z.ZodObject<{
927
+ providerID: z.ZodString;
928
+ modelID: z.ZodString;
929
+ variant: z.ZodOptional<z.ZodString>;
930
+ }, z.core.$strict>]>>>;
803
931
  temperature: z.ZodOptional<z.ZodNumber>;
804
932
  top_p: z.ZodOptional<z.ZodNumber>;
805
933
  maxTokens: z.ZodOptional<z.ZodNumber>;
@@ -838,6 +966,14 @@ export declare const CategoriesConfigSchema: z.ZodRecord<z.ZodString, z.ZodObjec
838
966
  description: z.ZodOptional<z.ZodString>;
839
967
  model: z.ZodOptional<z.ZodString>;
840
968
  variant: z.ZodOptional<z.ZodString>;
969
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
970
+ model: z.ZodString;
971
+ variant: z.ZodOptional<z.ZodString>;
972
+ }, z.core.$strict>, z.ZodObject<{
973
+ providerID: z.ZodString;
974
+ modelID: z.ZodString;
975
+ variant: z.ZodOptional<z.ZodString>;
976
+ }, z.core.$strict>]>>>;
841
977
  temperature: z.ZodOptional<z.ZodNumber>;
842
978
  top_p: z.ZodOptional<z.ZodNumber>;
843
979
  maxTokens: z.ZodOptional<z.ZodNumber>;
@@ -1133,6 +1269,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1133
1269
  ask: "ask";
1134
1270
  }>>;
1135
1271
  }, z.core.$strip>>;
1272
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1273
+ model: z.ZodString;
1274
+ variant: z.ZodOptional<z.ZodString>;
1275
+ }, z.core.$strict>, z.ZodObject<{
1276
+ providerID: z.ZodString;
1277
+ modelID: z.ZodString;
1278
+ variant: z.ZodOptional<z.ZodString>;
1279
+ }, z.core.$strict>]>>>;
1136
1280
  }, z.core.$strip>>;
1137
1281
  plan: z.ZodOptional<z.ZodObject<{
1138
1282
  model: z.ZodOptional<z.ZodString>;
@@ -1183,6 +1327,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1183
1327
  ask: "ask";
1184
1328
  }>>;
1185
1329
  }, z.core.$strip>>;
1330
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1331
+ model: z.ZodString;
1332
+ variant: z.ZodOptional<z.ZodString>;
1333
+ }, z.core.$strict>, z.ZodObject<{
1334
+ providerID: z.ZodString;
1335
+ modelID: z.ZodString;
1336
+ variant: z.ZodOptional<z.ZodString>;
1337
+ }, z.core.$strict>]>>>;
1186
1338
  }, z.core.$strip>>;
1187
1339
  sisyphus: z.ZodOptional<z.ZodObject<{
1188
1340
  model: z.ZodOptional<z.ZodString>;
@@ -1233,6 +1385,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1233
1385
  ask: "ask";
1234
1386
  }>>;
1235
1387
  }, z.core.$strip>>;
1388
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1389
+ model: z.ZodString;
1390
+ variant: z.ZodOptional<z.ZodString>;
1391
+ }, z.core.$strict>, z.ZodObject<{
1392
+ providerID: z.ZodString;
1393
+ modelID: z.ZodString;
1394
+ variant: z.ZodOptional<z.ZodString>;
1395
+ }, z.core.$strict>]>>>;
1236
1396
  }, z.core.$strip>>;
1237
1397
  "sisyphus-junior": z.ZodOptional<z.ZodObject<{
1238
1398
  model: z.ZodOptional<z.ZodString>;
@@ -1283,6 +1443,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1283
1443
  ask: "ask";
1284
1444
  }>>;
1285
1445
  }, z.core.$strip>>;
1446
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1447
+ model: z.ZodString;
1448
+ variant: z.ZodOptional<z.ZodString>;
1449
+ }, z.core.$strict>, z.ZodObject<{
1450
+ providerID: z.ZodString;
1451
+ modelID: z.ZodString;
1452
+ variant: z.ZodOptional<z.ZodString>;
1453
+ }, z.core.$strict>]>>>;
1286
1454
  }, z.core.$strip>>;
1287
1455
  "OpenCode-Builder": z.ZodOptional<z.ZodObject<{
1288
1456
  model: z.ZodOptional<z.ZodString>;
@@ -1333,6 +1501,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1333
1501
  ask: "ask";
1334
1502
  }>>;
1335
1503
  }, z.core.$strip>>;
1504
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1505
+ model: z.ZodString;
1506
+ variant: z.ZodOptional<z.ZodString>;
1507
+ }, z.core.$strict>, z.ZodObject<{
1508
+ providerID: z.ZodString;
1509
+ modelID: z.ZodString;
1510
+ variant: z.ZodOptional<z.ZodString>;
1511
+ }, z.core.$strict>]>>>;
1336
1512
  }, z.core.$strip>>;
1337
1513
  prometheus: z.ZodOptional<z.ZodObject<{
1338
1514
  model: z.ZodOptional<z.ZodString>;
@@ -1383,6 +1559,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1383
1559
  ask: "ask";
1384
1560
  }>>;
1385
1561
  }, z.core.$strip>>;
1562
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1563
+ model: z.ZodString;
1564
+ variant: z.ZodOptional<z.ZodString>;
1565
+ }, z.core.$strict>, z.ZodObject<{
1566
+ providerID: z.ZodString;
1567
+ modelID: z.ZodString;
1568
+ variant: z.ZodOptional<z.ZodString>;
1569
+ }, z.core.$strict>]>>>;
1386
1570
  }, z.core.$strip>>;
1387
1571
  metis: z.ZodOptional<z.ZodObject<{
1388
1572
  model: z.ZodOptional<z.ZodString>;
@@ -1433,6 +1617,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1433
1617
  ask: "ask";
1434
1618
  }>>;
1435
1619
  }, z.core.$strip>>;
1620
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1621
+ model: z.ZodString;
1622
+ variant: z.ZodOptional<z.ZodString>;
1623
+ }, z.core.$strict>, z.ZodObject<{
1624
+ providerID: z.ZodString;
1625
+ modelID: z.ZodString;
1626
+ variant: z.ZodOptional<z.ZodString>;
1627
+ }, z.core.$strict>]>>>;
1436
1628
  }, z.core.$strip>>;
1437
1629
  momus: z.ZodOptional<z.ZodObject<{
1438
1630
  model: z.ZodOptional<z.ZodString>;
@@ -1483,6 +1675,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1483
1675
  ask: "ask";
1484
1676
  }>>;
1485
1677
  }, z.core.$strip>>;
1678
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1679
+ model: z.ZodString;
1680
+ variant: z.ZodOptional<z.ZodString>;
1681
+ }, z.core.$strict>, z.ZodObject<{
1682
+ providerID: z.ZodString;
1683
+ modelID: z.ZodString;
1684
+ variant: z.ZodOptional<z.ZodString>;
1685
+ }, z.core.$strict>]>>>;
1486
1686
  }, z.core.$strip>>;
1487
1687
  oracle: z.ZodOptional<z.ZodObject<{
1488
1688
  model: z.ZodOptional<z.ZodString>;
@@ -1533,6 +1733,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1533
1733
  ask: "ask";
1534
1734
  }>>;
1535
1735
  }, z.core.$strip>>;
1736
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1737
+ model: z.ZodString;
1738
+ variant: z.ZodOptional<z.ZodString>;
1739
+ }, z.core.$strict>, z.ZodObject<{
1740
+ providerID: z.ZodString;
1741
+ modelID: z.ZodString;
1742
+ variant: z.ZodOptional<z.ZodString>;
1743
+ }, z.core.$strict>]>>>;
1536
1744
  }, z.core.$strip>>;
1537
1745
  librarian: z.ZodOptional<z.ZodObject<{
1538
1746
  model: z.ZodOptional<z.ZodString>;
@@ -1583,6 +1791,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1583
1791
  ask: "ask";
1584
1792
  }>>;
1585
1793
  }, z.core.$strip>>;
1794
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1795
+ model: z.ZodString;
1796
+ variant: z.ZodOptional<z.ZodString>;
1797
+ }, z.core.$strict>, z.ZodObject<{
1798
+ providerID: z.ZodString;
1799
+ modelID: z.ZodString;
1800
+ variant: z.ZodOptional<z.ZodString>;
1801
+ }, z.core.$strict>]>>>;
1586
1802
  }, z.core.$strip>>;
1587
1803
  explore: z.ZodOptional<z.ZodObject<{
1588
1804
  model: z.ZodOptional<z.ZodString>;
@@ -1633,6 +1849,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1633
1849
  ask: "ask";
1634
1850
  }>>;
1635
1851
  }, z.core.$strip>>;
1852
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1853
+ model: z.ZodString;
1854
+ variant: z.ZodOptional<z.ZodString>;
1855
+ }, z.core.$strict>, z.ZodObject<{
1856
+ providerID: z.ZodString;
1857
+ modelID: z.ZodString;
1858
+ variant: z.ZodOptional<z.ZodString>;
1859
+ }, z.core.$strict>]>>>;
1636
1860
  }, z.core.$strip>>;
1637
1861
  "multimodal-looker": z.ZodOptional<z.ZodObject<{
1638
1862
  model: z.ZodOptional<z.ZodString>;
@@ -1683,6 +1907,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1683
1907
  ask: "ask";
1684
1908
  }>>;
1685
1909
  }, z.core.$strip>>;
1910
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1911
+ model: z.ZodString;
1912
+ variant: z.ZodOptional<z.ZodString>;
1913
+ }, z.core.$strict>, z.ZodObject<{
1914
+ providerID: z.ZodString;
1915
+ modelID: z.ZodString;
1916
+ variant: z.ZodOptional<z.ZodString>;
1917
+ }, z.core.$strict>]>>>;
1686
1918
  }, z.core.$strip>>;
1687
1919
  atlas: z.ZodOptional<z.ZodObject<{
1688
1920
  model: z.ZodOptional<z.ZodString>;
@@ -1733,12 +1965,28 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1733
1965
  ask: "ask";
1734
1966
  }>>;
1735
1967
  }, z.core.$strip>>;
1968
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1969
+ model: z.ZodString;
1970
+ variant: z.ZodOptional<z.ZodString>;
1971
+ }, z.core.$strict>, z.ZodObject<{
1972
+ providerID: z.ZodString;
1973
+ modelID: z.ZodString;
1974
+ variant: z.ZodOptional<z.ZodString>;
1975
+ }, z.core.$strict>]>>>;
1736
1976
  }, z.core.$strip>>;
1737
1977
  }, z.core.$strip>>;
1738
1978
  categories: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1739
1979
  description: z.ZodOptional<z.ZodString>;
1740
1980
  model: z.ZodOptional<z.ZodString>;
1741
1981
  variant: z.ZodOptional<z.ZodString>;
1982
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1983
+ model: z.ZodString;
1984
+ variant: z.ZodOptional<z.ZodString>;
1985
+ }, z.core.$strict>, z.ZodObject<{
1986
+ providerID: z.ZodString;
1987
+ modelID: z.ZodString;
1988
+ variant: z.ZodOptional<z.ZodString>;
1989
+ }, z.core.$strict>]>>>;
1742
1990
  temperature: z.ZodOptional<z.ZodNumber>;
1743
1991
  top_p: z.ZodOptional<z.ZodNumber>;
1744
1992
  maxTokens: z.ZodOptional<z.ZodNumber>;
@@ -1898,4 +2146,5 @@ export type CategoriesConfig = z.infer<typeof CategoriesConfigSchema>;
1898
2146
  export type BuiltinCategoryName = z.infer<typeof BuiltinCategoryNameSchema>;
1899
2147
  export type GitMasterConfig = z.infer<typeof GitMasterConfigSchema>;
1900
2148
  export type RuntimeFallbackConfig = z.infer<typeof RuntimeFallbackConfigSchema>;
2149
+ export type FallbackModelEntry = z.infer<typeof FallbackModelEntrySchema>;
1901
2150
  export { AnyMcpNameSchema, type AnyMcpName, McpNameSchema, type McpName } from "../mcp/types";
@@ -1,7 +1,7 @@
1
1
  import type { PluginInput } from "@opencode-ai/plugin";
2
2
  import type { BackgroundTask, LaunchInput, ResumeInput } from "./types";
3
3
  import type { PerfTracer } from "../../shared/perf-tracer";
4
- import type { BackgroundTaskConfig } from "../../config/schema";
4
+ import type { BackgroundTaskConfig, RuntimeFallbackConfig } from "../../config/schema";
5
5
  interface EventProperties {
6
6
  sessionID?: string;
7
7
  info?: {
@@ -13,6 +13,9 @@ interface Event {
13
13
  type: string;
14
14
  properties?: EventProperties;
15
15
  }
16
+ type BackgroundManagerConfig = BackgroundTaskConfig & {
17
+ runtimeFallback?: RuntimeFallbackConfig;
18
+ };
16
19
  export declare class BackgroundManager {
17
20
  private static cleanupManagers;
18
21
  private static cleanupRegistered;
@@ -30,11 +33,12 @@ export declare class BackgroundManager {
30
33
  private perfTracer?;
31
34
  private queuesByKey;
32
35
  private processingKeys;
33
- constructor(ctx: PluginInput, config?: BackgroundTaskConfig);
36
+ constructor(ctx: PluginInput, config?: BackgroundManagerConfig);
34
37
  setPerfTracer(tracer: PerfTracer): void;
35
38
  launch(input: LaunchInput): Promise<BackgroundTask>;
36
39
  private processKey;
37
40
  private startTask;
41
+ private handlePromptFailure;
38
42
  getTask(id: string): BackgroundTask | undefined;
39
43
  getTasksByParentSession(sessionID: string): BackgroundTask[];
40
44
  getAllDescendantTasks(sessionID: string): BackgroundTask[];
@@ -55,6 +55,7 @@ export interface BackgroundTask {
55
55
  concurrencyGroup?: string;
56
56
  /** Parent session's agent name for notification */
57
57
  parentAgent?: string;
58
+ category?: string;
58
59
  /** Last message count for stability detection */
59
60
  lastMsgCount?: number;
60
61
  /** Number of consecutive polls with stable message count */
@@ -81,6 +82,7 @@ export interface LaunchInput {
81
82
  modelID: string;
82
83
  };
83
84
  parentAgent?: string;
85
+ category?: string;
84
86
  model?: {
85
87
  providerID: string;
86
88
  modelID: string;
@@ -29,3 +29,4 @@ export { createAtlasHook } from "./atlas";
29
29
  export { createDelegateTaskRetryHook } from "./delegate-task-retry";
30
30
  export { createQuestionLabelTruncatorHook } from "./question-label-truncator";
31
31
  export { createPerfProfilerHook } from "./perf-profiler";
32
+ export { createRuntimeFallbackHook } from "./runtime-fallback";
@@ -8,10 +8,14 @@
8
8
  * 避让 sessionRecovery(可恢复错误优先由 sessionRecovery 处理)。
9
9
  */
10
10
  import type { PluginInput } from "@opencode-ai/plugin";
11
+ import type { RuntimeFallbackConfig } from "../../config/schema";
12
+ import { type FallbackModel } from "../../shared/runtime-fallback";
11
13
  export interface RuntimeFallbackOptions {
14
+ config?: RuntimeFallbackConfig;
12
15
  sessionRecovery?: {
13
16
  isRecoverableError: (error: unknown) => boolean;
14
17
  };
18
+ getConfiguredFallbackModels?: (agent?: string, category?: string) => FallbackModel[] | undefined;
15
19
  }
16
20
  export declare function createRuntimeFallbackHook(ctx: PluginInput, options?: RuntimeFallbackOptions): {
17
21
  handler: ({ event, }: {