aptly 0.1.16 → 0.1.18
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/src/catalog.js +5 -2
- package/dist/src/context-retry.js +19 -8
- package/dist/src/core.js +1 -0
- package/dist/src/model-info.js +6 -3
- package/dist/src/recovery-application.d.ts +96 -0
- package/dist/src/recovery-application.js +59 -0
- package/dist/src/server.js +1 -1
- package/dist/src/setup.js +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/docs/ADVISORY_USAGE.md +4 -2
- package/docs/SPAWN_CONTEXT.md +10 -0
- package/docs/guide/en/advanced.md +4 -2
- package/docs/guide/en/configuration.md +4 -2
- package/docs/guide/ja/advanced.md +4 -2
- package/docs/guide/ja/configuration.md +4 -2
- package/docs/guide/ko/advanced.md +4 -2
- package/docs/guide/ko/configuration.md +4 -2
- package/docs/guide/zh-CN/advanced.md +4 -2
- package/docs/guide/zh-CN/configuration.md +4 -2
- package/package.json +1 -1
package/dist/src/catalog.js
CHANGED
|
@@ -8,9 +8,12 @@ const entries = [
|
|
|
8
8
|
{ profile: { id: 'codex-routine', client: 'codex', model: 'gpt-6.1-terra', reasoning_effort: 'high' }, tier: 'standard',
|
|
9
9
|
task: 'Context-aware writing or translation, everyday analysis, or clearly scoped implementation.',
|
|
10
10
|
fact: 'Fast and efficient for writing, visual understanding, and computer use.', source: codexSource, default: true },
|
|
11
|
-
{ profile: { id: 'codex-deep', client: 'codex', model: 'gpt-6.
|
|
11
|
+
{ profile: { id: 'codex-deep', client: 'codex', model: 'gpt-6.2-sol', reasoning_effort: 'medium' }, tier: 'deep',
|
|
12
12
|
task: 'Cross-component debugging, architectural tradeoffs, or demanding accuracy-sensitive review.',
|
|
13
|
-
fact: '
|
|
13
|
+
fact: 'Supports everyday coding, writing, and work across several sources.', source: codexSource, default: true },
|
|
14
|
+
{ profile: { id: 'codex-deep-legacy', client: 'codex', model: 'gpt-6.1-sol', reasoning_effort: 'medium' }, tier: 'deep',
|
|
15
|
+
task: 'Cross-component debugging, architectural tradeoffs, or demanding accuracy-sensitive review.',
|
|
16
|
+
fact: 'Near-Astra capability for complex, repeated and long-running work at lower cost than Astra.', source: codexSource, default: false },
|
|
14
17
|
{ profile: { id: 'claude-simple', client: 'claude', model: 'haiku' }, tier: 'simple',
|
|
15
18
|
task: 'Bounded extraction, format conversion, wording cleanup, or small mechanical edits.',
|
|
16
19
|
fact: 'Fast and efficient for simple tasks.', source: claudeSource, default: true },
|
|
@@ -4,6 +4,7 @@ import { join } from 'node:path';
|
|
|
4
4
|
import { effectiveTransmission, loadAutomaticHookPolicy } from './automatic-hook.js';
|
|
5
5
|
import { assertPrivateStatePath, readRegularFile } from './files.js';
|
|
6
6
|
import { hasSufficientTaskText } from './context-sufficiency.js';
|
|
7
|
+
import { validRecoveryApplication } from './recovery-application.js';
|
|
7
8
|
const hash = (value) => createHash('sha256').update(JSON.stringify(value)).digest('hex');
|
|
8
9
|
/** One caller-supplied supplement, never an automatic native spawn or a retry chain. */
|
|
9
10
|
export class ContextRetries {
|
|
@@ -162,14 +163,21 @@ export class ContextRetries {
|
|
|
162
163
|
...(entry.seed.fill_model !== false ? { model: result.profile.model } : {}),
|
|
163
164
|
...(entry.seed.client === 'codex' && entry.seed.fill_effort !== false && result.profile.reasoning_effort ? { reasoning_effort: result.profile.reasoning_effort } : {})
|
|
164
165
|
} : undefined;
|
|
165
|
-
|
|
166
|
+
const response = { ...result, retry_id, request_id, context_retry_allowed: false,
|
|
166
167
|
spawn_application: { status: entry.seed.application_blocked ? 'blocked' : 'caller_review_required',
|
|
167
|
-
reason: entry.seed.application_blocked ?? 'native_execution_not_observed' },
|
|
168
|
+
reason: entry.seed.application_blocked ?? 'native_execution_not_observed', ...(defaults ? { required_fields: Object.keys(defaults), on_unavailable: 'stop_and_report', next_action: 'apply_returned_defaults' } : {}) },
|
|
168
169
|
...(defaults ? { next_call: { tool: entry.seed.client === 'claude' ? 'Agent' : 'spawn_agent', set_if_unspecified: defaults, preserve: 'all_other_arguments_and_history' } } : {}),
|
|
169
170
|
next_step: result.status === 'recommended'
|
|
170
171
|
? entry.seed.application_blocked ? `Report the application constraint and preserve original history and arguments for the ORIGINAL invocation. This profile is advice only. ${entry.seed.fresh_eligible ? 'This is the SAME task but a NEW invocation, not a retry of the original call. Use only the separate caller-declared preparation protocol offered below. Only after the host reports the original tool call blocked, if you can declare that this is the same independent task, the user does not require inherited history, and you can supply complete standalone instructions, call prepare_fresh_delegation with this retry_id, task_name, standalone_task and declaration {independent_task:true,same_task:true,original_call_outcome:"blocked",history_requirement:"not_required",standalone_context_complete:true}. It prepares a separate fresh invocation without a new classification. Never use it when history is required or unknown, or when original execution is unknown.' : ''}`
|
|
171
|
-
: `Context supplementation is complete; do not call retry_spawn_recommendation again. Caller review means the parent checks arguments, not a request for new user approval. To perform the already requested delegation, on the next native ${entry.seed.client === 'claude' ? 'Agent' : 'spawn_agent'} call, include these previously unspecified fields: ${JSON.stringify(defaults)}. Do not submit another model/effort-omitted call: it will be blocked again. Preserve all other arguments, explicit choices, history, roles and permissions. This response does not execute a child.`
|
|
172
|
+
: `Context supplementation is complete; do not call retry_spawn_recommendation again. Apply only the returned unspecified fields under existing delegation and host permissions. If user choices or higher-priority host rules prohibit these fields, or applicability is unclear, stop and report the limitation. Caller review means the parent checks arguments, not a request for new user approval. To perform the already requested delegation, on the next native ${entry.seed.client === 'claude' ? 'Agent' : 'spawn_agent'} call, include these previously unspecified fields: ${JSON.stringify(defaults)}. Do not submit another model/effort-omitted call: it will be blocked again. Preserve all other arguments, explicit choices, history, roles and permissions. This response does not execute a child.`
|
|
172
173
|
: 'Stop this recovery attempt. Report the outcome; do not create another retry ID or spawn with an unresolved recommendation.' };
|
|
174
|
+
response.next_step += ' Existing-agent reuse is an alternative path, not evidence that this recommendation was applied.';
|
|
175
|
+
const protectedFields = [];
|
|
176
|
+
if (entry.seed.fill_model === false)
|
|
177
|
+
protectedFields.push('model');
|
|
178
|
+
if (entry.seed.fill_effort === false)
|
|
179
|
+
protectedFields.push('reasoning_effort');
|
|
180
|
+
return validRecoveryApplication(response, entry.seed.client, protectedFields) ? response : unavailable('recovery_metadata_invalid');
|
|
173
181
|
}
|
|
174
182
|
finally {
|
|
175
183
|
entry.active = false;
|
|
@@ -218,6 +226,13 @@ export class ContextRetries {
|
|
|
218
226
|
if (!profile || !entry.seed.eligible_profile_ids.includes(profile.id) || hash(profile) !== hash(result.profile) || result.policy_version !== this.router.policy.version || result.catalog_version !== this.router.policy.catalog_version)
|
|
219
227
|
return reject('profile_changed');
|
|
220
228
|
const preparation_id = hash(['aptly-fresh-delegation-v1', retry_id]);
|
|
229
|
+
const response = { status: 'prepared', reason: 'caller_declared_independent', application: 'advisory_only', source_retry_id: retry_id, preparation_id,
|
|
230
|
+
profile_id: profile.id, profile: structuredClone(profile), intent_provenance: 'caller_declared_not_verified', original_invocation: 'deny_returned_execution_not_observed', execution: 'not_observed',
|
|
231
|
+
spawn_application: { status: 'caller_review_required', reason: 'explicit_profile_arguments_required', required_fields: ['model', 'reasoning_effort'], on_unavailable: 'stop_and_report', next_action: 'submit_prepared_call' },
|
|
232
|
+
next_call: { tool: 'spawn_agent', arguments: { task_name, message: standalone_task, fork_turns: 'none', model: profile.model, reasoning_effort: profile.reasoning_effort } },
|
|
233
|
+
next_step: 'Caller review means checking the arguments, not requesting new user approval. Only after a host-reported blocked outcome, review and submit the separate next_call.arguments under existing delegation authorization and unchanged host permissions. Include every returned argument, especially the explicit model and reasoning_effort; do not omit them or submit a model/effort-omitted replacement, which may trigger context recovery again. If explicit user choices or higher-priority host instructions require parent-model inheritance or forbid either profile field, stop and report that the prepared profile cannot be applied. Do not use another recovery ticket to bypass that restriction. If it is unclear whether a user or host constraint permits applying either field, stop and report the uncertainty rather than guessing or dropping fields. Task prose is not permission to override those constraints. Original arguments were not rewritten; host execution is not observed by this server. Do not add history/role/resume overrides or reuse this preparation for another task. Preparation does not prove interception, permission approval, single execution or child execution.' };
|
|
234
|
+
if (!validRecoveryApplication(response, 'codex'))
|
|
235
|
+
return reject('recovery_metadata_invalid');
|
|
221
236
|
const fingerprint = hash([entry.seed, entry.catalog, profile, declaration, task_name, standalone_task]);
|
|
222
237
|
const policy = loadAutomaticHookPolicy(this.policyPath).policy;
|
|
223
238
|
if (!policy)
|
|
@@ -245,11 +260,7 @@ export class ContextRetries {
|
|
|
245
260
|
const changed = this.current(entry, signal);
|
|
246
261
|
if (changed)
|
|
247
262
|
return reject(changed);
|
|
248
|
-
return
|
|
249
|
-
profile_id: profile.id, profile: structuredClone(profile), intent_provenance: 'caller_declared_not_verified', original_invocation: 'deny_returned_execution_not_observed', execution: 'not_observed',
|
|
250
|
-
spawn_application: { status: 'caller_review_required', reason: 'explicit_profile_arguments_required', required_fields: ['model', 'reasoning_effort'], on_unavailable: 'stop_and_report' },
|
|
251
|
-
next_call: { tool: 'spawn_agent', arguments: { task_name, message: standalone_task, fork_turns: 'none', model: profile.model, reasoning_effort: profile.reasoning_effort } },
|
|
252
|
-
next_step: 'Caller review means checking the arguments, not requesting new user approval. Only after a host-reported blocked outcome, review and submit the separate next_call.arguments under existing delegation authorization and unchanged host permissions. Include every returned argument, especially the explicit model and reasoning_effort; do not omit them or submit a model/effort-omitted replacement, which may trigger context recovery again. If explicit user choices or higher-priority host instructions require parent-model inheritance or forbid either profile field, stop and report that the prepared profile cannot be applied. Do not use another recovery ticket to bypass that restriction. If it is unclear whether a user or host constraint permits applying either field, stop and report the uncertainty rather than guessing or dropping fields. Task prose is not permission to override those constraints. Original arguments were not rewritten; host execution is not observed by this server. Do not add history/role/resume overrides or reuse this preparation for another task. Preparation does not prove interception, permission approval, single execution or child execution.' };
|
|
263
|
+
return response;
|
|
253
264
|
}
|
|
254
265
|
catch {
|
|
255
266
|
return reject('fresh_delegation_unavailable');
|
package/dist/src/core.js
CHANGED
|
@@ -38,6 +38,7 @@ const supportedProfile = (p) => isSupportedProfile(p);
|
|
|
38
38
|
// Storage compatibility only. These retired tuples may be read from an old
|
|
39
39
|
// ledger, but do not enter the runtime catalog or grant Hook execution rights.
|
|
40
40
|
const legacyStoredProfiles = [
|
|
41
|
+
{ id: 'codex-deep', client: 'codex', model: 'gpt-6.1-sol', reasoning_effort: 'medium' },
|
|
41
42
|
{ id: 'codex-routine', client: 'codex', model: 'gpt-6.1-sol', reasoning_effort: 'low' },
|
|
42
43
|
{ id: 'codex-deep', client: 'codex', model: 'gpt-6-astra', reasoning_effort: 'high' },
|
|
43
44
|
{ id: 'claude-routine', client: 'claude', model: 'haiku' },
|
package/dist/src/model-info.js
CHANGED
|
@@ -9,7 +9,7 @@ export const modelInfoUrls = Object.freeze([
|
|
|
9
9
|
'https://learn.chatgpt.com/docs/models.md',
|
|
10
10
|
]);
|
|
11
11
|
const aliases = ['haiku', 'sonnet', 'opus', 'fable'];
|
|
12
|
-
const codexModels = ['gpt-6-luna', 'gpt-6.1-terra', 'gpt-6.1-sol', 'gpt-6-astra'];
|
|
12
|
+
const codexModels = ['gpt-6-luna', 'gpt-6.1-terra', 'gpt-6.1-sol', 'gpt-6-astra', 'gpt-6.2-sol'];
|
|
13
13
|
const maximumBody = 256 * 1024, maximumSnapshot = 32 * 1024, ttl = 7 * 24 * 60 * 60 * 1000;
|
|
14
14
|
const fail = (code) => Object.assign(new Error(code), { code });
|
|
15
15
|
const own = (v, k) => Object.hasOwn(v, k);
|
|
@@ -25,7 +25,7 @@ function validate(value) {
|
|
|
25
25
|
if (!exact(value, ['schema_version', 'fetched_at', 'sources', 'facts']) || value.schema_version !== 1 || typeof value.fetched_at !== 'string' ||
|
|
26
26
|
!/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d\.\d{3}Z$/.test(value.fetched_at) || !Number.isFinite(Date.parse(value.fetched_at)) ||
|
|
27
27
|
new Date(value.fetched_at).toISOString() !== value.fetched_at || !Array.isArray(value.sources) || value.sources.length !== 2 ||
|
|
28
|
-
!Array.isArray(value.facts) || value.facts.length
|
|
28
|
+
!Array.isArray(value.facts) || ![8, 9].includes(value.facts.length))
|
|
29
29
|
throw fail('model_info_invalid');
|
|
30
30
|
const sources = value.sources.map((s, i) => {
|
|
31
31
|
if (!exact(s, ['url', 'sha256']) || typeof s.url !== 'string' || s.url !== modelInfoUrls[i] || typeof s.sha256 !== 'string' || !/^[a-f0-9]{64}$/.test(s.sha256))
|
|
@@ -43,6 +43,9 @@ function validate(value) {
|
|
|
43
43
|
seen.add(key);
|
|
44
44
|
return { client: f.client, model: f.model, description: f.description };
|
|
45
45
|
});
|
|
46
|
+
// Eight-fact caches from older versions remain usable; the new model uses its bundled fact.
|
|
47
|
+
if (facts.length === 8 && seen.has('codex:gpt-6.2-sol'))
|
|
48
|
+
throw fail('model_info_invalid');
|
|
46
49
|
const snapshot = { schema_version: 1, fetched_at: value.fetched_at, sources, facts };
|
|
47
50
|
if (Buffer.byteLength(JSON.stringify(snapshot)) > maximumSnapshot)
|
|
48
51
|
throw fail('model_info_invalid');
|
|
@@ -73,7 +76,7 @@ function parseCodex(markdown) {
|
|
|
73
76
|
throw fail('model_info_parse_failed');
|
|
74
77
|
const blocks = section.match(/<ModelDetails\b[\s\S]*?\n\s*\/>/g) ?? [];
|
|
75
78
|
return codexModels.map(model => {
|
|
76
|
-
const entries = blocks.filter(b => new RegExp('\\
|
|
79
|
+
const entries = blocks.filter(b => new RegExp('\\b(?:slug|name)="' + model.replaceAll('.', '\\.') + '"').test(b));
|
|
77
80
|
if (entries.length !== 1)
|
|
78
81
|
throw fail('model_info_parse_failed');
|
|
79
82
|
const values = [...entries[0].matchAll(/\bdescription="([^"\r\n]*)"/g)];
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { Client } from './types.ts';
|
|
3
|
+
/** Output coherence only: not host authorization, dispatch or profile availability. */
|
|
4
|
+
export declare const recoveryApplicationSchema: z.ZodObject<{
|
|
5
|
+
client: z.ZodEnum<{
|
|
6
|
+
claude: "claude";
|
|
7
|
+
codex: "codex";
|
|
8
|
+
}>;
|
|
9
|
+
status: z.ZodEnum<{
|
|
10
|
+
keep_current: "keep_current";
|
|
11
|
+
needs_context: "needs_context";
|
|
12
|
+
prepared: "prepared";
|
|
13
|
+
recommended: "recommended";
|
|
14
|
+
unavailable: "unavailable";
|
|
15
|
+
}>;
|
|
16
|
+
application: z.ZodLiteral<"advisory_only">;
|
|
17
|
+
execution: z.ZodOptional<z.ZodLiteral<"not_observed">>;
|
|
18
|
+
profile: z.ZodOptional<z.ZodObject<{
|
|
19
|
+
id: z.ZodString;
|
|
20
|
+
client: z.ZodEnum<{
|
|
21
|
+
claude: "claude";
|
|
22
|
+
codex: "codex";
|
|
23
|
+
}>;
|
|
24
|
+
model: z.ZodString;
|
|
25
|
+
reasoning_effort: z.ZodOptional<z.ZodEnum<{
|
|
26
|
+
high: "high";
|
|
27
|
+
low: "low";
|
|
28
|
+
max: "max";
|
|
29
|
+
medium: "medium";
|
|
30
|
+
minimal: "minimal";
|
|
31
|
+
xhigh: "xhigh";
|
|
32
|
+
}>>;
|
|
33
|
+
}, z.core.$strict>>;
|
|
34
|
+
spawn_application: z.ZodUnion<readonly [z.ZodObject<{
|
|
35
|
+
status: z.ZodLiteral<"caller_review_required">;
|
|
36
|
+
reason: z.ZodEnum<{
|
|
37
|
+
explicit_profile_arguments_required: "explicit_profile_arguments_required";
|
|
38
|
+
native_execution_not_observed: "native_execution_not_observed";
|
|
39
|
+
}>;
|
|
40
|
+
required_fields: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
41
|
+
model: "model";
|
|
42
|
+
reasoning_effort: "reasoning_effort";
|
|
43
|
+
}>>>;
|
|
44
|
+
on_unavailable: z.ZodOptional<z.ZodLiteral<"stop_and_report">>;
|
|
45
|
+
next_action: z.ZodOptional<z.ZodEnum<{
|
|
46
|
+
apply_returned_defaults: "apply_returned_defaults";
|
|
47
|
+
submit_prepared_call: "submit_prepared_call";
|
|
48
|
+
}>>;
|
|
49
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
50
|
+
status: z.ZodLiteral<"blocked">;
|
|
51
|
+
reason: z.ZodEnum<{
|
|
52
|
+
effort_argument_unsupported: "effort_argument_unsupported";
|
|
53
|
+
history_semantics_unverified: "history_semantics_unverified";
|
|
54
|
+
inherited_context_application_unverified: "inherited_context_application_unverified";
|
|
55
|
+
}>;
|
|
56
|
+
}, z.core.$strict>]>;
|
|
57
|
+
next_call: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
58
|
+
tool: z.ZodEnum<{
|
|
59
|
+
Agent: "Agent";
|
|
60
|
+
spawn_agent: "spawn_agent";
|
|
61
|
+
}>;
|
|
62
|
+
set_if_unspecified: z.ZodObject<{
|
|
63
|
+
model: z.ZodOptional<z.ZodString>;
|
|
64
|
+
reasoning_effort: z.ZodOptional<z.ZodEnum<{
|
|
65
|
+
high: "high";
|
|
66
|
+
low: "low";
|
|
67
|
+
max: "max";
|
|
68
|
+
medium: "medium";
|
|
69
|
+
minimal: "minimal";
|
|
70
|
+
xhigh: "xhigh";
|
|
71
|
+
}>>;
|
|
72
|
+
}, z.core.$strict>;
|
|
73
|
+
preserve: z.ZodLiteral<"all_other_arguments_and_history">;
|
|
74
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
75
|
+
tool: z.ZodLiteral<"spawn_agent">;
|
|
76
|
+
arguments: z.ZodObject<{
|
|
77
|
+
task_name: z.ZodString;
|
|
78
|
+
message: z.ZodString;
|
|
79
|
+
fork_turns: z.ZodLiteral<"none">;
|
|
80
|
+
model: z.ZodString;
|
|
81
|
+
reasoning_effort: z.ZodEnum<{
|
|
82
|
+
high: "high";
|
|
83
|
+
low: "low";
|
|
84
|
+
max: "max";
|
|
85
|
+
medium: "medium";
|
|
86
|
+
minimal: "minimal";
|
|
87
|
+
xhigh: "xhigh";
|
|
88
|
+
}>;
|
|
89
|
+
}, z.core.$strict>;
|
|
90
|
+
}, z.core.$strict>]>>;
|
|
91
|
+
protected_fields: z.ZodArray<z.ZodEnum<{
|
|
92
|
+
model: "model";
|
|
93
|
+
reasoning_effort: "reasoning_effort";
|
|
94
|
+
}>>;
|
|
95
|
+
}, z.core.$strict>;
|
|
96
|
+
export declare function validRecoveryApplication(result: Record<string, unknown>, client: Client, protectedFields?: ('model' | 'reasoning_effort')[]): boolean;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const field = z.enum(['model', 'reasoning_effort']);
|
|
3
|
+
const effort = z.enum(['minimal', 'low', 'medium', 'high', 'xhigh', 'max']);
|
|
4
|
+
const defaults = z.strictObject({ model: z.string().min(1).max(256).optional(), reasoning_effort: effort.optional() });
|
|
5
|
+
const review = z.strictObject({ status: z.literal('caller_review_required'), reason: z.enum(['native_execution_not_observed', 'explicit_profile_arguments_required']),
|
|
6
|
+
required_fields: z.array(field).min(1).max(2).optional(), on_unavailable: z.literal('stop_and_report').optional(),
|
|
7
|
+
next_action: z.enum(['apply_returned_defaults', 'submit_prepared_call']).optional() });
|
|
8
|
+
const blocked = z.strictObject({ status: z.literal('blocked'), reason: z.enum(['inherited_context_application_unverified', 'history_semantics_unverified', 'effort_argument_unsupported']) });
|
|
9
|
+
const retryCall = z.strictObject({ tool: z.enum(['spawn_agent', 'Agent']), set_if_unspecified: defaults, preserve: z.literal('all_other_arguments_and_history') });
|
|
10
|
+
const freshCall = z.strictObject({ tool: z.literal('spawn_agent'), arguments: z.strictObject({ task_name: z.string().min(1).max(128), message: z.string().min(1).max(12000), fork_turns: z.literal('none'), model: z.string().min(1).max(256), reasoning_effort: effort }) });
|
|
11
|
+
/** Output coherence only: not host authorization, dispatch or profile availability. */
|
|
12
|
+
export const recoveryApplicationSchema = z.strictObject({
|
|
13
|
+
client: z.enum(['codex', 'claude']), status: z.enum(['recommended', 'prepared', 'keep_current', 'needs_context', 'unavailable']), application: z.literal('advisory_only'),
|
|
14
|
+
execution: z.literal('not_observed').optional(),
|
|
15
|
+
profile: z.strictObject({ id: z.string(), client: z.enum(['codex', 'claude']), model: z.string(), reasoning_effort: effort.optional() }).optional(),
|
|
16
|
+
spawn_application: z.union([review, blocked]), next_call: z.union([retryCall, freshCall]).optional(),
|
|
17
|
+
protected_fields: z.array(field),
|
|
18
|
+
}).superRefine((value, ctx) => {
|
|
19
|
+
const issue = () => ctx.addIssue({ code: 'custom', message: 'invalid_recovery_application' });
|
|
20
|
+
const app = value.spawn_application, call = value.next_call;
|
|
21
|
+
if (app.status === 'blocked') {
|
|
22
|
+
if (call || value.status === 'prepared')
|
|
23
|
+
issue();
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (!['recommended', 'prepared'].includes(value.status)) {
|
|
27
|
+
if (call || app.reason !== 'native_execution_not_observed' || app.required_fields || app.on_unavailable || app.next_action)
|
|
28
|
+
issue();
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (!call || !value.profile || value.profile.client !== value.client) {
|
|
32
|
+
issue();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const fresh = 'arguments' in call;
|
|
36
|
+
if (fresh !== (value.status === 'prepared') || call.tool !== (value.client === 'codex' ? 'spawn_agent' : 'Agent'))
|
|
37
|
+
issue();
|
|
38
|
+
if (app.reason !== (fresh ? 'explicit_profile_arguments_required' : 'native_execution_not_observed') || app.next_action !== (fresh ? 'submit_prepared_call' : 'apply_returned_defaults') || app.on_unavailable !== 'stop_and_report')
|
|
39
|
+
issue();
|
|
40
|
+
const args = fresh ? call.arguments : call.set_if_unspecified;
|
|
41
|
+
const keys = ['model', 'reasoning_effort'].filter(key => Object.hasOwn(args, key));
|
|
42
|
+
const required = app.required_fields ?? [];
|
|
43
|
+
if (!keys.length || new Set(required).size !== required.length || keys.length !== required.length || keys.some(key => !required.includes(key)))
|
|
44
|
+
issue();
|
|
45
|
+
if (value.client === 'claude' && Object.hasOwn(args, 'reasoning_effort'))
|
|
46
|
+
issue();
|
|
47
|
+
for (const key of keys) {
|
|
48
|
+
if (args[key] === undefined || args[key] !== value.profile[key])
|
|
49
|
+
issue();
|
|
50
|
+
if (!fresh && value.protected_fields.includes(key))
|
|
51
|
+
issue();
|
|
52
|
+
}
|
|
53
|
+
if (fresh && value.execution !== 'not_observed')
|
|
54
|
+
issue();
|
|
55
|
+
});
|
|
56
|
+
export function validRecoveryApplication(result, client, protectedFields = []) {
|
|
57
|
+
return recoveryApplicationSchema.safeParse({ client, status: result.status, application: result.application, execution: result.execution, profile: result.profile,
|
|
58
|
+
spawn_application: result.spawn_application, next_call: result.next_call, protected_fields: protectedFields }).success;
|
|
59
|
+
}
|
package/dist/src/server.js
CHANGED
|
@@ -107,7 +107,7 @@ export function createServer({ env: inputEnv = process.env } = {}) {
|
|
|
107
107
|
inputSchema: { request_id: z.string().min(1).max(96), client: z.enum(['codex', 'claude']), task: taskSchema, eligible_profile_ids: z.array(z.string()).min(1).max(20).optional(), constraints: constraintsSchema.optional() }
|
|
108
108
|
}, async (input) => { const result = await router.advise(input); await trackStatistics(input.client, { requestId: input.request_id, recommendation: result }); return content({ ...result, provider: mode }); });
|
|
109
109
|
server.registerTool('retry_spawn_recommendation', {
|
|
110
|
-
description: 'Supply one bounded task description after an Aptly Hook returns needs_context and a retry_id. Use the same MCP process within five minutes; no native call IDs are needed. May make one paid classification; duplicate input reuses its request identity, changed input conflicts. Never spawns or changes history. If still needs_context/unavailable, stop; do not create another ID. A blocked spawn_application remains advisory.',
|
|
110
|
+
description: 'Supply one bounded task description after an Aptly Hook returns needs_context and a retry_id. Use the same MCP process within five minutes; no native call IDs are needed. May make one paid classification; duplicate input reuses its request identity, changed input conflicts. Never spawns or changes history. If still needs_context/unavailable, stop; do not create another ID. A blocked spawn_application remains advisory. When next_call is supplied, required_fields and next_action describe only missing profile arguments. Apply them only under existing user/host permissions; if forbidden or unclear, stop and report. Existing-agent reuse is an alternative, not proof of applying this recommendation.',
|
|
111
111
|
annotations, inputSchema: { retry_id: z.string().regex(/^[a-f0-9]{64}$/), description: z.string().max(4000) }
|
|
112
112
|
}, async ({ retry_id, description }, extra) => {
|
|
113
113
|
let result;
|
package/dist/src/setup.js
CHANGED
|
@@ -164,7 +164,7 @@ function removeTomlEnv(text, additions) {
|
|
|
164
164
|
return text;
|
|
165
165
|
}
|
|
166
166
|
export const configurableEnvironmentKeys = Object.freeze([...budgetEnvironmentKeys, 'ROUTER_PROVIDER', 'APTLY_CLAUDE_MODELS', 'APTLY_CODEX_MODELS', 'CLAUDE_MODELS', 'CODEX_MODELS', 'APTLY_MODEL_INFO_PATH']);
|
|
167
|
-
const defaultEnvironment = { ...budgetEnvironmentDefaults, ROUTER_PROVIDER: 'decisions', APTLY_CLAUDE_MODELS: '["haiku","sonnet","opus"]', APTLY_CODEX_MODELS: '["gpt-6-luna","gpt-6.1-terra","gpt-6.
|
|
167
|
+
const defaultEnvironment = { ...budgetEnvironmentDefaults, ROUTER_PROVIDER: 'decisions', APTLY_CLAUDE_MODELS: '["haiku","sonnet","opus"]', APTLY_CODEX_MODELS: '["gpt-6-luna","gpt-6.1-terra","gpt-6.2-sol"]' };
|
|
168
168
|
function validateEnvironmentValue(key, value) {
|
|
169
169
|
if (!configurableEnvironmentKeys.includes(key))
|
|
170
170
|
fail(/KEY|TOKEN|SECRET|PASSWORD|CREDENTIAL/i.test(key) ? 'environment_secret_key_unsupported' : 'environment_key_unsupported');
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.
|
|
1
|
+
export declare const VERSION = "0.1.18";
|
package/dist/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.1.
|
|
1
|
+
export const VERSION = '0.1.18';
|
package/docs/ADVISORY_USAGE.md
CHANGED
|
@@ -83,13 +83,15 @@ node bin/aptly.ts capabilities
|
|
|
83
83
|
|---|---|---|
|
|
84
84
|
| simple | `claude-simple`: haiku | `codex-simple`: gpt-6-luna / max |
|
|
85
85
|
| routine | `claude-routine`: sonnet | `codex-routine`: gpt-6.1-terra / high |
|
|
86
|
-
| deep | `claude-deep`: opus | `codex-deep`: gpt-6.
|
|
86
|
+
| deep | `claude-deep`: opus | `codex-deep`: gpt-6.2-sol / medium |
|
|
87
|
+
|
|
88
|
+
`gpt-6.1-sol`은 선택 후보 `codex-deep-legacy` / medium으로 유지합니다. 기존 후보 설정은 자동으로 바꾸지 않습니다.
|
|
87
89
|
|
|
88
90
|
프로세스 환경에서 후보를 좁힐 수 있어요. 모델명 배열이며 profile ID 배열은 아니에요.
|
|
89
91
|
|
|
90
92
|
```sh
|
|
91
93
|
export APTLY_CLAUDE_MODELS='["haiku","sonnet","opus"]'
|
|
92
|
-
export APTLY_CODEX_MODELS='["gpt-6-luna","gpt-6.1-terra","gpt-6.
|
|
94
|
+
export APTLY_CODEX_MODELS='["gpt-6-luna","gpt-6.1-terra","gpt-6.2-sol"]'
|
|
93
95
|
```
|
|
94
96
|
|
|
95
97
|
MCP 설정 JSON의 `env` 값에는 위 배열을 JSON 문자열로 넣어요. 실제 등록 형식은 [Claude 예제](../examples/claude-mcp.json)와 [Codex 예제](../examples/codex-mcp.toml)를 참고해요.
|
package/docs/SPAWN_CONTEXT.md
CHANGED
|
@@ -173,6 +173,16 @@ requires the parent to review and explicitly supply only unspecified model/effor
|
|
|
173
173
|
fields to a new compatible native call. Caller review means argument review,
|
|
174
174
|
not a request for new user approval. Existing delegation authorization and host
|
|
175
175
|
permission checks still apply; this advisory result grants neither.
|
|
176
|
+
Starting with 0.1.17, application-bearing retry/fresh outputs are checked by a shared Zod contract.
|
|
177
|
+
For an applicable retry, `required_fields` matches only returned missing fields,
|
|
178
|
+
`next_action` is `apply_returned_defaults`, and `on_unavailable` is
|
|
179
|
+
`stop_and_report`; fresh calls use `submit_prepared_call`. Blocked and
|
|
180
|
+
non-recommended outputs have no apply arguments. Internal inconsistency returns
|
|
181
|
+
`recovery_metadata_invalid` without validation data or a new provider call;
|
|
182
|
+
completed ledger results remain intact. Strict consumers must allow the additive
|
|
183
|
+
metadata. This validates output coherence, not caller compliance or permission.
|
|
184
|
+
If user/host restrictions prohibit application or are unclear, stop and report.
|
|
185
|
+
Existing-agent reuse is an alternative path, not evidence of applying advice.
|
|
176
186
|
The response supplies concrete fields in
|
|
177
187
|
`next_call.set_if_unspecified`, excluding original explicit choices. Claude
|
|
178
188
|
receives model only, never an effort field. Blocked results omit `next_call`. `blocked` requires reporting the original
|
|
@@ -52,7 +52,7 @@ env_vars = ["OPENAI_API_KEY"]
|
|
|
52
52
|
[mcp_servers.aptly.env]
|
|
53
53
|
ROUTER_PROVIDER = "decisions"
|
|
54
54
|
APTLY_CLAUDE_MODELS = '["haiku","sonnet","opus"]'
|
|
55
|
-
APTLY_CODEX_MODELS = '["gpt-6-luna","gpt-6.1-terra","gpt-6.
|
|
55
|
+
APTLY_CODEX_MODELS = '["gpt-6-luna","gpt-6.1-terra","gpt-6.2-sol"]'
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
<a id="guide-claude-configuration"></a>
|
|
@@ -65,7 +65,7 @@ Merge these values into the existing `mcpServers.aptly.env` object:
|
|
|
65
65
|
{
|
|
66
66
|
"ROUTER_PROVIDER": "decisions",
|
|
67
67
|
"APTLY_CLAUDE_MODELS": "[\"haiku\",\"sonnet\",\"opus\"]",
|
|
68
|
-
"APTLY_CODEX_MODELS": "[\"gpt-6-luna\",\"gpt-6.1-terra\",\"gpt-6.
|
|
68
|
+
"APTLY_CODEX_MODELS": "[\"gpt-6-luna\",\"gpt-6.1-terra\",\"gpt-6.2-sol\"]"
|
|
69
69
|
}
|
|
70
70
|
```
|
|
71
71
|
|
|
@@ -145,6 +145,8 @@ Cache reuse requires a completed first result. An unknown outcome remains `outco
|
|
|
145
145
|
|
|
146
146
|
`context_retry_allowed: false` ends further context supplementation. For a compatible recommendation, `caller_review_required` means the parent reviews arguments; it does not request new user approval. Existing delegation authorization and host permission checks still apply.
|
|
147
147
|
|
|
148
|
+
The shared output validation below is available starting with 0.1.17. Retry/fresh application metadata uses a shared Zod contract. Retry `required_fields` lists only missing fields and `next_action` is `apply_returned_defaults` (fresh: `submit_prepared_call`). Stop if application is forbidden or unclear; existing-agent reuse is not evidence of applying advice. Internal inconsistency returns `recovery_metadata_invalid` without raw data or repeating a completed classification. Strict consumers must allow additive fields. Validation does not establish caller compliance or permission.
|
|
149
|
+
|
|
148
150
|
<a id="guide-fresh-delegation"></a>
|
|
149
151
|
|
|
150
152
|
## Prepare a separate independent delegation (0.1.6+)
|
|
@@ -97,7 +97,9 @@ Tiers are task presets and do not imply equivalent model performance across prov
|
|
|
97
97
|
|---|---|---|---|
|
|
98
98
|
| simple | `haiku` | `gpt-6-luna` / `max` | Extraction, format conversion, small mechanical edits |
|
|
99
99
|
| routine | `sonnet` | `gpt-6.1-terra` / `high` | Context-aware writing, translation, scoped implementation |
|
|
100
|
-
| deep | `opus` | `gpt-6.
|
|
100
|
+
| deep | `opus` | `gpt-6.2-sol` / `medium` | Complex debugging, design decisions, deep review |
|
|
101
|
+
|
|
102
|
+
The new default applies when candidate configuration is missing or fresh; existing candidate lists are preserved. `gpt-6.1-sol` remains available as the optional `codex-deep-legacy` / `medium` profile. Both models can be selected with unique IDs.
|
|
101
103
|
|
|
102
104
|
MCP `env` values are strings, so pass candidate arrays as JSON strings.
|
|
103
105
|
|
|
@@ -105,7 +107,7 @@ MCP `env` values are strings, so pass candidate arrays as JSON strings.
|
|
|
105
107
|
{
|
|
106
108
|
"env": {
|
|
107
109
|
"APTLY_CLAUDE_MODELS": "[\"haiku\", \"sonnet\", \"opus\"]",
|
|
108
|
-
"APTLY_CODEX_MODELS": "[\"gpt-6-luna\", \"gpt-6.1-terra\", \"gpt-6.
|
|
110
|
+
"APTLY_CODEX_MODELS": "[\"gpt-6-luna\", \"gpt-6.1-terra\", \"gpt-6.2-sol\"]"
|
|
109
111
|
}
|
|
110
112
|
}
|
|
111
113
|
```
|
|
@@ -52,7 +52,7 @@ env_vars = ["OPENAI_API_KEY"]
|
|
|
52
52
|
[mcp_servers.aptly.env]
|
|
53
53
|
ROUTER_PROVIDER = "decisions"
|
|
54
54
|
APTLY_CLAUDE_MODELS = '["haiku","sonnet","opus"]'
|
|
55
|
-
APTLY_CODEX_MODELS = '["gpt-6-luna","gpt-6.1-terra","gpt-6.
|
|
55
|
+
APTLY_CODEX_MODELS = '["gpt-6-luna","gpt-6.1-terra","gpt-6.2-sol"]'
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
<a id="guide-claude-configuration"></a>
|
|
@@ -65,7 +65,7 @@ APTLY_CODEX_MODELS = '["gpt-6-luna","gpt-6.1-terra","gpt-6.1-sol"]'
|
|
|
65
65
|
{
|
|
66
66
|
"ROUTER_PROVIDER": "decisions",
|
|
67
67
|
"APTLY_CLAUDE_MODELS": "[\"haiku\",\"sonnet\",\"opus\"]",
|
|
68
|
-
"APTLY_CODEX_MODELS": "[\"gpt-6-luna\",\"gpt-6.1-terra\",\"gpt-6.
|
|
68
|
+
"APTLY_CODEX_MODELS": "[\"gpt-6-luna\",\"gpt-6.1-terra\",\"gpt-6.2-sol\"]"
|
|
69
69
|
}
|
|
70
70
|
```
|
|
71
71
|
|
|
@@ -145,6 +145,8 @@ fixture は、キー・ネットワーク・子エージェントの実行なし
|
|
|
145
145
|
|
|
146
146
|
`context_retry_allowed: false` は追加の文脈補足を終了する意味です。互換性のある推薦の `caller_review_required` は親が引数を確認する意味であり、新しいユーザー承認の要求ではありません。既存の委任権限とホストの権限確認は引き続き適用されます。
|
|
147
147
|
|
|
148
|
+
次の共通応答検証は 0.1.17 以降で利用できます。retry・fresh の適用メタデータは共通の Zod スキーマで検証します。retry の `required_fields` は未指定フィールドのみで、`next_action` は `apply_returned_defaults`(fresh は `submit_prepared_call`)です。禁止・不明な場合は停止し、既存エージェントの再利用を推薦適用の証拠にしないでください。内部不整合は原文なしで `recovery_metadata_invalid` を返し、完了した分類は再実行しません。厳密な応答検証では追加フィールドを許容してください。呼び出し元の遵守や権限を証明する検証ではありません。
|
|
149
|
+
|
|
148
150
|
<a id="guide-fresh-delegation"></a>
|
|
149
151
|
|
|
150
152
|
## 別の独立した委任を準備する(0.1.6 以降)
|
|
@@ -97,7 +97,9 @@ aptly setup --client codex --migrate-launcher --launcher stable
|
|
|
97
97
|
|---|---|---|---|
|
|
98
98
|
| simple | `haiku` | `gpt-6-luna` / `max` | 抽出・形式変換・小さな機械的修正 |
|
|
99
99
|
| routine | `sonnet` | `gpt-6.1-terra` / `high` | 文脈を考慮した作成・翻訳・範囲が明確な実装 |
|
|
100
|
-
| deep | `opus` | `gpt-6.
|
|
100
|
+
| deep | `opus` | `gpt-6.2-sol` / `medium` | 複合的なデバッグ・設計判断・詳細レビュー |
|
|
101
|
+
|
|
102
|
+
新しいデフォルトは候補設定がない場合や新規設定に適用され、既存の候補リストは保持されます。`gpt-6.1-sol` は任意の `codex-deep-legacy` / `medium` プロファイルとして引き続き利用できます。両モデルは異なる ID で同時に選択できます。
|
|
101
103
|
|
|
102
104
|
MCP の `env` 値は文字列のため、候補配列も JSON 文字列で渡します。
|
|
103
105
|
|
|
@@ -105,7 +107,7 @@ MCP の `env` 値は文字列のため、候補配列も JSON 文字列で渡し
|
|
|
105
107
|
{
|
|
106
108
|
"env": {
|
|
107
109
|
"APTLY_CLAUDE_MODELS": "[\"haiku\", \"sonnet\", \"opus\"]",
|
|
108
|
-
"APTLY_CODEX_MODELS": "[\"gpt-6-luna\", \"gpt-6.1-terra\", \"gpt-6.
|
|
110
|
+
"APTLY_CODEX_MODELS": "[\"gpt-6-luna\", \"gpt-6.1-terra\", \"gpt-6.2-sol\"]"
|
|
109
111
|
}
|
|
110
112
|
}
|
|
111
113
|
```
|
|
@@ -52,7 +52,7 @@ env_vars = ["OPENAI_API_KEY"]
|
|
|
52
52
|
[mcp_servers.aptly.env]
|
|
53
53
|
ROUTER_PROVIDER = "decisions"
|
|
54
54
|
APTLY_CLAUDE_MODELS = '["haiku","sonnet","opus"]'
|
|
55
|
-
APTLY_CODEX_MODELS = '["gpt-6-luna","gpt-6.1-terra","gpt-6.
|
|
55
|
+
APTLY_CODEX_MODELS = '["gpt-6-luna","gpt-6.1-terra","gpt-6.2-sol"]'
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
<a id="guide-claude-configuration"></a>
|
|
@@ -65,7 +65,7 @@ APTLY_CODEX_MODELS = '["gpt-6-luna","gpt-6.1-terra","gpt-6.1-sol"]'
|
|
|
65
65
|
{
|
|
66
66
|
"ROUTER_PROVIDER": "decisions",
|
|
67
67
|
"APTLY_CLAUDE_MODELS": "[\"haiku\",\"sonnet\",\"opus\"]",
|
|
68
|
-
"APTLY_CODEX_MODELS": "[\"gpt-6-luna\",\"gpt-6.1-terra\",\"gpt-6.
|
|
68
|
+
"APTLY_CODEX_MODELS": "[\"gpt-6-luna\",\"gpt-6.1-terra\",\"gpt-6.2-sol\"]"
|
|
69
69
|
}
|
|
70
70
|
```
|
|
71
71
|
|
|
@@ -145,6 +145,8 @@ fixture는 키·네트워크·자식 실행 없이 로컬 규칙으로 생성한
|
|
|
145
145
|
|
|
146
146
|
`context_retry_allowed: false`는 추가 설명 보충을 더 허용하지 않는다는 뜻입니다. 호환 가능한 추천에서 `caller_review_required`는 부모가 인자를 검토한다는 의미이며 새 사용자 승인을 요구하지 않습니다. 기존 위임 권한과 호스트 권한 검사는 그대로 유지됩니다.
|
|
147
147
|
|
|
148
|
+
다음 공통 응답 검증은 0.1.17부터 제공합니다. retry·fresh의 적용 메타데이터는 공통 Zod 스키마로 검증합니다. 일반 retry의 `required_fields`는 미지정 필드만 포함하고 `next_action`은 `apply_returned_defaults`입니다(fresh는 `submit_prepared_call`). 금지·불명확 조건이면 중단하며 기존 에이전트 재사용을 추천 적용으로 보고하지 마십시오. 내부 불일치는 원문 없이 `recovery_metadata_invalid`로 반환하고 완료된 분류를 다시 호출하지 않습니다. 엄격한 응답 소비자는 추가 필드를 허용해야 합니다. 이 검증은 호출자 준수나 실행 권한을 증명하지 않습니다.
|
|
149
|
+
|
|
148
150
|
<a id="guide-fresh-delegation"></a>
|
|
149
151
|
|
|
150
152
|
## 상속 추천에서 별도 독립 위임 준비 (0.1.6부터)
|
|
@@ -97,7 +97,9 @@ aptly setup --client codex --migrate-launcher --launcher stable
|
|
|
97
97
|
|---|---|---|---|
|
|
98
98
|
| simple | `haiku` | `gpt-6-luna` / `max` | 추출·형식 변환·작은 기계적 수정 |
|
|
99
99
|
| routine | `sonnet` | `gpt-6.1-terra` / `high` | 문맥을 고려한 작성·번역·범위가 명확한 구현 |
|
|
100
|
-
| deep | `opus` | `gpt-6.
|
|
100
|
+
| deep | `opus` | `gpt-6.2-sol` / `medium` | 복합 디버깅·설계 판단·심층 검토 |
|
|
101
|
+
|
|
102
|
+
새 기본값은 후보 설정이 없거나 새로 설정할 때 적용되며, 기존 후보 목록은 유지됩니다. `gpt-6.1-sol`은 선택 후보 `codex-deep-legacy` / `medium`으로 사용할 수 있습니다. 두 모델은 서로 다른 ID로 함께 선택할 수 있습니다.
|
|
101
103
|
|
|
102
104
|
MCP의 `env` 값은 문자열이므로 후보 배열도 JSON 문자열로 전달합니다.
|
|
103
105
|
|
|
@@ -105,7 +107,7 @@ MCP의 `env` 값은 문자열이므로 후보 배열도 JSON 문자열로 전달
|
|
|
105
107
|
{
|
|
106
108
|
"env": {
|
|
107
109
|
"APTLY_CLAUDE_MODELS": "[\"haiku\", \"sonnet\", \"opus\"]",
|
|
108
|
-
"APTLY_CODEX_MODELS": "[\"gpt-6-luna\", \"gpt-6.1-terra\", \"gpt-6.
|
|
110
|
+
"APTLY_CODEX_MODELS": "[\"gpt-6-luna\", \"gpt-6.1-terra\", \"gpt-6.2-sol\"]"
|
|
109
111
|
}
|
|
110
112
|
}
|
|
111
113
|
```
|
|
@@ -52,7 +52,7 @@ env_vars = ["OPENAI_API_KEY"]
|
|
|
52
52
|
[mcp_servers.aptly.env]
|
|
53
53
|
ROUTER_PROVIDER = "decisions"
|
|
54
54
|
APTLY_CLAUDE_MODELS = '["haiku","sonnet","opus"]'
|
|
55
|
-
APTLY_CODEX_MODELS = '["gpt-6-luna","gpt-6.1-terra","gpt-6.
|
|
55
|
+
APTLY_CODEX_MODELS = '["gpt-6-luna","gpt-6.1-terra","gpt-6.2-sol"]'
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
<a id="guide-claude-configuration"></a>
|
|
@@ -65,7 +65,7 @@ APTLY_CODEX_MODELS = '["gpt-6-luna","gpt-6.1-terra","gpt-6.1-sol"]'
|
|
|
65
65
|
{
|
|
66
66
|
"ROUTER_PROVIDER": "decisions",
|
|
67
67
|
"APTLY_CLAUDE_MODELS": "[\"haiku\",\"sonnet\",\"opus\"]",
|
|
68
|
-
"APTLY_CODEX_MODELS": "[\"gpt-6-luna\",\"gpt-6.1-terra\",\"gpt-6.
|
|
68
|
+
"APTLY_CODEX_MODELS": "[\"gpt-6-luna\",\"gpt-6.1-terra\",\"gpt-6.2-sol\"]"
|
|
69
69
|
}
|
|
70
70
|
```
|
|
71
71
|
|
|
@@ -145,6 +145,8 @@ fixture 无需密钥、网络或执行子代理,即可返回本地模拟结果
|
|
|
145
145
|
|
|
146
146
|
`context_retry_allowed: false` 仅表示不再接受上下文补充。对于兼容的推荐,`caller_review_required` 表示父代理检查参数,并非要求用户重新批准。现有委派授权和宿主权限检查仍然有效。
|
|
147
147
|
|
|
148
|
+
以下共同响应验证自 0.1.17 起提供。retry 与 fresh 的应用元数据使用共同的 Zod 契约验证。retry 的 `required_fields` 仅含未指定字段,`next_action` 为 `apply_returned_defaults`(fresh 为 `submit_prepared_call`)。若禁止应用或情况不明,请停止;不要将复用现有代理视为已应用推荐。内部不一致时仅返回 `recovery_metadata_invalid`,不暴露原始数据或重复已完成的分类。严格校验响应的调用方应允许新增字段。验证不证明调用方遵守指令或拥有执行权限。
|
|
149
|
+
|
|
148
150
|
<a id="guide-fresh-delegation"></a>
|
|
149
151
|
|
|
150
152
|
## 准备单独的独立委派(0.1.6 起)
|
|
@@ -97,7 +97,9 @@ aptly setup --client codex --migrate-launcher --launcher stable
|
|
|
97
97
|
|---|---|---|---|
|
|
98
98
|
| simple | `haiku` | `gpt-6-luna` / `max` | 提取、格式转换、小型机械修改 |
|
|
99
99
|
| routine | `sonnet` | `gpt-6.1-terra` / `high` | 考虑上下文的写作、翻译、范围明确的实现 |
|
|
100
|
-
| deep | `opus` | `gpt-6.
|
|
100
|
+
| deep | `opus` | `gpt-6.2-sol` / `medium` | 复杂调试、设计判断、深入审阅 |
|
|
101
|
+
|
|
102
|
+
新默认值适用于候选配置缺失或新建的情况;现有候选列表会保留。`gpt-6.1-sol` 仍可作为可选的 `codex-deep-legacy` / `medium` 配置使用。两个模型可使用不同的 ID 同时选择。
|
|
101
103
|
|
|
102
104
|
MCP 的 `env` 值是字符串,因此候选数组也须作为 JSON 字符串传递。
|
|
103
105
|
|
|
@@ -105,7 +107,7 @@ MCP 的 `env` 值是字符串,因此候选数组也须作为 JSON 字符串传
|
|
|
105
107
|
{
|
|
106
108
|
"env": {
|
|
107
109
|
"APTLY_CLAUDE_MODELS": "[\"haiku\", \"sonnet\", \"opus\"]",
|
|
108
|
-
"APTLY_CODEX_MODELS": "[\"gpt-6-luna\", \"gpt-6.1-terra\", \"gpt-6.
|
|
110
|
+
"APTLY_CODEX_MODELS": "[\"gpt-6-luna\", \"gpt-6.1-terra\", \"gpt-6.2-sol\"]"
|
|
109
111
|
}
|
|
110
112
|
}
|
|
111
113
|
```
|