@the-open-engine/zeroshot 6.6.0 → 6.7.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.
- package/bin/zeroshot-cluster-worker.js +16 -0
- package/cli/commands/providers.js +4 -1
- package/cli/index.js +153 -24
- package/docs/openengine-cluster-protocol/v1/legacy-worker.md +117 -0
- package/lib/agent-cli-provider/adapters/claude.d.ts.map +1 -1
- package/lib/agent-cli-provider/adapters/claude.js +23 -10
- package/lib/agent-cli-provider/adapters/claude.js.map +1 -1
- package/lib/agent-cli-provider/adapters/codex.d.ts.map +1 -1
- package/lib/agent-cli-provider/adapters/codex.js +4 -0
- package/lib/agent-cli-provider/adapters/codex.js.map +1 -1
- package/lib/agent-cli-provider/adapters/common.d.ts.map +1 -1
- package/lib/agent-cli-provider/adapters/common.js +2 -1
- package/lib/agent-cli-provider/adapters/common.js.map +1 -1
- package/lib/agent-cli-provider/contract-options.d.ts.map +1 -1
- package/lib/agent-cli-provider/contract-options.js +2 -1
- package/lib/agent-cli-provider/contract-options.js.map +1 -1
- package/lib/agent-cli-provider/index.d.ts +1 -1
- package/lib/agent-cli-provider/index.d.ts.map +1 -1
- package/lib/agent-cli-provider/index.js.map +1 -1
- package/lib/agent-cli-provider/provider-registry.d.ts +1 -1
- package/lib/agent-cli-provider/provider-registry.js +1 -1
- package/lib/agent-cli-provider/provider-registry.js.map +1 -1
- package/lib/agent-cli-provider/single-agent-runtime.js +6 -2
- package/lib/agent-cli-provider/single-agent-runtime.js.map +1 -1
- package/lib/agent-cli-provider/types.d.ts +3 -1
- package/lib/agent-cli-provider/types.d.ts.map +1 -1
- package/lib/agent-cli-provider/types.js.map +1 -1
- package/lib/cluster-worker/contracts.js +194 -0
- package/lib/cluster-worker/engine-adapter.js +300 -0
- package/lib/cluster-worker/executable.js +229 -0
- package/lib/cluster-worker/index.d.ts +227 -0
- package/lib/cluster-worker/index.js +294 -0
- package/lib/cluster-worker/object-utils.js +17 -0
- package/lib/cluster-worker/process-stdio.js +37 -0
- package/lib/cluster-worker/profiles.js +81 -0
- package/lib/cluster-worker/runtime-engine.js +50 -0
- package/lib/cluster-worker/runtime-support.js +298 -0
- package/lib/cluster-worker/state-machine.js +147 -0
- package/lib/cluster-worker/terminal-normalizer.js +95 -0
- package/lib/cluster-worker/worker-internals.js +20 -0
- package/lib/detached-startup.js +127 -11
- package/lib/process-liveness.js +26 -0
- package/lib/settings.js +1 -0
- package/lib/start-cluster.js +93 -18
- package/package.json +8 -2
- package/protocol/openengine-cluster/v1/worker.schema.json +1174 -0
- package/scripts/assert-release-published.js +65 -11
- package/scripts/run-lint-staged-no-stash.js +68 -0
- package/src/agent/agent-lifecycle.js +368 -91
- package/src/agent/agent-task-executor.js +384 -101
- package/src/agent-cli-provider/adapters/claude.ts +29 -11
- package/src/agent-cli-provider/adapters/codex.ts +4 -0
- package/src/agent-cli-provider/adapters/common.ts +2 -1
- package/src/agent-cli-provider/contract-options.ts +2 -1
- package/src/agent-cli-provider/index.ts +1 -0
- package/src/agent-cli-provider/provider-registry.ts +1 -1
- package/src/agent-cli-provider/single-agent-runtime.ts +8 -2
- package/src/agent-cli-provider/types.ts +3 -1
- package/src/agent-wrapper.js +9 -2
- package/src/config-validator.js +10 -11
- package/src/orchestrator.js +482 -67
- package/task-lib/attachable-watcher.js +10 -1
- package/task-lib/commands/kill.js +34 -9
- package/task-lib/commands/status.js +13 -3
- package/task-lib/process-termination.js +202 -0
- package/task-lib/runner.js +8 -20
- package/task-lib/store.js +28 -6
- package/task-lib/watcher.js +14 -2
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
type ClaudeCliFeatures,
|
|
5
5
|
type CommandSpec,
|
|
6
6
|
type ErrorClassification,
|
|
7
|
-
InvalidProviderModelError,
|
|
8
7
|
type LevelModelSpec,
|
|
9
8
|
type LevelOverrides,
|
|
10
9
|
type ModelCatalogEntry,
|
|
@@ -28,8 +27,23 @@ import { parseClaudeEvent } from './claude-parser';
|
|
|
28
27
|
|
|
29
28
|
const MODEL_CATALOG: Readonly<Record<string, ModelCatalogEntry>> = {
|
|
30
29
|
haiku: { rank: 1 },
|
|
30
|
+
'claude-haiku-4-5': { rank: 1 },
|
|
31
|
+
'claude-haiku-4-5-20251001': { rank: 1 },
|
|
31
32
|
sonnet: { rank: 2 },
|
|
33
|
+
'claude-sonnet-4-5': { rank: 2 },
|
|
34
|
+
'claude-sonnet-4-5-20250929': { rank: 2 },
|
|
35
|
+
'claude-sonnet-4-6': { rank: 2 },
|
|
36
|
+
'claude-sonnet-5': { rank: 2 },
|
|
32
37
|
opus: { rank: 3 },
|
|
38
|
+
'claude-opus-4-5': { rank: 3 },
|
|
39
|
+
'claude-opus-4-5-20251101': { rank: 3 },
|
|
40
|
+
'claude-opus-4-6': { rank: 3 },
|
|
41
|
+
'claude-opus-4-7': { rank: 3 },
|
|
42
|
+
'claude-opus-4-8': { rank: 3 },
|
|
43
|
+
fable: { rank: 3 },
|
|
44
|
+
'claude-fable-5': { rank: 3 },
|
|
45
|
+
'claude-mythos-5': { rank: 3 },
|
|
46
|
+
'claude-mythos-preview': { rank: 3 },
|
|
33
47
|
};
|
|
34
48
|
|
|
35
49
|
const LEVEL_MAPPING: Readonly<Record<ModelLevel, LevelModelSpec>> = {
|
|
@@ -50,6 +64,7 @@ function detectCliFeatures(helpText?: string | null): ClaudeCliFeatures {
|
|
|
50
64
|
supportsIncludePartials: unknown ? true : /--include-partial-messages/.test(help),
|
|
51
65
|
supportsVerbose: unknown ? true : /--verbose/.test(help),
|
|
52
66
|
supportsModel: unknown ? true : /--model/.test(help),
|
|
67
|
+
supportsEffort: unknown ? true : /--effort/.test(help),
|
|
53
68
|
unknown,
|
|
54
69
|
};
|
|
55
70
|
}
|
|
@@ -86,6 +101,9 @@ function addModelArgs(args: string[], options: BuildProviderCommandOptions): voi
|
|
|
86
101
|
if (options.modelSpec?.model && features.supportsModel !== false) {
|
|
87
102
|
args.push('--model', options.modelSpec.model);
|
|
88
103
|
}
|
|
104
|
+
if (options.modelSpec?.reasoningEffort && features.supportsEffort !== false) {
|
|
105
|
+
args.push('--effort', options.modelSpec.reasoningEffort);
|
|
106
|
+
}
|
|
89
107
|
}
|
|
90
108
|
|
|
91
109
|
function addAutoApproveArgs(args: string[], options: BuildProviderCommandOptions): void {
|
|
@@ -139,6 +157,15 @@ function collectWarnings(options: BuildProviderCommandOptions): WarningMetadata[
|
|
|
139
157
|
)
|
|
140
158
|
);
|
|
141
159
|
}
|
|
160
|
+
if (options.modelSpec?.reasoningEffort && features.supportsEffort === false) {
|
|
161
|
+
warnings.push(
|
|
162
|
+
warning(
|
|
163
|
+
'claude',
|
|
164
|
+
'claude-reasoning',
|
|
165
|
+
'Claude CLI does not support --effort; skipping reasoningEffort.'
|
|
166
|
+
)
|
|
167
|
+
);
|
|
168
|
+
}
|
|
142
169
|
return warnings;
|
|
143
170
|
}
|
|
144
171
|
|
|
@@ -176,16 +203,7 @@ function resolveModelSpec(level: ModelLevel, overrides?: LevelOverrides): Resolv
|
|
|
176
203
|
}
|
|
177
204
|
|
|
178
205
|
function validateModelId(modelId: string | null | undefined): string | null | undefined {
|
|
179
|
-
|
|
180
|
-
return validateModelIdFromCatalog('claude', MODEL_CATALOG, modelId);
|
|
181
|
-
} catch (error) {
|
|
182
|
-
if (modelId && (modelId === 'opus-4.6' || modelId === 'claude-opus-4-6')) {
|
|
183
|
-
throw new InvalidProviderModelError(
|
|
184
|
-
`Invalid model "${modelId}" for provider "claude". Use canonical model ids: haiku, sonnet, opus.`
|
|
185
|
-
);
|
|
186
|
-
}
|
|
187
|
-
throw error;
|
|
188
|
-
}
|
|
206
|
+
return validateModelIdFromCatalog('claude', MODEL_CATALOG, modelId);
|
|
189
207
|
}
|
|
190
208
|
|
|
191
209
|
function classifyError(error: unknown): ErrorClassification {
|
|
@@ -27,6 +27,10 @@ import { parseCodexEvent } from './codex-parser';
|
|
|
27
27
|
const MODEL_CATALOG: Readonly<Record<string, ModelCatalogEntry>> = {
|
|
28
28
|
'gpt-5.4': { rank: 2 },
|
|
29
29
|
'gpt-5.5': { rank: 3 },
|
|
30
|
+
'gpt-5.6': { rank: 3 },
|
|
31
|
+
'gpt-5.6-sol': { rank: 3 },
|
|
32
|
+
'gpt-5.6-terra': { rank: 2 },
|
|
33
|
+
'gpt-5.6-luna': { rank: 1 },
|
|
30
34
|
};
|
|
31
35
|
|
|
32
36
|
const LEVEL_MAPPING: Readonly<Record<ModelLevel, LevelModelSpec>> = {
|
|
@@ -100,8 +100,9 @@ export function validateModelIdFromCatalog(
|
|
|
100
100
|
): string | null | undefined {
|
|
101
101
|
if (!modelId) return modelId;
|
|
102
102
|
if (catalog[modelId] !== undefined) return modelId;
|
|
103
|
+
const validModels = Object.keys(catalog).join(', ');
|
|
103
104
|
throw new InvalidProviderModelError(
|
|
104
|
-
`Invalid model "${modelId}" for provider "${provider}".
|
|
105
|
+
`Invalid model "${modelId}" for provider "${provider}". Valid models: ${validModels}.`
|
|
105
106
|
);
|
|
106
107
|
}
|
|
107
108
|
|
|
@@ -13,7 +13,7 @@ import type {
|
|
|
13
13
|
|
|
14
14
|
const OUTPUT_FORMATS: readonly OutputFormat[] = ['text', 'json', 'stream-json'];
|
|
15
15
|
const MODEL_LEVELS: readonly ModelLevel[] = ['level1', 'level2', 'level3'];
|
|
16
|
-
const REASONING_EFFORTS: readonly ReasoningEffort[] = ['low', 'medium', 'high', 'xhigh'];
|
|
16
|
+
const REASONING_EFFORTS: readonly ReasoningEffort[] = ['low', 'medium', 'high', 'xhigh', 'max'];
|
|
17
17
|
const CLI_FEATURE_FIELDS = [
|
|
18
18
|
'supportsOutputFormat',
|
|
19
19
|
'supportsStreamJson',
|
|
@@ -22,6 +22,7 @@ const CLI_FEATURE_FIELDS = [
|
|
|
22
22
|
'supportsIncludePartials',
|
|
23
23
|
'supportsVerbose',
|
|
24
24
|
'supportsModel',
|
|
25
|
+
'supportsEffort',
|
|
25
26
|
'supportsJson',
|
|
26
27
|
'supportsOutputSchema',
|
|
27
28
|
'supportsDir',
|
|
@@ -61,7 +61,7 @@ type MutableModelSpec = {
|
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
const MODEL_LEVELS: readonly ModelLevel[] = ['level1', 'level2', 'level3'];
|
|
64
|
-
const REASONING_EFFORTS: readonly ReasoningEffort[] = ['low', 'medium', 'high', 'xhigh'];
|
|
64
|
+
const REASONING_EFFORTS: readonly ReasoningEffort[] = ['low', 'medium', 'high', 'xhigh', 'max'];
|
|
65
65
|
const settingsModule: unknown = require('../../lib/settings');
|
|
66
66
|
const providerDetectionModule: unknown = require('../../lib/provider-detection');
|
|
67
67
|
const claudeAuthModule: unknown = require('../../lib/settings/claude-auth');
|
|
@@ -420,7 +420,13 @@ function optionalModelLevel(value: unknown, field: string): ModelLevel | undefin
|
|
|
420
420
|
|
|
421
421
|
function optionalReasoningEffort(value: unknown, field: string): ReasoningEffort | undefined {
|
|
422
422
|
if (value === undefined) return undefined;
|
|
423
|
-
if (
|
|
423
|
+
if (
|
|
424
|
+
value === 'low' ||
|
|
425
|
+
value === 'medium' ||
|
|
426
|
+
value === 'high' ||
|
|
427
|
+
value === 'xhigh' ||
|
|
428
|
+
value === 'max'
|
|
429
|
+
) {
|
|
424
430
|
return value;
|
|
425
431
|
}
|
|
426
432
|
throw new Error(`${field} must be one of: ${REASONING_EFFORTS.join(', ')}.`);
|
|
@@ -15,7 +15,7 @@ export type ProviderId = (typeof providerIds)[number];
|
|
|
15
15
|
export type ProviderAlias = (typeof providerAliases)[number];
|
|
16
16
|
export type KnownProviderName = ProviderId | ProviderAlias;
|
|
17
17
|
export type ModelLevel = 'level1' | 'level2' | 'level3';
|
|
18
|
-
export type ReasoningEffort = 'low' | 'medium' | 'high' | 'xhigh';
|
|
18
|
+
export type ReasoningEffort = 'low' | 'medium' | 'high' | 'xhigh' | 'max';
|
|
19
19
|
export type OutputFormat = 'text' | 'json' | 'stream-json';
|
|
20
20
|
export type {
|
|
21
21
|
ProviderCapabilities,
|
|
@@ -95,6 +95,7 @@ export interface ClaudeCliFeatures extends BaseCliFeatures {
|
|
|
95
95
|
readonly supportsIncludePartials: boolean;
|
|
96
96
|
readonly supportsVerbose: boolean;
|
|
97
97
|
readonly supportsModel: boolean;
|
|
98
|
+
readonly supportsEffort: boolean;
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
export interface CodexCliFeatures extends BaseCliFeatures {
|
|
@@ -186,6 +187,7 @@ export interface CliFeatureOverrides {
|
|
|
186
187
|
readonly supportsIncludePartials?: boolean;
|
|
187
188
|
readonly supportsVerbose?: boolean;
|
|
188
189
|
readonly supportsModel?: boolean;
|
|
190
|
+
readonly supportsEffort?: boolean;
|
|
189
191
|
readonly supportsJson?: boolean;
|
|
190
192
|
readonly supportsOutputSchema?: boolean;
|
|
191
193
|
readonly supportsDir?: boolean;
|
package/src/agent-wrapper.js
CHANGED
|
@@ -81,8 +81,15 @@ class AgentWrapper {
|
|
|
81
81
|
// LIVENESS DETECTION - Track output freshness to detect stuck agents
|
|
82
82
|
/** @type {number | null} */
|
|
83
83
|
this.lastOutputTime = null; // Timestamp of last output received
|
|
84
|
+
/** @type {number | null} */
|
|
85
|
+
this.taskStartedAt = null; // Timestamp used for absolute task timeout
|
|
84
86
|
/** @type {NodeJS.Timeout | null} */
|
|
85
87
|
this.livenessCheckInterval = null; // Interval for health checks
|
|
88
|
+
this.consecutiveStaleWarnings = 0;
|
|
89
|
+
this.livenessTerminationStarted = false;
|
|
90
|
+
this.livenessTerminationContext = null;
|
|
91
|
+
this.livenessTerminationAttempts = 0;
|
|
92
|
+
this.livenessTerminationRetryAt = 0;
|
|
86
93
|
this.staleDuration = normalizedConfig.staleDuration;
|
|
87
94
|
this.enableLivenessCheck = normalizedConfig.enableLivenessCheck;
|
|
88
95
|
|
|
@@ -499,8 +506,8 @@ class AgentWrapper {
|
|
|
499
506
|
* Kill current task
|
|
500
507
|
* @private
|
|
501
508
|
*/
|
|
502
|
-
_killTask() {
|
|
503
|
-
return killTask(this);
|
|
509
|
+
_killTask(reason) {
|
|
510
|
+
return killTask(this, reason);
|
|
504
511
|
}
|
|
505
512
|
|
|
506
513
|
/**
|
package/src/config-validator.js
CHANGED
|
@@ -21,6 +21,9 @@ const { getProvider } = require('./providers');
|
|
|
21
21
|
const { CAPABILITIES } = require('./providers/capabilities');
|
|
22
22
|
const { GUIDANCE_TOPICS } = require('./guidance-topics');
|
|
23
23
|
|
|
24
|
+
const REASONING_EFFORTS = Object.freeze(['low', 'medium', 'high', 'xhigh', 'max']);
|
|
25
|
+
const REASONING_EFFORT_LABEL = REASONING_EFFORTS.join('|');
|
|
26
|
+
|
|
24
27
|
const HOOK_ACTION_TOPIC_CONTRACTS = Object.freeze({
|
|
25
28
|
verify_pull_request: Object.freeze([
|
|
26
29
|
{ topic: 'CLUSTER_COMPLETE', keys: null },
|
|
@@ -2054,14 +2057,13 @@ function validateProviderSettings(provider, providerSettings) {
|
|
|
2054
2057
|
providerModule.validateModelId(override.model);
|
|
2055
2058
|
}
|
|
2056
2059
|
if (override?.reasoningEffort && !providerSupportsCapability(provider, 'reasoningEffort')) {
|
|
2057
|
-
throw new Error(
|
|
2060
|
+
throw new Error(
|
|
2061
|
+
`reasoningEffort overrides are only supported for Claude, Codex, and Opencode`
|
|
2062
|
+
);
|
|
2058
2063
|
}
|
|
2059
|
-
if (
|
|
2060
|
-
override?.reasoningEffort &&
|
|
2061
|
-
!['low', 'medium', 'high', 'xhigh'].includes(override.reasoningEffort)
|
|
2062
|
-
) {
|
|
2064
|
+
if (override?.reasoningEffort && !REASONING_EFFORTS.includes(override.reasoningEffort)) {
|
|
2063
2065
|
throw new Error(
|
|
2064
|
-
`Invalid reasoningEffort "${override.reasoningEffort}" (
|
|
2066
|
+
`Invalid reasoningEffort "${override.reasoningEffort}" (${REASONING_EFFORT_LABEL})`
|
|
2065
2067
|
);
|
|
2066
2068
|
}
|
|
2067
2069
|
}
|
|
@@ -2172,12 +2174,9 @@ function validateModelRulesSupport(agent, provider, providerModule, levels, warn
|
|
|
2172
2174
|
function validateReasoningEffortSupport(agent, provider, warnings) {
|
|
2173
2175
|
if (agent.reasoningEffort && !providerSupportsCapability(provider, 'reasoningEffort')) {
|
|
2174
2176
|
warnings.push(`Agent "${agent.id}" sets reasoningEffort but ${provider} does not support it`);
|
|
2175
|
-
} else if (
|
|
2176
|
-
agent.reasoningEffort &&
|
|
2177
|
-
!['low', 'medium', 'high', 'xhigh'].includes(agent.reasoningEffort)
|
|
2178
|
-
) {
|
|
2177
|
+
} else if (agent.reasoningEffort && !REASONING_EFFORTS.includes(agent.reasoningEffort)) {
|
|
2179
2178
|
warnings.push(
|
|
2180
|
-
`Agent "${agent.id}" has invalid reasoningEffort "${agent.reasoningEffort}" (
|
|
2179
|
+
`Agent "${agent.id}" has invalid reasoningEffort "${agent.reasoningEffort}" (${REASONING_EFFORT_LABEL})`
|
|
2181
2180
|
);
|
|
2182
2181
|
}
|
|
2183
2182
|
}
|