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.
- package/dist/cli/index.js +21 -19
- package/dist/features/background-agent/attempt-lifecycle.d.ts +12 -0
- package/dist/features/background-agent/background-task-notification-template.d.ts +2 -1
- package/dist/features/background-agent/constants.d.ts +1 -0
- package/dist/features/background-agent/fallback-retry-handler.d.ts +8 -0
- package/dist/features/background-agent/manager.d.ts +9 -0
- package/dist/features/background-agent/types.d.ts +24 -0
- package/dist/hooks/model-fallback/controller-accessor.d.ts +1 -0
- package/dist/hooks/model-fallback/fallback-state-controller.d.ts +1 -0
- package/dist/hooks/model-fallback/hook.d.ts +2 -1
- package/dist/hooks/preemptive-compaction-degradation-monitor.d.ts +1 -0
- package/dist/hooks/preemptive-compaction-no-text-tail.d.ts +1 -0
- package/dist/index.js +988 -326
- package/dist/plugin/event.d.ts +1 -0
- package/dist/shared/dynamic-truncator.d.ts +9 -10
- package/dist/shared/model-error-classifier.d.ts +2 -2
- package/dist/tools/background-task/clients.d.ts +1 -0
- package/dist/tools/delegate-task/builtin-categories.d.ts +1 -0
- package/dist/tools/delegate-task/builtin-category-definition.d.ts +1 -0
- package/dist/tools/delegate-task/constants.d.ts +1 -1
- package/dist/tools/delegate-task/executor-types.d.ts +1 -0
- package/dist/tools/delegate-task/openai-categories.d.ts +3 -0
- package/dist/tools/delegate-task/sync-task-fallback.d.ts +3 -0
- package/package.json +12 -12
package/dist/cli/index.js
CHANGED
|
@@ -5095,8 +5095,10 @@ function normalizeSDKResponse(response, fallback, options) {
|
|
|
5095
5095
|
}
|
|
5096
5096
|
|
|
5097
5097
|
// src/shared/dynamic-truncator.ts
|
|
5098
|
+
var usageCacheByClient;
|
|
5098
5099
|
var init_dynamic_truncator = __esm(() => {
|
|
5099
5100
|
init_context_limit_resolver();
|
|
5101
|
+
usageCacheByClient = new WeakMap;
|
|
5100
5102
|
});
|
|
5101
5103
|
|
|
5102
5104
|
// src/shared/data-path.ts
|
|
@@ -53064,13 +53066,6 @@ function readPackageVersion(packageJsonPath) {
|
|
|
53064
53066
|
return pkg.version ?? null;
|
|
53065
53067
|
}
|
|
53066
53068
|
function getCachedVersion() {
|
|
53067
|
-
for (const candidate of INSTALLED_PACKAGE_JSON_CANDIDATES) {
|
|
53068
|
-
try {
|
|
53069
|
-
if (fs9.existsSync(candidate)) {
|
|
53070
|
-
return readPackageVersion(candidate);
|
|
53071
|
-
}
|
|
53072
|
-
} catch {}
|
|
53073
|
-
}
|
|
53074
53069
|
try {
|
|
53075
53070
|
const currentDir = path9.dirname(fileURLToPath2(import.meta.url));
|
|
53076
53071
|
const pkgPath = findPackageJsonUp(currentDir);
|
|
@@ -53080,6 +53075,13 @@ function getCachedVersion() {
|
|
|
53080
53075
|
} catch (err) {
|
|
53081
53076
|
log("[auto-update-checker] Failed to resolve version from current directory:", err);
|
|
53082
53077
|
}
|
|
53078
|
+
for (const candidate of INSTALLED_PACKAGE_JSON_CANDIDATES) {
|
|
53079
|
+
try {
|
|
53080
|
+
if (fs9.existsSync(candidate)) {
|
|
53081
|
+
return readPackageVersion(candidate);
|
|
53082
|
+
}
|
|
53083
|
+
} catch {}
|
|
53084
|
+
}
|
|
53083
53085
|
try {
|
|
53084
53086
|
const execDir = path9.dirname(fs9.realpathSync(process.execPath));
|
|
53085
53087
|
const pkgPath = findPackageJsonUp(execDir);
|
|
@@ -53864,7 +53866,7 @@ var {
|
|
|
53864
53866
|
// package.json
|
|
53865
53867
|
var package_default = {
|
|
53866
53868
|
name: "oh-my-opencode",
|
|
53867
|
-
version: "3.17.
|
|
53869
|
+
version: "3.17.8",
|
|
53868
53870
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
53869
53871
|
main: "./dist/index.js",
|
|
53870
53872
|
types: "dist/index.d.ts",
|
|
@@ -53944,17 +53946,17 @@ var package_default = {
|
|
|
53944
53946
|
zod: "^4.3.0"
|
|
53945
53947
|
},
|
|
53946
53948
|
optionalDependencies: {
|
|
53947
|
-
"oh-my-opencode-darwin-arm64": "3.17.
|
|
53948
|
-
"oh-my-opencode-darwin-x64": "3.17.
|
|
53949
|
-
"oh-my-opencode-darwin-x64-baseline": "3.17.
|
|
53950
|
-
"oh-my-opencode-linux-arm64": "3.17.
|
|
53951
|
-
"oh-my-opencode-linux-arm64-musl": "3.17.
|
|
53952
|
-
"oh-my-opencode-linux-x64": "3.17.
|
|
53953
|
-
"oh-my-opencode-linux-x64-baseline": "3.17.
|
|
53954
|
-
"oh-my-opencode-linux-x64-musl": "3.17.
|
|
53955
|
-
"oh-my-opencode-linux-x64-musl-baseline": "3.17.
|
|
53956
|
-
"oh-my-opencode-windows-x64": "3.17.
|
|
53957
|
-
"oh-my-opencode-windows-x64-baseline": "3.17.
|
|
53949
|
+
"oh-my-opencode-darwin-arm64": "3.17.8",
|
|
53950
|
+
"oh-my-opencode-darwin-x64": "3.17.8",
|
|
53951
|
+
"oh-my-opencode-darwin-x64-baseline": "3.17.8",
|
|
53952
|
+
"oh-my-opencode-linux-arm64": "3.17.8",
|
|
53953
|
+
"oh-my-opencode-linux-arm64-musl": "3.17.8",
|
|
53954
|
+
"oh-my-opencode-linux-x64": "3.17.8",
|
|
53955
|
+
"oh-my-opencode-linux-x64-baseline": "3.17.8",
|
|
53956
|
+
"oh-my-opencode-linux-x64-musl": "3.17.8",
|
|
53957
|
+
"oh-my-opencode-linux-x64-musl-baseline": "3.17.8",
|
|
53958
|
+
"oh-my-opencode-windows-x64": "3.17.8",
|
|
53959
|
+
"oh-my-opencode-windows-x64-baseline": "3.17.8"
|
|
53958
53960
|
},
|
|
53959
53961
|
overrides: {},
|
|
53960
53962
|
trustedDependencies: [
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DelegatedModelConfig } from "../../shared/model-resolution-types";
|
|
2
|
+
import type { BackgroundTask, BackgroundTaskAttempt, BackgroundTaskStatus } from "./types";
|
|
3
|
+
type TerminalAttemptStatus = Extract<BackgroundTaskStatus, "completed" | "error" | "cancelled" | "interrupt">;
|
|
4
|
+
export declare function getCurrentAttempt(task: BackgroundTask): BackgroundTaskAttempt | undefined;
|
|
5
|
+
export declare function ensureCurrentAttempt(task: BackgroundTask, model?: DelegatedModelConfig | undefined): BackgroundTaskAttempt;
|
|
6
|
+
export declare function projectTaskFromCurrentAttempt(task: BackgroundTask): BackgroundTask;
|
|
7
|
+
export declare function startAttempt(task: BackgroundTask, model: DelegatedModelConfig | undefined): BackgroundTaskAttempt;
|
|
8
|
+
export declare function bindAttemptSession(task: BackgroundTask, attemptID: string, sessionID: string, model: DelegatedModelConfig | undefined): BackgroundTaskAttempt | undefined;
|
|
9
|
+
export declare function finalizeAttempt(task: BackgroundTask, attemptID: string, status: TerminalAttemptStatus, error?: string): BackgroundTaskAttempt | undefined;
|
|
10
|
+
export declare function scheduleRetryAttempt(task: BackgroundTask, failedAttemptID: string, nextModel: DelegatedModelConfig, error?: string): BackgroundTaskAttempt | undefined;
|
|
11
|
+
export declare function findAttemptBySession(task: BackgroundTask, sessionID: string): BackgroundTaskAttempt | undefined;
|
|
12
|
+
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { BackgroundTaskStatus } from "./types";
|
|
1
|
+
import type { BackgroundTaskAttempt, BackgroundTaskStatus } from "./types";
|
|
2
2
|
export type BackgroundTaskNotificationStatus = "COMPLETED" | "CANCELLED" | "INTERRUPTED" | "ERROR";
|
|
3
3
|
export interface BackgroundTaskNotificationTask {
|
|
4
4
|
id: string;
|
|
5
5
|
description: string;
|
|
6
6
|
status: BackgroundTaskStatus;
|
|
7
7
|
error?: string;
|
|
8
|
+
attempts?: BackgroundTaskAttempt[];
|
|
8
9
|
}
|
|
9
10
|
export declare function buildBackgroundTaskNotificationText(input: {
|
|
10
11
|
task: BackgroundTaskNotificationTask;
|
|
@@ -13,4 +13,12 @@ export declare function tryFallbackRetry(args: {
|
|
|
13
13
|
idleDeferralTimers: Map<string, ReturnType<typeof setTimeout>>;
|
|
14
14
|
queuesByKey: Map<string, QueueItem[]>;
|
|
15
15
|
processKey: (key: string) => void;
|
|
16
|
+
onRetrying?: (details: {
|
|
17
|
+
task: BackgroundTask;
|
|
18
|
+
source: string;
|
|
19
|
+
previousSessionID?: string;
|
|
20
|
+
failedModel?: string;
|
|
21
|
+
failedError?: string;
|
|
22
|
+
nextModel: string;
|
|
23
|
+
}) => void;
|
|
16
24
|
}): Promise<boolean>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
import type { ModelFallbackControllerAccessor } from "../../hooks/model-fallback";
|
|
2
3
|
import type { BackgroundTask, LaunchInput, ResumeInput } from "./types";
|
|
3
4
|
import { TaskHistory } from "./task-history";
|
|
4
5
|
import type { BackgroundTaskConfig, TmuxConfig } from "../../config/schema";
|
|
@@ -22,6 +23,7 @@ export interface SubagentSessionCreatedEvent {
|
|
|
22
23
|
export type OnSubagentSessionCreated = (event: SubagentSessionCreatedEvent) => Promise<void>;
|
|
23
24
|
export declare class BackgroundManager {
|
|
24
25
|
private tasks;
|
|
26
|
+
private tasksByParentSession;
|
|
25
27
|
private notifications;
|
|
26
28
|
private pendingNotifications;
|
|
27
29
|
private pendingByParent;
|
|
@@ -46,6 +48,7 @@ export declare class BackgroundManager {
|
|
|
46
48
|
private rootDescendantCounts;
|
|
47
49
|
private preStartDescendantReservations;
|
|
48
50
|
private enableParentSessionNotifications;
|
|
51
|
+
private modelFallbackControllerAccessor?;
|
|
49
52
|
readonly taskHistory: TaskHistory;
|
|
50
53
|
private cachedCircuitBreakerSettings?;
|
|
51
54
|
constructor(ctx: PluginInput, config?: BackgroundTaskConfig, options?: {
|
|
@@ -53,6 +56,7 @@ export declare class BackgroundManager {
|
|
|
53
56
|
onSubagentSessionCreated?: OnSubagentSessionCreated;
|
|
54
57
|
onShutdown?: () => void | Promise<void>;
|
|
55
58
|
enableParentSessionNotifications?: boolean;
|
|
59
|
+
modelFallbackControllerAccessor?: ModelFallbackControllerAccessor;
|
|
56
60
|
});
|
|
57
61
|
private abortSessionWithLogging;
|
|
58
62
|
assertCanSpawn(parentSessionID: string): Promise<SubagentSpawnContext>;
|
|
@@ -67,6 +71,10 @@ export declare class BackgroundManager {
|
|
|
67
71
|
private markPreStartDescendantReservation;
|
|
68
72
|
private settlePreStartDescendantReservation;
|
|
69
73
|
private rollbackPreStartDescendantReservation;
|
|
74
|
+
private addTask;
|
|
75
|
+
private removeTask;
|
|
76
|
+
private updateTaskParent;
|
|
77
|
+
private removeTaskFromParentIndex;
|
|
70
78
|
launch(input: LaunchInput): Promise<BackgroundTask>;
|
|
71
79
|
private processKey;
|
|
72
80
|
private startTask;
|
|
@@ -74,6 +82,7 @@ export declare class BackgroundManager {
|
|
|
74
82
|
getTasksByParentSession(sessionID: string): BackgroundTask[];
|
|
75
83
|
getAllDescendantTasks(sessionID: string): BackgroundTask[];
|
|
76
84
|
findBySession(sessionID: string): BackgroundTask | undefined;
|
|
85
|
+
private resolveTaskAttemptBySession;
|
|
77
86
|
private getConcurrencyKeyFromInput;
|
|
78
87
|
/**
|
|
79
88
|
* Track a task created elsewhere (e.g., from task) for notification tracking.
|
|
@@ -16,6 +16,19 @@ export interface TaskProgress {
|
|
|
16
16
|
lastMessage?: string;
|
|
17
17
|
lastMessageAt?: Date;
|
|
18
18
|
}
|
|
19
|
+
export type BackgroundTaskAttemptStatus = BackgroundTaskStatus;
|
|
20
|
+
export interface BackgroundTaskAttempt {
|
|
21
|
+
attemptID: string;
|
|
22
|
+
attemptNumber: number;
|
|
23
|
+
sessionID?: string;
|
|
24
|
+
providerID?: string;
|
|
25
|
+
modelID?: string;
|
|
26
|
+
variant?: string;
|
|
27
|
+
status: BackgroundTaskAttemptStatus;
|
|
28
|
+
error?: string;
|
|
29
|
+
startedAt?: Date;
|
|
30
|
+
completedAt?: Date;
|
|
31
|
+
}
|
|
19
32
|
export interface BackgroundTask {
|
|
20
33
|
id: string;
|
|
21
34
|
sessionID?: string;
|
|
@@ -54,6 +67,17 @@ export interface BackgroundTask {
|
|
|
54
67
|
isUnstableAgent?: boolean;
|
|
55
68
|
/** Category used for this task (e.g., 'quick', 'visual-engineering') */
|
|
56
69
|
category?: string;
|
|
70
|
+
/** Pending retry notification details for the next spawned retry session */
|
|
71
|
+
retryNotification?: {
|
|
72
|
+
previousSessionID?: string;
|
|
73
|
+
failedModel?: string;
|
|
74
|
+
failedError?: string;
|
|
75
|
+
nextModel: string;
|
|
76
|
+
};
|
|
77
|
+
/** Structured attempt history for retry observability */
|
|
78
|
+
attempts?: BackgroundTaskAttempt[];
|
|
79
|
+
/** ID of the currently active attempt */
|
|
80
|
+
currentAttemptID?: string;
|
|
57
81
|
/** Last message count for stability detection */
|
|
58
82
|
lastMsgCount?: number;
|
|
59
83
|
/** Number of consecutive polls with stable message count */
|
|
@@ -3,6 +3,7 @@ import type { ModelFallbackStateController } from "./fallback-state-controller";
|
|
|
3
3
|
export type ModelFallbackControllerAccessor = {
|
|
4
4
|
register: (controller: ModelFallbackStateController) => void;
|
|
5
5
|
setSessionFallbackChain: (sessionID: string, fallbackChain: FallbackEntry[] | undefined) => void;
|
|
6
|
+
getSessionFallbackChain: (sessionID: string) => FallbackEntry[] | undefined;
|
|
6
7
|
clearSessionFallbackChain: (sessionID: string) => void;
|
|
7
8
|
};
|
|
8
9
|
export declare function createModelFallbackControllerAccessor(): ModelFallbackControllerAccessor;
|
|
@@ -10,6 +10,7 @@ type ModelFallbackStateLike = {
|
|
|
10
10
|
export type ModelFallbackStateController = {
|
|
11
11
|
lastToastKey: Map<string, string>;
|
|
12
12
|
setSessionFallbackChain: (sessionID: string, fallbackChain: FallbackEntry[] | undefined) => void;
|
|
13
|
+
getSessionFallbackChain: (sessionID: string) => FallbackEntry[] | undefined;
|
|
13
14
|
clearSessionFallbackChain: (sessionID: string) => void;
|
|
14
15
|
setPendingModelFallback: (sessionID: string, agentName: string, currentProviderID: string, currentModelID: string) => boolean;
|
|
15
16
|
getNextFallback: (sessionID: string) => ReturnType<typeof getNextReachableFallback>;
|
|
@@ -21,7 +21,7 @@ export type ModelFallbackState = {
|
|
|
21
21
|
attemptCount: number;
|
|
22
22
|
pending: boolean;
|
|
23
23
|
};
|
|
24
|
-
type ModelFallbackControllerWithState = Pick<ModelFallbackStateController, "lastToastKey" | "setSessionFallbackChain" | "clearSessionFallbackChain" | "setPendingModelFallback" | "getNextFallback" | "clearPendingModelFallback" | "hasPendingModelFallback" | "getFallbackState" | "reset">;
|
|
24
|
+
type ModelFallbackControllerWithState = Pick<ModelFallbackStateController, "lastToastKey" | "setSessionFallbackChain" | "getSessionFallbackChain" | "clearSessionFallbackChain" | "setPendingModelFallback" | "getNextFallback" | "clearPendingModelFallback" | "hasPendingModelFallback" | "getFallbackState" | "reset">;
|
|
25
25
|
export type ModelFallbackHook = ModelFallbackControllerWithState & {
|
|
26
26
|
"chat.message": (input: ChatMessageInput, output: ChatMessageHandlerOutput) => Promise<void>;
|
|
27
27
|
};
|
|
@@ -32,6 +32,7 @@ type ModelFallbackHookArgs = {
|
|
|
32
32
|
};
|
|
33
33
|
export declare function setSessionFallbackChain(controller: Pick<ModelFallbackStateController, "setSessionFallbackChain">, sessionID: string, fallbackChain: FallbackEntry[] | undefined): void;
|
|
34
34
|
export declare function clearSessionFallbackChain(controller: Pick<ModelFallbackStateController, "clearSessionFallbackChain">, sessionID: string): void;
|
|
35
|
+
export declare function getSessionFallbackChain(controller: Pick<ModelFallbackStateController, "getSessionFallbackChain">, sessionID: string): FallbackEntry[] | undefined;
|
|
35
36
|
/**
|
|
36
37
|
* Sets a pending model fallback for a session.
|
|
37
38
|
* Called when a model error is detected in session.error handler.
|