patchwork-os 1.2.0-beta.2.canary.628 → 1.2.0-beta.2.canary.629
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/privacy/destinationRegistry.d.ts +16 -1
- package/dist/privacy/destinationRegistry.js +80 -5
- package/dist/privacy/destinationRegistry.js.map +1 -1
- package/dist/recipes/agentExecutor.d.ts +19 -0
- package/dist/recipes/agentExecutor.js +97 -40
- package/dist/recipes/agentExecutor.js.map +1 -1
- package/package.json +1 -1
|
@@ -29,6 +29,12 @@
|
|
|
29
29
|
* this is going" must never read as "it is fine to send".
|
|
30
30
|
*/
|
|
31
31
|
import { type Classification, type Destination } from "./dataPolicy.js";
|
|
32
|
+
/**
|
|
33
|
+
* Whether this driver is one whose destination depends on the configured
|
|
34
|
+
* endpoint. Exported so `executeAgent` can skip resolving the endpoint (and
|
|
35
|
+
* the `config.json` read behind it) for drivers where it cannot matter.
|
|
36
|
+
*/
|
|
37
|
+
export declare function isLocalFamilyDriver(driver: string | undefined): boolean;
|
|
32
38
|
export interface DestinationConfig {
|
|
33
39
|
type?: string;
|
|
34
40
|
classifications?: unknown;
|
|
@@ -61,6 +67,15 @@ export interface ResolvedDestination {
|
|
|
61
67
|
/** True when some registered LOCAL destination is cleared for `forClass`. */
|
|
62
68
|
localDestinationAccepts: boolean;
|
|
63
69
|
}
|
|
70
|
+
export interface ResolveDestinationOptions {
|
|
71
|
+
/**
|
|
72
|
+
* The endpoint the local driver will actually POST to, when one is
|
|
73
|
+
* configured (`LOCAL_ENDPOINT` / `config.json` `localEndpoint`). Absent
|
|
74
|
+
* means the driver talks to its own default, which is loopback for every
|
|
75
|
+
* driver in `LOCAL_DRIVERS`.
|
|
76
|
+
*/
|
|
77
|
+
endpoint?: string;
|
|
78
|
+
}
|
|
64
79
|
/**
|
|
65
80
|
* Resolve the destination for a dispatch.
|
|
66
81
|
*
|
|
@@ -69,4 +84,4 @@ export interface ResolvedDestination {
|
|
|
69
84
|
* on an unrecognised driver would silently disable the boundary for exactly the
|
|
70
85
|
* dispatches nobody anticipated.
|
|
71
86
|
*/
|
|
72
|
-
export declare function resolveDestination(registry: ParsedRegistry, driver: string | undefined, forClass: Classification): ResolvedDestination | null;
|
|
87
|
+
export declare function resolveDestination(registry: ParsedRegistry, driver: string | undefined, forClass: Classification, opts?: ResolveDestinationOptions): ResolvedDestination | null;
|
|
@@ -28,9 +28,40 @@
|
|
|
28
28
|
* profile rather than to "no destination", because "we do not recognise where
|
|
29
29
|
* this is going" must never read as "it is fine to send".
|
|
30
30
|
*/
|
|
31
|
+
import { isLoopbackOrPrivateEndpoint } from "../localEndpointGuard.js";
|
|
31
32
|
import { CLASSIFICATIONS, classificationRank, } from "./dataPolicy.js";
|
|
32
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Drivers whose CLIENT code runs on this machine.
|
|
35
|
+
*
|
|
36
|
+
* Membership is NOT on its own evidence that the DATA stays here — see
|
|
37
|
+
* `endpointIsOnBox` and the inference branch in `resolveDestination`.
|
|
38
|
+
*/
|
|
33
39
|
const LOCAL_DRIVERS = new Set(["local", "ollama", "lmstudio", "llamacpp"]);
|
|
40
|
+
/**
|
|
41
|
+
* Whether this driver is one whose destination depends on the configured
|
|
42
|
+
* endpoint. Exported so `executeAgent` can skip resolving the endpoint (and
|
|
43
|
+
* the `config.json` read behind it) for drivers where it cannot matter.
|
|
44
|
+
*/
|
|
45
|
+
export function isLocalFamilyDriver(driver) {
|
|
46
|
+
return LOCAL_DRIVERS.has((driver ?? "").toLowerCase());
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Whether the endpoint a local driver will POST to actually stays on the
|
|
50
|
+
* machine (or the private network the operator controls).
|
|
51
|
+
*
|
|
52
|
+
* No endpoint configured ⇒ on-box: every driver in `LOCAL_DRIVERS` defaults to
|
|
53
|
+
* a loopback address, and this is the overwhelmingly common case, so treating
|
|
54
|
+
* it as remote would refuse ordinary local-only installs.
|
|
55
|
+
*
|
|
56
|
+
* An endpoint that does not parse ⇒ NOT on-box. "We cannot tell where this
|
|
57
|
+
* goes" must never read as "it stays here" — same fail-closed direction as the
|
|
58
|
+
* unknown-driver branch below.
|
|
59
|
+
*/
|
|
60
|
+
function endpointIsOnBox(endpoint) {
|
|
61
|
+
if (endpoint === undefined || endpoint.trim() === "")
|
|
62
|
+
return true;
|
|
63
|
+
return isLoopbackOrPrivateEndpoint(endpoint.trim());
|
|
64
|
+
}
|
|
34
65
|
function parseClassifications(raw) {
|
|
35
66
|
if (!Array.isArray(raw))
|
|
36
67
|
return null;
|
|
@@ -112,7 +143,7 @@ function strictestRemote(destinations) {
|
|
|
112
143
|
* on an unrecognised driver would silently disable the boundary for exactly the
|
|
113
144
|
* dispatches nobody anticipated.
|
|
114
145
|
*/
|
|
115
|
-
export function resolveDestination(registry, driver, forClass) {
|
|
146
|
+
export function resolveDestination(registry, driver, forClass, opts = {}) {
|
|
116
147
|
if (registry.destinations.length === 0) {
|
|
117
148
|
// NOTHING configured is the inert case, and is fine.
|
|
118
149
|
//
|
|
@@ -140,14 +171,41 @@ export function resolveDestination(registry, driver, forClass) {
|
|
|
140
171
|
}
|
|
141
172
|
const d = (driver ?? "").toLowerCase();
|
|
142
173
|
const localAccepts = registry.destinations.some((dest) => dest.type === "local" && dest.classifications.includes(forClass));
|
|
174
|
+
// #1398: a `type: "local"` destination is disqualified for THIS dispatch when
|
|
175
|
+
// the endpoint the driver will actually POST to is off-box.
|
|
176
|
+
//
|
|
177
|
+
// This is applied to the explicit driver mapping as well as to inference,
|
|
178
|
+
// and that is the load-bearing part. An operator's `drivers: ["local"]` entry
|
|
179
|
+
// on a local destination is a STATIC claim about where a driver goes; the
|
|
180
|
+
// resolved endpoint is what actually happens at dispatch. When the two
|
|
181
|
+
// disagree the endpoint wins, because the alternative lets a stale mapping
|
|
182
|
+
// launder an off-box send into a receipt that says the data never left —
|
|
183
|
+
// the precise failure this issue describes, merely reached by config rather
|
|
184
|
+
// than by driver name.
|
|
185
|
+
const localDisqualified = LOCAL_DRIVERS.has(d) && !endpointIsOnBox(opts.endpoint);
|
|
186
|
+
const eligible = localDisqualified
|
|
187
|
+
? registry.destinations.filter((x) => x.type !== "local")
|
|
188
|
+
: registry.destinations;
|
|
143
189
|
// Explicit driver mapping wins.
|
|
144
|
-
for (const dest of
|
|
190
|
+
for (const dest of eligible) {
|
|
145
191
|
if ((registry.driversFor.get(dest.id) ?? []).includes(d)) {
|
|
146
192
|
return { destination: dest, localDestinationAccepts: localAccepts };
|
|
147
193
|
}
|
|
148
194
|
}
|
|
149
195
|
// Otherwise infer by driver family.
|
|
150
|
-
|
|
196
|
+
//
|
|
197
|
+
// #1398: a driver in LOCAL_DRIVERS is only evidence of a local DESTINATION
|
|
198
|
+
// when the endpoint it will actually POST to is on-box. `LOCAL_ENDPOINT` is
|
|
199
|
+
// configurable and `LOCAL_ENDPOINT_ALLOW_REMOTE` exists precisely because
|
|
200
|
+
// pointing it off-box is a supported deployment — so the driver NAME is a
|
|
201
|
+
// statement about which client code runs, never about where the bytes land.
|
|
202
|
+
//
|
|
203
|
+
// Note what is deliberately NOT consulted here: `LOCAL_ENDPOINT_ALLOW_REMOTE`.
|
|
204
|
+
// That flag is permission to SEND to a remote box; it is not evidence that
|
|
205
|
+
// the box is local. Reading it as "the operator allowed this, so treat it as
|
|
206
|
+
// local" would re-open exactly the hole this closes, and would do so on the
|
|
207
|
+
// deployments most likely to be sending real data off-machine.
|
|
208
|
+
if (LOCAL_DRIVERS.has(d) && endpointIsOnBox(opts.endpoint)) {
|
|
151
209
|
const local = registry.destinations.find((x) => x.type === "local");
|
|
152
210
|
if (local) {
|
|
153
211
|
return { destination: local, localDestinationAccepts: localAccepts };
|
|
@@ -155,10 +213,27 @@ export function resolveDestination(registry, driver, forClass) {
|
|
|
155
213
|
}
|
|
156
214
|
// Unknown or remote driver → strictest remote. Fail closed: "we do not
|
|
157
215
|
// recognise where this is going" must never read as "it is fine to send".
|
|
158
|
-
const remote = strictestRemote(
|
|
216
|
+
const remote = strictestRemote(eligible);
|
|
159
217
|
if (remote) {
|
|
160
218
|
return { destination: remote, localDestinationAccepts: localAccepts };
|
|
161
219
|
}
|
|
220
|
+
// #1398: a local driver aimed off-box, with ONLY local destinations
|
|
221
|
+
// registered. There is no registered destination that describes where this
|
|
222
|
+
// data is actually going, so there is nothing to fall back TO — returning
|
|
223
|
+
// the local profile here would hand a `restricted`-cleared local destination
|
|
224
|
+
// to a dispatch leaving the machine, which is the worst version of this bug
|
|
225
|
+
// rather than a mitigation of it. Synthesise a remote destination cleared
|
|
226
|
+
// for nothing, the same shape the unparseable-config branch uses.
|
|
227
|
+
if (localDisqualified) {
|
|
228
|
+
return {
|
|
229
|
+
destination: {
|
|
230
|
+
id: "local-driver-remote-endpoint",
|
|
231
|
+
type: "remote",
|
|
232
|
+
classifications: [],
|
|
233
|
+
},
|
|
234
|
+
localDestinationAccepts: localAccepts,
|
|
235
|
+
};
|
|
236
|
+
}
|
|
162
237
|
// Only local destinations are registered but the driver is not local. The
|
|
163
238
|
// strictest available answer is the local profile, which will refuse
|
|
164
239
|
// anything it is not cleared for.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"destinationRegistry.js","sourceRoot":"","sources":["../../src/privacy/destinationRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EACL,eAAe,EAEf,kBAAkB,GAEnB,MAAM,iBAAiB,CAAC;AAEzB
|
|
1
|
+
{"version":3,"file":"destinationRegistry.js","sourceRoot":"","sources":["../../src/privacy/destinationRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EACL,eAAe,EAEf,kBAAkB,GAEnB,MAAM,iBAAiB,CAAC;AAEzB;;;;;GAKG;AACH,MAAM,aAAa,GAAG,IAAI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ED,oEAAoE;IACpE,2EAA2E;IAC3E,0EAA0E;IAC1E,6EAA6E;IAC7E,4EAA4E;IAC5E,0EAA0E;IAC1E,kEAAkE;IAClE,IAAI,iBAAiB,EAAE,CAAC;QACtB,OAAO;YACL,WAAW,EAAE;gBACX,EAAE,EAAE,8BAA8B;gBAClC,IAAI,EAAE,QAAQ;gBACd,eAAe,EAAE,EAAE;aACpB;YACD,uBAAuB,EAAE,YAAY;SACtC,CAAC;IACJ,CAAC;IAED,0EAA0E;IAC1E,qEAAqE;IACrE,kCAAkC;IAClC,MAAM,KAAK,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAgB,CAAC;IACtD,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,uBAAuB,EAAE,YAAY,EAAE,CAAC;AACvE,CAAC"}
|
|
@@ -141,4 +141,23 @@ export interface AgentExecutorInput {
|
|
|
141
141
|
* (keeps cost-routing quotes in parity with actual reconcile billing).
|
|
142
142
|
*/
|
|
143
143
|
export declare const DEFAULT_MODEL = "claude-haiku-4-5-20251001";
|
|
144
|
+
/**
|
|
145
|
+
* Resolve the driver that will ACTUALLY serve this call, once.
|
|
146
|
+
*
|
|
147
|
+
* #1398: the information boundary used to judge `input.driver` — the CONFIGURED
|
|
148
|
+
* string, which is frequently `undefined` — while `servedBy` recorded the one
|
|
149
|
+
* that really ran. When those differ the boundary judged a destination that
|
|
150
|
+
* never received the data, and nothing in the resulting receipt exposes the
|
|
151
|
+
* mismatch. Resolving here and handing the same value to both the boundary and
|
|
152
|
+
* the dispatch removes the second, divergent copy of this logic.
|
|
153
|
+
*
|
|
154
|
+
* Mirrors the dispatch chain below exactly, including its precedence:
|
|
155
|
+
* explicit driver → `config.json` model/driver → API key → CLI probe.
|
|
156
|
+
*
|
|
157
|
+
* An UNRECOGNISED driver string is returned unchanged rather than thrown on.
|
|
158
|
+
* The dispatch chain still throws for it at the same point it always has, so
|
|
159
|
+
* the boundary continues to evaluate unknown drivers (→ strictest remote, fail
|
|
160
|
+
* closed) and still writes a receipt, exactly as before this change.
|
|
161
|
+
*/
|
|
162
|
+
export declare function resolveEffectiveDriver(driver: string | undefined, deps: Pick<AgentExecutorDeps, "loadPatchworkConfig" | "probeClaudeCli">): string;
|
|
144
163
|
export declare function executeAgent(input: AgentExecutorInput, deps: AgentExecutorDeps): Promise<AgentResult>;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* localFn (Ollama/LM Studio) instead of Anthropic API — opt-in behaviour change.
|
|
9
9
|
*/
|
|
10
10
|
import { DEFAULT_CLASSIFICATION, decideBoundary, parseDataPolicy, } from "../privacy/dataPolicy.js";
|
|
11
|
-
import { parseRegistry, resolveDestination, } from "../privacy/destinationRegistry.js";
|
|
11
|
+
import { isLocalFamilyDriver, parseRegistry, resolveDestination, } from "../privacy/destinationRegistry.js";
|
|
12
12
|
import { resolveLocalModel } from "./localSettings.js";
|
|
13
13
|
/**
|
|
14
14
|
* Model the anthropic/local agent paths fall back to when a step omits `model`.
|
|
@@ -32,6 +32,58 @@ function resolveSandboxEnforcement(driver, deps) {
|
|
|
32
32
|
return "none"; // auto-detect → anthropic API
|
|
33
33
|
return deps.probeClaudeCli() ? "granular" : "none"; // CLI present → subprocess; else falls back to API
|
|
34
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Resolve the driver that will ACTUALLY serve this call, once.
|
|
37
|
+
*
|
|
38
|
+
* #1398: the information boundary used to judge `input.driver` — the CONFIGURED
|
|
39
|
+
* string, which is frequently `undefined` — while `servedBy` recorded the one
|
|
40
|
+
* that really ran. When those differ the boundary judged a destination that
|
|
41
|
+
* never received the data, and nothing in the resulting receipt exposes the
|
|
42
|
+
* mismatch. Resolving here and handing the same value to both the boundary and
|
|
43
|
+
* the dispatch removes the second, divergent copy of this logic.
|
|
44
|
+
*
|
|
45
|
+
* Mirrors the dispatch chain below exactly, including its precedence:
|
|
46
|
+
* explicit driver → `config.json` model/driver → API key → CLI probe.
|
|
47
|
+
*
|
|
48
|
+
* An UNRECOGNISED driver string is returned unchanged rather than thrown on.
|
|
49
|
+
* The dispatch chain still throws for it at the same point it always has, so
|
|
50
|
+
* the boundary continues to evaluate unknown drivers (→ strictest remote, fail
|
|
51
|
+
* closed) and still writes a receipt, exactly as before this change.
|
|
52
|
+
*/
|
|
53
|
+
export function resolveEffectiveDriver(driver, deps) {
|
|
54
|
+
if (driver === "claude")
|
|
55
|
+
return "anthropic";
|
|
56
|
+
if (driver === "claude-code")
|
|
57
|
+
return "subprocess";
|
|
58
|
+
if (driver !== undefined)
|
|
59
|
+
return driver;
|
|
60
|
+
const pwCfg = deps.loadPatchworkConfig();
|
|
61
|
+
if (pwCfg.model === "local")
|
|
62
|
+
return "local";
|
|
63
|
+
if (pwCfg.driver === "subprocess" || pwCfg.driver === "claude-code") {
|
|
64
|
+
return "subprocess";
|
|
65
|
+
}
|
|
66
|
+
if (process.env.ANTHROPIC_API_KEY)
|
|
67
|
+
return "anthropic";
|
|
68
|
+
return deps.probeClaudeCli() ? "subprocess" : "anthropic";
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The endpoint a local-family driver will actually POST to, if one is
|
|
72
|
+
* configured. `config.ts` copies `config.json`'s `localEndpoint` into
|
|
73
|
+
* `LOCAL_ENDPOINT` only when the env var is unset, so env wins here too.
|
|
74
|
+
*
|
|
75
|
+
* Undefined means "the driver's own default", which is loopback for every
|
|
76
|
+
* driver the registry treats as local.
|
|
77
|
+
*/
|
|
78
|
+
function resolveLocalEndpoint(deps) {
|
|
79
|
+
const fromEnv = process.env.LOCAL_ENDPOINT;
|
|
80
|
+
if (fromEnv && fromEnv.trim())
|
|
81
|
+
return fromEnv.trim();
|
|
82
|
+
const fromCfg = deps.loadPatchworkConfig().localEndpoint;
|
|
83
|
+
if (fromCfg && fromCfg.trim())
|
|
84
|
+
return fromCfg.trim();
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
35
87
|
/**
|
|
36
88
|
* CodexDriver's coarsest lockdown — read-only filesystem, no network, no
|
|
37
89
|
* interactive approval escalation (see src/drivers/codex/subprocess.ts's
|
|
@@ -52,7 +104,11 @@ const CODEX_WORKER_SANDBOX_LOCKDOWN = {
|
|
|
52
104
|
networkAccess: false,
|
|
53
105
|
webSearch: false,
|
|
54
106
|
};
|
|
55
|
-
function evaluateBoundary(ctx, driver, loadPrivacyConfig
|
|
107
|
+
function evaluateBoundary(ctx, driver, loadPrivacyConfig,
|
|
108
|
+
// A GETTER, not a value: resolving it reads `config.json`, and a caller that
|
|
109
|
+
// passes an explicit destination never needs it. Eager resolution would add
|
|
110
|
+
// a disk read to dispatches that already know where they are going.
|
|
111
|
+
getEndpoint) {
|
|
56
112
|
const policy0 = parseDataPolicy(ctx?.dataPolicy);
|
|
57
113
|
// Resolve the destination HERE rather than requiring every call site to pass
|
|
58
114
|
// one. There are four dispatch sites in the flat runner alone; a boundary
|
|
@@ -63,7 +119,10 @@ function evaluateBoundary(ctx, driver, loadPrivacyConfig) {
|
|
|
63
119
|
if (!destination && loadPrivacyConfig) {
|
|
64
120
|
const registry = parseRegistry(loadPrivacyConfig());
|
|
65
121
|
const forClass = policy0?.classification ?? DEFAULT_CLASSIFICATION;
|
|
66
|
-
const
|
|
122
|
+
const endpoint = getEndpoint?.();
|
|
123
|
+
const resolved = resolveDestination(registry, driver, forClass, {
|
|
124
|
+
...(endpoint !== undefined && { endpoint }),
|
|
125
|
+
});
|
|
67
126
|
if (resolved) {
|
|
68
127
|
destination = resolved.destination;
|
|
69
128
|
localAccepts = resolved.localDestinationAccepts;
|
|
@@ -123,7 +182,19 @@ export async function executeAgent(input, deps) {
|
|
|
123
182
|
// Precedence is privacy -> capability -> cost, and it is not negotiable by
|
|
124
183
|
// the later stages: a cheaper or more capable model that is not authorised
|
|
125
184
|
// for the data does not become authorised by being cheaper or more capable.
|
|
126
|
-
|
|
185
|
+
// #1398: the boundary judges the driver that will ACTUALLY serve this call,
|
|
186
|
+
// and the endpoint it will actually reach — not the configured `driver`
|
|
187
|
+
// string, which is undefined on the auto-detect path and therefore described
|
|
188
|
+
// a destination no data ever went to.
|
|
189
|
+
const resolvedDriver = resolveEffectiveDriver(driver, deps);
|
|
190
|
+
const boundary = evaluateBoundary(input.boundary, resolvedDriver, deps.loadPrivacyConfigFn,
|
|
191
|
+
// Resolved ONLY for the local family, and only if the boundary actually
|
|
192
|
+
// needs it. For every other driver the endpoint cannot change the
|
|
193
|
+
// destination, so reading it would add a `config.json` read to agent steps
|
|
194
|
+
// that never needed one.
|
|
195
|
+
isLocalFamilyDriver(resolvedDriver)
|
|
196
|
+
? () => resolveLocalEndpoint(deps)
|
|
197
|
+
: undefined);
|
|
127
198
|
if (boundary && boundary.decision !== "ALLOW") {
|
|
128
199
|
deps.recordBoundaryDecisionFn?.({
|
|
129
200
|
decision: boundary.decision,
|
|
@@ -183,30 +254,35 @@ export async function executeAgent(input, deps) {
|
|
|
183
254
|
},
|
|
184
255
|
};
|
|
185
256
|
};
|
|
186
|
-
|
|
257
|
+
// #1398: dispatch branches on the SAME resolved value the boundary judged.
|
|
258
|
+
// The auto-detect tail that used to live at the bottom of this chain is now
|
|
259
|
+
// inside `resolveEffectiveDriver`, so there is exactly one place that decides
|
|
260
|
+
// which driver serves a call — the condition for the boundary and the receipt
|
|
261
|
+
// being able to name it truthfully.
|
|
262
|
+
if (resolvedDriver === "anthropic") {
|
|
187
263
|
return stamp("anthropic", model ?? DEFAULT_MODEL, deps.anthropicFn(prompt, model ?? DEFAULT_MODEL));
|
|
188
264
|
}
|
|
189
|
-
if (
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
265
|
+
if (resolvedDriver === "openai" ||
|
|
266
|
+
resolvedDriver === "grok" ||
|
|
267
|
+
resolvedDriver === "gemini" ||
|
|
268
|
+
resolvedDriver === "gemini-api" ||
|
|
269
|
+
resolvedDriver === "codex") {
|
|
194
270
|
// A worker-mandated sandbox on the codex driver overrides — never merges
|
|
195
271
|
// with — the step's own providerOptions. See CODEX_WORKER_SANDBOX_LOCKDOWN.
|
|
196
|
-
const effectiveProviderOptions =
|
|
272
|
+
const effectiveProviderOptions = resolvedDriver === "codex" && enforceSandbox
|
|
197
273
|
? CODEX_WORKER_SANDBOX_LOCKDOWN
|
|
198
274
|
: providerOptions;
|
|
199
|
-
return stamp(
|
|
275
|
+
return stamp(resolvedDriver, model,
|
|
200
276
|
// Only pass the 4th arg when set so the common (unconstrained) call keeps
|
|
201
277
|
// its 3-arg shape — backward-compatible with callers/mocks.
|
|
202
278
|
effectiveProviderOptions
|
|
203
|
-
? deps.providerDriverFn(
|
|
204
|
-
: deps.providerDriverFn(
|
|
279
|
+
? deps.providerDriverFn(resolvedDriver, prompt, model, effectiveProviderOptions)
|
|
280
|
+
: deps.providerDriverFn(resolvedDriver, prompt, model));
|
|
205
281
|
}
|
|
206
|
-
if (
|
|
282
|
+
if (resolvedDriver === "subprocess") {
|
|
207
283
|
return stamp("subprocess", model, deps.claudeCliFn(prompt, cliOpts));
|
|
208
284
|
}
|
|
209
|
-
if (
|
|
285
|
+
if (resolvedDriver === "local") {
|
|
210
286
|
// Resolve through the shared resolver, NOT `model ?? DEFAULT_MODEL`.
|
|
211
287
|
// DEFAULT_MODEL is an Anthropic id; using it here sent "claude-…" to a
|
|
212
288
|
// local server whenever a step omitted `model:`. Stamping the RESOLVED
|
|
@@ -216,29 +292,10 @@ export async function executeAgent(input, deps) {
|
|
|
216
292
|
const localModel = resolveLocalModel(model, deps.loadPatchworkConfig());
|
|
217
293
|
return stamp("local", localModel, deps.localFn(prompt, localModel));
|
|
218
294
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
//
|
|
223
|
-
|
|
224
|
-
if (pwCfg.model === "local") {
|
|
225
|
-
const localModel = resolveLocalModel(model, pwCfg);
|
|
226
|
-
return stamp("local", localModel, deps.localFn(prompt, localModel));
|
|
227
|
-
}
|
|
228
|
-
// Explicit subprocess driver config → skip API key check entirely.
|
|
229
|
-
if (pwCfg.driver === "subprocess" || pwCfg.driver === "claude-code") {
|
|
230
|
-
return stamp("subprocess", model, deps.claudeCliFn(prompt, cliOpts));
|
|
231
|
-
}
|
|
232
|
-
// Auto-detect: prefer API key, otherwise probe for claude CLI.
|
|
233
|
-
if (process.env.ANTHROPIC_API_KEY) {
|
|
234
|
-
return stamp("anthropic", model ?? DEFAULT_MODEL, deps.anthropicFn(prompt, model ?? DEFAULT_MODEL));
|
|
235
|
-
}
|
|
236
|
-
if (deps.probeClaudeCli()) {
|
|
237
|
-
return stamp("subprocess", model, deps.claudeCliFn(prompt, cliOpts));
|
|
238
|
-
}
|
|
239
|
-
// Probe failed and no API key — fall back to anthropicFn so the caller
|
|
240
|
-
// surfaces a clear "[agent step skipped: ANTHROPIC_API_KEY not set]" message
|
|
241
|
-
// (and so test overrides of claudeFn/anthropicFn are honored).
|
|
242
|
-
return stamp("anthropic", model ?? DEFAULT_MODEL, deps.anthropicFn(prompt, model ?? DEFAULT_MODEL));
|
|
295
|
+
// Unrecognised driver. Reached at the same point as before: the boundary has
|
|
296
|
+
// already run and written its receipt (fail-closed to strictest remote for an
|
|
297
|
+
// unknown driver), which is why `resolveEffectiveDriver` passes the unknown
|
|
298
|
+
// string through instead of throwing early.
|
|
299
|
+
throw new Error(`Unknown driver: "${driver}"`);
|
|
243
300
|
}
|
|
244
301
|
//# sourceMappingURL=agentExecutor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentExecutor.js","sourceRoot":"","sources":["../../src/recipes/agentExecutor.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAGL,sBAAsB,EAEtB,cAAc,EACd,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,
|
|
1
|
+
{"version":3,"file":"agentExecutor.js","sourceRoot":"","sources":["../../src/recipes/agentExecutor.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAGL,sBAAsB,EAEtB,cAAc,EACd,eAAe,GAChB,MAAM,0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3
|
-
"version": "1.2.0-beta.2.canary.
|
|
3
|
+
"version": "1.2.0-beta.2.canary.629",
|
|
4
4
|
"description": "Your personal AI runtime, local-first. Patchwork OS gives any AI model a consistent set of tools, YAML recipes, a delegation policy with approval queue, and a durable trace memory — all on your machine, all under your policy.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|