@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.
@@ -4,7 +4,7 @@
4
4
  * 统一的 provider 错误分类逻辑,用于判断错误类型和是否可重试/fallback。
5
5
  * 支持 OpenAI、Anthropic、Gemini、xAI、Zhipu 等主流 provider。
6
6
  */
7
- export type ErrorCategory = "rate_limit" | "quota" | "overloaded" | "context_overflow" | "auth" | "bad_request" | "unknown";
7
+ export type ErrorCategory = "rate_limit" | "quota" | "overloaded" | "context_overflow" | "auth" | "bad_request" | "model_unavailable" | "provider_unavailable" | "unknown";
8
8
  export interface ProviderErrorClassification {
9
9
  category: ErrorCategory;
10
10
  retryable: boolean;
@@ -14,17 +14,29 @@ export interface FallbackAttempt {
14
14
  model: FallbackModel;
15
15
  error?: ProviderErrorClassification;
16
16
  }
17
+ export interface FallbackSkip {
18
+ model?: FallbackModel;
19
+ reason: string;
20
+ }
17
21
  export interface FallbackNextResult {
18
22
  kind: "next";
19
23
  model: FallbackModel;
20
24
  attempts: FallbackAttempt[];
25
+ skipped?: FallbackSkip[];
21
26
  }
22
27
  export interface FallbackExhaustedResult {
23
28
  kind: "exhausted";
24
29
  attempts: FallbackAttempt[];
30
+ reason: string;
31
+ skipped?: FallbackSkip[];
25
32
  lastErrorClassification?: ProviderErrorClassification;
26
33
  }
27
- export type FallbackResult = FallbackNextResult | FallbackExhaustedResult;
34
+ export interface FallbackUnconfiguredResult {
35
+ kind: "unconfigured";
36
+ reason: string;
37
+ skipped?: FallbackSkip[];
38
+ }
39
+ export type FallbackResult = FallbackNextResult | FallbackExhaustedResult | FallbackUnconfiguredResult;
28
40
  export interface RuntimeFallbackInput {
29
41
  agent?: string;
30
42
  category?: string;
@@ -32,6 +44,8 @@ export interface RuntimeFallbackInput {
32
44
  attempts: FallbackAttempt[];
33
45
  availableModels?: Set<string>;
34
46
  lastErrorClassification?: ProviderErrorClassification;
47
+ configuredFallbackModels?: FallbackModel[];
48
+ maxAttempts?: number;
35
49
  }
36
50
  /**
37
51
  * 解析下一个 fallback 模型
@@ -1,6 +1,6 @@
1
1
  import { type PluginInput, type ToolDefinition } from "@opencode-ai/plugin";
2
2
  import type { BackgroundManager } from "../../features/background-agent";
3
- import type { CategoryConfig, CategoriesConfig, GitMasterConfig } from "../../config/schema";
3
+ import type { CategoryConfig, CategoriesConfig, FallbackModelEntry, GitMasterConfig, RuntimeFallbackConfig } from "../../config/schema";
4
4
  type OpencodeClient = PluginInput["client"];
5
5
  export declare function resolveCategoryConfig(categoryName: string, options: {
6
6
  userCategories?: CategoriesConfig;
@@ -18,6 +18,8 @@ export interface DelegateTaskToolOptions {
18
18
  userCategories?: CategoriesConfig;
19
19
  gitMasterConfig?: GitMasterConfig;
20
20
  sisyphusJuniorModel?: string;
21
+ runtimeFallbackConfig?: RuntimeFallbackConfig;
22
+ agentFallbackModels?: Record<string, FallbackModelEntry[] | undefined>;
21
23
  }
22
24
  export interface BuildSystemContentInput {
23
25
  skillContent?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skj1724/oh-my-opencode",
3
- "version": "3.19.7",
3
+ "version": "3.19.8",
4
4
  "description": "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",