oh-my-opencode 3.17.6 → 3.17.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.
@@ -10,6 +10,7 @@ type FirstMessageVariantGate = {
10
10
  } | undefined) => void;
11
11
  clear: (sessionID: string) => void;
12
12
  };
13
+ export declare function extractErrorMessage(error: unknown): string;
13
14
  type EventInput = Parameters<NonNullable<NonNullable<CreatedHooks["writeExistingFileGuard"]>["event"]>>[0];
14
15
  export declare function createEventHandler(args: {
15
16
  ctx: PluginContext;
@@ -1,5 +1,11 @@
1
1
  import type { PluginInput } from "@opencode-ai/plugin";
2
2
  import { type ContextLimitModelCacheState } from "./context-limit-resolver";
3
+ type ContextWindowUsage = {
4
+ usedTokens: number;
5
+ remainingTokens: number;
6
+ usagePercentage: number;
7
+ };
8
+ export declare function invalidateContextWindowUsageCache(ctx: PluginInput, sessionID?: string): void;
3
9
  export interface TruncationResult {
4
10
  result: string;
5
11
  truncated: boolean;
@@ -11,18 +17,11 @@ export interface TruncationOptions {
11
17
  contextWindowLimit?: number;
12
18
  }
13
19
  export declare function truncateToTokenLimit(output: string, maxTokens: number, preserveHeaderLines?: number): TruncationResult;
14
- export declare function getContextWindowUsage(ctx: PluginInput, sessionID: string, modelCacheState?: ContextLimitModelCacheState): Promise<{
15
- usedTokens: number;
16
- remainingTokens: number;
17
- usagePercentage: number;
18
- } | null>;
20
+ export declare function getContextWindowUsage(ctx: PluginInput, sessionID: string, modelCacheState?: ContextLimitModelCacheState): Promise<ContextWindowUsage | null>;
19
21
  export declare function dynamicTruncate(ctx: PluginInput, sessionID: string, output: string, options?: TruncationOptions, modelCacheState?: ContextLimitModelCacheState): Promise<TruncationResult>;
20
22
  export declare function createDynamicTruncator(ctx: PluginInput, modelCacheState?: ContextLimitModelCacheState): {
21
23
  truncate: (sessionID: string, output: string, options?: TruncationOptions) => Promise<TruncationResult>;
22
- getUsage: (sessionID: string) => Promise<{
23
- usedTokens: number;
24
- remainingTokens: number;
25
- usagePercentage: number;
26
- } | null>;
24
+ getUsage: (sessionID: string) => Promise<ContextWindowUsage | null>;
27
25
  truncateSync: (output: string, maxTokens: number, preserveHeaderLines?: number) => TruncationResult;
28
26
  };
27
+ export {};
@@ -5,12 +5,12 @@ export interface ErrorInfo {
5
5
  }
6
6
  /**
7
7
  * Determines if an error is a retryable model error.
8
- * Returns true if the error is a known retryable type OR matches retryable message patterns.
8
+ * Returns true if it's a known retryable type OR matches retryable message patterns.
9
9
  */
10
10
  export declare function isRetryableModelError(error: ErrorInfo): boolean;
11
11
  /**
12
12
  * Determines if an error should trigger a fallback retry.
13
- * Returns true for deadstop errors that completely halt the action loop.
13
+ * Returns true for errors that halt execution.
14
14
  */
15
15
  export declare function shouldRetryError(error: ErrorInfo): boolean;
16
16
  /**
@@ -7,6 +7,7 @@ export type BackgroundOutputMessage = {
7
7
  created?: number;
8
8
  };
9
9
  agent?: string;
10
+ error?: unknown;
10
11
  };
11
12
  parts?: Array<{
12
13
  type?: string;
@@ -2,3 +2,4 @@ import type { CategoryConfig } from "../../config/schema";
2
2
  export declare const DEFAULT_CATEGORIES: Record<string, CategoryConfig>;
3
3
  export declare const CATEGORY_PROMPT_APPENDS: Record<string, string>;
4
4
  export declare const CATEGORY_DESCRIPTIONS: Record<string, string>;
5
+ export declare const CATEGORY_PROMPT_APPEND_RESOLVERS: Record<string, (model: string | undefined) => string>;
@@ -4,4 +4,5 @@ export type BuiltinCategoryDefinition = {
4
4
  config: CategoryConfig;
5
5
  description: string;
6
6
  promptAppend: string;
7
+ resolvePromptAppend?: (model: string | undefined) => string;
7
8
  };
@@ -1,5 +1,5 @@
1
1
  import type { AvailableCategory, AvailableSkill } from "../../agents/dynamic-agent-prompt-builder";
2
- export { CATEGORY_DESCRIPTIONS, CATEGORY_PROMPT_APPENDS, DEFAULT_CATEGORIES, } from "./builtin-categories";
2
+ export { CATEGORY_DESCRIPTIONS, CATEGORY_PROMPT_APPENDS, CATEGORY_PROMPT_APPEND_RESOLVERS, DEFAULT_CATEGORIES, } from "./builtin-categories";
3
3
  /**
4
4
  * System prompt prepended to plan agent invocations.
5
5
  * Instructs the plan agent to first gather context via explore/librarian agents,
@@ -38,6 +38,7 @@ export interface SessionMessage {
38
38
  created?: number;
39
39
  };
40
40
  finish?: string;
41
+ error?: unknown;
41
42
  agent?: string;
42
43
  model?: {
43
44
  providerID: string;
@@ -1,2 +1,5 @@
1
1
  import type { BuiltinCategoryDefinition } from "./builtin-category-definition";
2
+ export declare const DEEP_CATEGORY_PROMPT_APPEND = "<Category_Context>\nYou are working on GOAL-ORIENTED AUTONOMOUS tasks.\n\nYou are NOT an interactive assistant. You are an autonomous problem-solver.\n\nBEFORE making ANY changes:\n1. Silently explore the codebase extensively (5-15 minutes of reading is normal)\n2. Read related files, trace dependencies, understand the full context\n3. Build a complete mental model of the problem space\n4. Do not ask clarifying questions - the goal is already defined\n\nYou receive a GOAL. When the goal includes numbered steps or phases, treat them as one atomic task broken into sub-steps, not as separate independent tasks. Figure out HOW to achieve it yourself. Thorough research before any action.\n\nSub-steps of ONE goal = execute all steps as phases of one atomic task.\nGenuinely independent tasks = flag and refuse, require separate delegations.\n\nApproach: explore extensively, understand deeply, then act decisively. Prefer comprehensive solutions over quick patches. If the goal is unclear, make reasonable assumptions and proceed.\n\nMinimal status updates. Focus on results, not play-by-play. Report completion with summary of changes.\n</Category_Context>";
3
+ export declare const DEEP_CATEGORY_PROMPT_APPEND_GPT_5_5 = "<Category_Context name=\"deep\">\nYou are operating in DEEP mode. This is the category reserved for goal-oriented autonomous work on hairy problems that reward thorough exploration and comprehensive solutions.\n\nThe orchestrator chose this category because the task benefits from depth over speed. You should feel empowered to spend the time needed: five to fifteen minutes of silent exploration before the first edit is normal and correct. Rushing to implementation on a deep task is a failure mode, not a feature.\n\n# How deep mode adjusts the base behavior\n\n**Exploration budget: generous.** Read the files you need, trace dependencies both directions, fire 2-5 explore/librarian sub-agents in parallel for broader questions. Build a complete mental model before the first `apply_patch`. Exploration here is an investment, not overhead.\n\n**Goal, not plan.** You receive a GOAL describing the desired outcome. You figure out HOW to achieve it. The orchestrator deliberately did not hand you a step-by-step plan; producing one and asking for approval is not what was asked. Execute.\n\n**Atomic task treatment.** When the goal contains numbered steps or phases, treat them as sub-steps of ONE task and execute them all in this turn. Splitting them across turns is wrong unless they reveal an architectural blocker that requires the user's input. If the \"steps\" turn out to be genuinely independent tasks that should have been separate delegations, flag that in your final message and refuse the ones beyond scope.\n\n**Root cause bias.** Prefer root-cause fixes over symptom fixes. A null check around `foo()` is a symptom fix; fixing whatever causes `foo()` to return unexpected values is the root fix. Trace at least two levels up before settling on an answer. In deep mode, you have permission (and the expectation) to do the deeper fix.\n\n**Ambition scaled to context.** For brand-new greenfield work, be ambitious. Choose strong defaults, avoid AI-slop aesthetics, produce something you would be proud to hand to another senior engineer. For changes in an existing codebase, be surgical and respect the existing patterns; depth does not mean invasiveness.\n\n**Completion bar: full delivery.** \"Simplified version\", \"proof of concept\", and \"you can extend this later\" are not acceptable deliveries for a deep task. The orchestrator routed here specifically for a complete solution. If you hit a genuine blocker (missing secret, design decision only the user can make, three materially different attempts all failed), document it and return; otherwise, finish the task.\n\n**Status cadence: sparse.** The user is not on the other side of this conversation; the orchestrator is, and they will synthesize your progress. Send commentary only at meaningful phase transitions (starting exploration, starting implementation, starting verification, hitting a genuine blocker). Do not narrate every tool call; silence during focused work is expected.\n</Category_Context>";
4
+ export declare function resolveDeepCategoryPromptAppend(model: string | undefined): string;
2
5
  export declare const OPENAI_CATEGORIES: BuiltinCategoryDefinition[];
@@ -1,5 +1,6 @@
1
1
  import type { FallbackEntry } from "../../shared/model-requirements";
2
2
  import type { DelegatedModelConfig } from "./types";
3
+ import type { ModelFallbackState } from "../../hooks/model-fallback/hook";
3
4
  export declare function retrySyncPromptWithFallbacks(input: {
4
5
  sessionID: string;
5
6
  initialError: string;
@@ -9,4 +10,6 @@ export declare function retrySyncPromptWithFallbacks(input: {
9
10
  }): Promise<{
10
11
  promptError: string | null;
11
12
  categoryModel: DelegatedModelConfig | undefined;
13
+ fallbackState?: ModelFallbackState;
12
14
  }>;
15
+ export declare function getNextSyncFallbackModel(sessionID: string, fallbackState: ModelFallbackState | undefined): DelegatedModelConfig | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-opencode",
3
- "version": "3.17.6",
3
+ "version": "3.17.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",
@@ -80,17 +80,17 @@
80
80
  "zod": "^4.3.0"
81
81
  },
82
82
  "optionalDependencies": {
83
- "oh-my-opencode-darwin-arm64": "3.17.6",
84
- "oh-my-opencode-darwin-x64": "3.17.6",
85
- "oh-my-opencode-darwin-x64-baseline": "3.17.6",
86
- "oh-my-opencode-linux-arm64": "3.17.6",
87
- "oh-my-opencode-linux-arm64-musl": "3.17.6",
88
- "oh-my-opencode-linux-x64": "3.17.6",
89
- "oh-my-opencode-linux-x64-baseline": "3.17.6",
90
- "oh-my-opencode-linux-x64-musl": "3.17.6",
91
- "oh-my-opencode-linux-x64-musl-baseline": "3.17.6",
92
- "oh-my-opencode-windows-x64": "3.17.6",
93
- "oh-my-opencode-windows-x64-baseline": "3.17.6"
83
+ "oh-my-opencode-darwin-arm64": "3.17.8",
84
+ "oh-my-opencode-darwin-x64": "3.17.8",
85
+ "oh-my-opencode-darwin-x64-baseline": "3.17.8",
86
+ "oh-my-opencode-linux-arm64": "3.17.8",
87
+ "oh-my-opencode-linux-arm64-musl": "3.17.8",
88
+ "oh-my-opencode-linux-x64": "3.17.8",
89
+ "oh-my-opencode-linux-x64-baseline": "3.17.8",
90
+ "oh-my-opencode-linux-x64-musl": "3.17.8",
91
+ "oh-my-opencode-linux-x64-musl-baseline": "3.17.8",
92
+ "oh-my-opencode-windows-x64": "3.17.8",
93
+ "oh-my-opencode-windows-x64-baseline": "3.17.8"
94
94
  },
95
95
  "overrides": {},
96
96
  "trustedDependencies": [