@intentic/sandbox-contract 1.390.0 → 1.391.0
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/README.md +6 -1
- package/dist/contracts/agents.contract.d.ts +69 -0
- package/dist/contracts/agents.contract.d.ts.map +1 -1
- package/dist/contracts/agents.contract.js +10 -0
- package/dist/contracts/agents.contract.js.map +1 -1
- package/dist/contracts/device.contract.d.ts +10 -0
- package/dist/contracts/device.contract.d.ts.map +1 -1
- package/dist/contracts/ports.contract.d.ts +5 -0
- package/dist/contracts/ports.contract.d.ts.map +1 -1
- package/dist/contracts/ports.contract.js +1 -1
- package/dist/contracts/ports.contract.js.map +1 -1
- package/dist/contracts/runner.contract.d.ts +12 -4
- package/dist/contracts/runner.contract.d.ts.map +1 -1
- package/dist/contracts/runs.contract.d.ts +16 -0
- package/dist/contracts/runs.contract.d.ts.map +1 -1
- package/dist/contracts/settings.contract.d.ts +16 -0
- package/dist/contracts/settings.contract.d.ts.map +1 -1
- package/dist/contracts/system.contract.d.ts +66 -0
- package/dist/contracts/system.contract.d.ts.map +1 -1
- package/dist/contracts/system.contract.js +10 -1
- package/dist/contracts/system.contract.js.map +1 -1
- package/dist/events/agent-events.d.ts +4 -0
- package/dist/events/agent-events.d.ts.map +1 -1
- package/dist/events/agent-events.js +1 -0
- package/dist/events/agent-events.js.map +1 -1
- package/dist/events/agent-transcript.d.ts +1 -0
- package/dist/events/agent-transcript.d.ts.map +1 -1
- package/dist/events/failure-rows.js +1 -1
- package/dist/events/failure-rows.js.map +1 -1
- package/dist/events/land-conflict.d.ts +1 -0
- package/dist/events/land-conflict.d.ts.map +1 -1
- package/dist/events/land-conflict.js +4 -3
- package/dist/events/land-conflict.js.map +1 -1
- package/dist/events/requests.d.ts +1 -0
- package/dist/events/requests.d.ts.map +1 -1
- package/dist/events/requests.js +1 -1
- package/dist/events/requests.js.map +1 -1
- package/dist/events/resume.d.ts +2 -0
- package/dist/events/resume.d.ts.map +1 -1
- package/dist/events/resume.js +2 -0
- package/dist/events/resume.js.map +1 -1
- package/dist/events/sandbox-notice.d.ts +1 -0
- package/dist/events/sandbox-notice.d.ts.map +1 -1
- package/dist/events/sandbox-notice.js +1 -0
- package/dist/events/sandbox-notice.js.map +1 -1
- package/dist/events/system-events.d.ts +12 -0
- package/dist/events/system-events.d.ts.map +1 -1
- package/dist/events/transcript.d.ts +1 -0
- package/dist/events/transcript.d.ts.map +1 -1
- package/dist/events/transcript.js +4 -0
- package/dist/events/transcript.js.map +1 -1
- package/dist/index.d.ts +172 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/models/agent-standing.d.ts +2 -0
- package/dist/models/agent-standing.d.ts.map +1 -1
- package/dist/models/agent-standing.js.map +1 -1
- package/dist/models/model-setups.d.ts.map +1 -1
- package/dist/models/model-setups.js +2 -1
- package/dist/models/model-setups.js.map +1 -1
- package/dist/policy/failure-codes.d.ts +158 -0
- package/dist/policy/failure-codes.d.ts.map +1 -0
- package/dist/policy/failure-codes.js +50 -0
- package/dist/policy/failure-codes.js.map +1 -0
- package/dist/protocol/raw/raw-routes.d.ts +12 -0
- package/dist/protocol/raw/raw-routes.d.ts.map +1 -1
- package/dist/protocol/raw/raw-routes.js +3 -0
- package/dist/protocol/raw/raw-routes.js.map +1 -1
- package/dist/schemas/agent-press.d.ts +13 -0
- package/dist/schemas/agent-press.d.ts.map +1 -0
- package/dist/schemas/agent-press.js +14 -0
- package/dist/schemas/agent-press.js.map +1 -0
- package/dist/schemas/agents-list.d.ts +6 -0
- package/dist/schemas/agents-list.d.ts.map +1 -1
- package/dist/schemas/agents.d.ts +11 -0
- package/dist/schemas/agents.d.ts.map +1 -1
- package/dist/schemas/agents.js +5 -6
- package/dist/schemas/agents.js.map +1 -1
- package/dist/schemas/device-resources.d.ts +54 -0
- package/dist/schemas/device-resources.d.ts.map +1 -0
- package/dist/schemas/device-resources.js +29 -0
- package/dist/schemas/device-resources.js.map +1 -0
- package/dist/schemas/devices.d.ts +2 -52
- package/dist/schemas/devices.d.ts.map +1 -1
- package/dist/schemas/devices.js +2 -27
- package/dist/schemas/devices.js.map +1 -1
- package/dist/schemas/git/clone.d.ts +12 -0
- package/dist/schemas/git/clone.d.ts.map +1 -0
- package/dist/schemas/git/clone.js +14 -0
- package/dist/schemas/git/clone.js.map +1 -0
- package/dist/schemas/hosts.d.ts +23 -0
- package/dist/schemas/hosts.d.ts.map +1 -1
- package/dist/schemas/hosts.js +14 -1
- package/dist/schemas/hosts.js.map +1 -1
- package/dist/schemas/metrics.d.ts +59 -0
- package/dist/schemas/metrics.d.ts.map +1 -1
- package/dist/schemas/metrics.js +19 -0
- package/dist/schemas/metrics.js.map +1 -1
- package/dist/schemas/ports.d.ts +10 -0
- package/dist/schemas/ports.d.ts.map +1 -1
- package/dist/schemas/ports.js +8 -0
- package/dist/schemas/ports.js.map +1 -1
- package/dist/schemas/providers/handoff.d.ts +1 -0
- package/dist/schemas/providers/handoff.d.ts.map +1 -1
- package/dist/schemas/providers/handoff.js +4 -1
- package/dist/schemas/providers/handoff.js.map +1 -1
- package/dist/schemas/providers/plan-limits.js +1 -1
- package/dist/schemas/providers/plan-limits.js.map +1 -1
- package/dist/schemas/run-targets.d.ts +31 -0
- package/dist/schemas/run-targets.d.ts.map +1 -1
- package/dist/schemas/run-targets.js +9 -0
- package/dist/schemas/run-targets.js.map +1 -1
- package/dist/schemas/settings.d.ts +29 -0
- package/dist/schemas/settings.d.ts.map +1 -1
- package/dist/schemas/settings.js +17 -0
- package/dist/schemas/settings.js.map +1 -1
- package/dist/schemas/stranded-clone.d.ts +9 -0
- package/dist/schemas/stranded-clone.d.ts.map +1 -0
- package/dist/schemas/stranded-clone.js +12 -0
- package/dist/schemas/stranded-clone.js.map +1 -0
- package/dist/state/definition.d.ts +20 -0
- package/dist/state/definition.d.ts.map +1 -1
- package/dist/state/fix-stance.js +1 -1
- package/dist/state/fix-stance.js.map +1 -1
- package/dist/state/runtime-state.d.ts +3 -0
- package/dist/state/runtime-state.d.ts.map +1 -1
- package/dist/state/runtime-state.js +1 -0
- package/dist/state/runtime-state.js.map +1 -1
- package/dist/state/workspace-state.d.ts.map +1 -1
- package/dist/state/workspace-state.js +1 -1
- package/dist/state/workspace-state.js.map +1 -1
- package/dist/text/transcript-fold.d.ts.map +1 -1
- package/dist/text/transcript-fold.js +6 -6
- package/dist/text/transcript-fold.js.map +1 -1
- package/dist/text/transcript-interruption.d.ts +4 -0
- package/dist/text/transcript-interruption.d.ts.map +1 -0
- package/dist/text/transcript-interruption.js +27 -0
- package/dist/text/transcript-interruption.js.map +1 -0
- package/package.json +5 -5
- package/src/contracts/agents.contract.ts +12 -0
- package/src/contracts/ports.contract.ts +3 -2
- package/src/contracts/system.contract.ts +12 -1
- package/src/events/agent-events.ts +2 -0
- package/src/events/failure-rows.ts +1 -1
- package/src/events/land-conflict.test.ts +13 -1
- package/src/events/land-conflict.ts +8 -4
- package/src/events/requests.ts +1 -1
- package/src/events/resume.test.ts +7 -1
- package/src/events/resume.ts +3 -0
- package/src/events/sandbox-notice.ts +1 -0
- package/src/events/transcript.ts +6 -0
- package/src/models/agent-standing.ts +4 -0
- package/src/models/model-setups.test.ts +11 -0
- package/src/models/model-setups.ts +4 -1
- package/src/policy/failure-codes.ts +157 -0
- package/src/policy/tests/failure-codes.test.ts +141 -0
- package/src/protocol/raw/raw-routes.ts +5 -0
- package/src/schemas/agent-press.test.ts +46 -0
- package/src/schemas/agent-press.ts +34 -0
- package/src/schemas/agents.ts +8 -8
- package/src/schemas/device-resources.ts +58 -0
- package/src/schemas/devices.ts +20 -56
- package/src/schemas/git/clone.ts +22 -0
- package/src/schemas/hosts.ts +34 -3
- package/src/schemas/metrics.ts +28 -0
- package/src/schemas/ports.ts +12 -0
- package/src/schemas/providers/handoff.test.ts +7 -0
- package/src/schemas/providers/handoff.ts +4 -1
- package/src/schemas/providers/plan-limits.ts +1 -1
- package/src/schemas/run-targets.ts +23 -1
- package/src/schemas/settings.ts +32 -0
- package/src/schemas/stranded-clone.ts +15 -0
- package/src/state/fix-stance.ts +1 -1
- package/src/state/runtime-state.ts +4 -0
- package/src/state/workspace-state.ts +3 -2
- package/src/text/transcript-fold.test.ts +21 -7
- package/src/text/transcript-fold.ts +5 -6
- package/src/text/transcript-interruption.ts +30 -0
- package/dist/policy/turned-away.d.ts +0 -3
- package/dist/policy/turned-away.d.ts.map +0 -1
- package/dist/policy/turned-away.js +0 -33
- package/dist/policy/turned-away.js.map +0 -1
- package/src/policy/turned-away.ts +0 -52
package/src/schemas/hosts.ts
CHANGED
|
@@ -122,9 +122,40 @@ const HostMemorySchema = z.object({
|
|
|
122
122
|
});
|
|
123
123
|
export type HostMemory = z.infer<typeof HostMemorySchema>;
|
|
124
124
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
/* THE HOST'S GPU RESETS AND CRASHES, ON EVERY HEARTBEAT (2026-11-03). On 2026-11-02 a sandbox agent rendered a page on
|
|
126
|
+
rog's display GPU through WSL (Mesa d3d12 over /dev/dxg); the driver lost the device (LiveKernelEvent 0x141) and the
|
|
127
|
+
PC powered off. All the sandbox could say afterwards was "killed without warning". So the Windows side's agent reads
|
|
128
|
+
Windows' own record of such events (the event log: a GPU timeout or reset, a bluescreen, an unexpected power-off) and
|
|
129
|
+
answers each heartbeat with those of the last day; the daemon keeps every one it has not seen, names them where it
|
|
130
|
+
explains a restart, and pauses GPU work after a GPU reset until the owner resumes it (`gpu.pausedFor` in settings). */
|
|
131
|
+
export const HostCrashEventSchema = z.object({
|
|
132
|
+
// Stable across heartbeats, so the daemon keeps each once: the log and its record id (`System:48213`), or a WER
|
|
133
|
+
// report's own id (`WER:<guid>`), since Windows logs a queued report again every few minutes.
|
|
134
|
+
id: z.string().min(1).max(120),
|
|
135
|
+
// When it happened, ISO 8601 UTC: when Windows logged it, or a WER report's dump time. A Kernel-Power 41 is logged as
|
|
136
|
+
// Windows boots again, after the power-off.
|
|
137
|
+
at: z.string().min(1),
|
|
138
|
+
// `gpu-reset`: the display driver timed out or was reset (LiveKernelEvent 141/117/116, Display 4101, a 0x116/0x117
|
|
139
|
+
// bluescreen). `host-crash`: Windows itself went down (Kernel-Power 41, any other bluescreen).
|
|
140
|
+
kind: z.enum(["gpu-reset", "host-crash"]),
|
|
141
|
+
// Windows' name for it: "LiveKernelEvent 141", "Display 4101", "Kernel-Power 41", "BugCheck 0x116".
|
|
142
|
+
code: z.string().min(1).max(80),
|
|
143
|
+
// Windows' own first line about it, trimmed.
|
|
144
|
+
detail: z.string().max(400).optional(),
|
|
145
|
+
});
|
|
146
|
+
export type HostCrashEvent = z.infer<typeof HostCrashEventSchema>;
|
|
147
|
+
|
|
148
|
+
// How far back the Windows side reports, and how many: a heartbeat answer stays small, and a day covers the reboot.
|
|
149
|
+
export const HOST_CRASH_LOOKBACK_MS = 24 * 60 * 60_000;
|
|
150
|
+
export const HOST_CRASHES_MAX = 20;
|
|
151
|
+
|
|
152
|
+
// The heartbeat's answer. `memory` and `crashes` are absent from an agent older than them and from every side but Windows
|
|
153
|
+
// (above); an older daemon reads the `ok` and nothing else.
|
|
154
|
+
export const DevicePingSchema = z.object({
|
|
155
|
+
ok: z.literal(true),
|
|
156
|
+
memory: HostMemorySchema.optional(),
|
|
157
|
+
crashes: z.array(HostCrashEventSchema).max(HOST_CRASHES_MAX).optional(),
|
|
158
|
+
});
|
|
128
159
|
|
|
129
160
|
const GIB = 1024 ** 3;
|
|
130
161
|
|
package/src/schemas/metrics.ts
CHANGED
|
@@ -233,6 +233,9 @@ export const STORAGE_CLEANABILITY = {
|
|
|
233
233
|
packageStores: "safe",
|
|
234
234
|
// Build tools' output caches.
|
|
235
235
|
buildCaches: "safe",
|
|
236
|
+
// What builds left inside conversation checkouts (a Rust `target/`, Gradle and Flutter output): only checkouts whose
|
|
237
|
+
// conversation has nothing running are cleaned, and their next build makes it again. The checkout itself stays.
|
|
238
|
+
buildOutputs: "safe",
|
|
236
239
|
} as const satisfies Record<string, StorageCleanability>;
|
|
237
240
|
export type StorageCategoryId = keyof typeof STORAGE_CLEANABILITY;
|
|
238
241
|
export const StorageCategoryIdSchema = z.enum(Object.keys(STORAGE_CLEANABILITY) as StorageCategoryId[]);
|
|
@@ -303,6 +306,31 @@ export const StorageReportSchema = z.object({
|
|
|
303
306
|
});
|
|
304
307
|
export type StorageReport = z.infer<typeof StorageReportSchema>;
|
|
305
308
|
|
|
309
|
+
// How close the history volume is to full, as the daemon's disk-pressure watch last read it (GET /system/disk-pressure).
|
|
310
|
+
// `reaping`: under 15% free, settled checkouts' build output is being removed; `low` and `critical` are under 10% and
|
|
311
|
+
// 5%, which the owner is told about once each.
|
|
312
|
+
export const DiskPressureLevelSchema = z.enum(["ok", "reaping", "low", "critical"]);
|
|
313
|
+
export type DiskPressureLevel = z.infer<typeof DiskPressureLevelSchema>;
|
|
314
|
+
|
|
315
|
+
export const DiskPressureSchema = z.object({
|
|
316
|
+
level: DiskPressureLevelSchema,
|
|
317
|
+
freeBytes: z.number().describe("Space available on the history volume at the last reading."),
|
|
318
|
+
totalBytes: z.number().describe("The history volume's size."),
|
|
319
|
+
measuredAt: z.number().describe("When it was read, in milliseconds; 0 before the first reading."),
|
|
320
|
+
reaped: z
|
|
321
|
+
.object({
|
|
322
|
+
bytes: z.number().describe("Space the removals gave back, as the volume measured it before and after."),
|
|
323
|
+
checkouts: z.number().describe("How many conversation checkouts had build output removed."),
|
|
324
|
+
at: z.number().describe("When that pass ended, in milliseconds."),
|
|
325
|
+
})
|
|
326
|
+
.optional()
|
|
327
|
+
.describe("The last pass that removed build output because the disk was short. Absent until one has."),
|
|
328
|
+
using: z
|
|
329
|
+
.array(z.object({ id: StorageCategoryIdSchema, bytes: z.number() }))
|
|
330
|
+
.describe("The biggest categories in the last finished storage scan, largest first, at most three; empty before a scan."),
|
|
331
|
+
});
|
|
332
|
+
export type DiskPressure = z.infer<typeof DiskPressureSchema>;
|
|
333
|
+
|
|
306
334
|
export const StorageCleanInputSchema = z.object({
|
|
307
335
|
category: StorageCategoryIdSchema.describe("The category to clean; one whose cleanability is `none` is refused."),
|
|
308
336
|
});
|
package/src/schemas/ports.ts
CHANGED
|
@@ -55,6 +55,18 @@ export const PortSummarySchema = z.object({
|
|
|
55
55
|
})
|
|
56
56
|
.optional()
|
|
57
57
|
.describe("The background job an agent left running for you on this port, when that is what answers here."),
|
|
58
|
+
// (2026-11-03) In the owner's shinobi workspace 53 conversations ran ss and pgrep to find whose server held a port,
|
|
59
|
+
// and one agent's scratch server sat on the owner's 7878, which the desktop mirror put on his own localhost.
|
|
60
|
+
owner: z
|
|
61
|
+
.object({
|
|
62
|
+
conversationId: z.string().describe("The conversation whose agent opened it, in its shell or a background job."),
|
|
63
|
+
jobId: z.string().optional().describe("The background job serving it, when one job of that conversation can be named."),
|
|
64
|
+
label: z.string().optional().describe("What that job is, in the agent's own words when it gave any."),
|
|
65
|
+
})
|
|
66
|
+
.optional()
|
|
67
|
+
.describe(
|
|
68
|
+
"Which conversation's agent is listening here, when it can be told. Such a port stays off the owner's computers (the desktop mirror leaves it out) unless the job was left running for them (`job`) or the owner asks for it there.",
|
|
69
|
+
),
|
|
58
70
|
forwarded: z.boolean().describe("Whether it is currently reachable from outside."),
|
|
59
71
|
// `https://port-<slot>-<sandboxId>.<zone>`.
|
|
60
72
|
previewUrl: z.string().optional().describe("Where to open it. Present only while forwarded, and only on a sandbox that has an outside address."),
|
|
@@ -62,3 +62,10 @@ describe("a home's fresh start", () => {
|
|
|
62
62
|
});
|
|
63
63
|
});
|
|
64
64
|
});
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
test("a failed summary carries its reason into both the notice and readable line", () => {
|
|
68
|
+
const event = { mode: "summary", fellBack: true, reason: "Every summary model is out of allowance" } as const;
|
|
69
|
+
expect(handedOffNotice(event)).toEqual({ code: "handedOff", params: event });
|
|
70
|
+
expect(handedOffLine(event)).toBe("Could not write a summary for the hand-off, so the fresh session opened with the recent conversation and where the work stands instead. Reason: Every summary model is out of allowance");
|
|
71
|
+
});
|
|
@@ -90,6 +90,7 @@ export const HandedOffSchema = z.object({
|
|
|
90
90
|
cleared: z.number().optional().describe("Older tool outputs a trimmed copy cleared."),
|
|
91
91
|
model: z.string().optional().describe("The model that wrote the summary."),
|
|
92
92
|
fellBack: z.boolean().optional(),
|
|
93
|
+
reason: z.string().optional().describe("Why the requested hand-off could not be built."),
|
|
93
94
|
});
|
|
94
95
|
export type HandedOff = z.infer<typeof HandedOffSchema>;
|
|
95
96
|
|
|
@@ -102,15 +103,17 @@ export const handedOffNotice = (event: HandedOff): Extract<SandboxNotice, { code
|
|
|
102
103
|
...(event.cleared === undefined ? {} : { cleared: event.cleared }),
|
|
103
104
|
...(event.model === undefined ? {} : { model: event.model }),
|
|
104
105
|
...(event.fellBack === true ? { fellBack: true } : {}),
|
|
106
|
+
...(event.reason === undefined ? {} : { reason: event.reason }),
|
|
105
107
|
},
|
|
106
108
|
});
|
|
107
109
|
|
|
108
110
|
/** The transcript's line for how a held turn continued. */
|
|
109
111
|
export const handedOffLine = (event: HandedOff): string => {
|
|
110
112
|
if (event.fellBack === true) {
|
|
111
|
-
|
|
113
|
+
const line = event.mode === "trim"
|
|
112
114
|
? "Could not trim the session for the hand-off, so it was carried whole."
|
|
113
115
|
: "Could not write a summary for the hand-off, so the fresh session opened with the recent conversation and where the work stands instead.";
|
|
116
|
+
return event.reason === undefined ? line : `${line} Reason: ${event.reason}`;
|
|
114
117
|
}
|
|
115
118
|
const tokens = event.tokens === undefined ? undefined : tokensLabel(event.tokens);
|
|
116
119
|
switch (event.mode) {
|
|
@@ -198,7 +198,7 @@ export const AgentReplySchema = z.discriminatedUnion("kind", [
|
|
|
198
198
|
.describe(
|
|
199
199
|
"Whether to go ahead. Approving means the plan then runs without a prompt per tool, because being asked whether a plan you just approved may run its first command is not a question worth having.",
|
|
200
200
|
),
|
|
201
|
-
feedback: z.string().optional().describe("
|
|
201
|
+
feedback: z.string().optional().describe("Instructions to follow while executing an approved plan, or changes requested when rejecting it."),
|
|
202
202
|
}),
|
|
203
203
|
// Keyed by question text, valued by chosen option label(s), including free-text "Other".
|
|
204
204
|
z.object({
|
|
@@ -126,6 +126,22 @@ export const RunStartedSchema = z.object({ session: z.string() });
|
|
|
126
126
|
export const DeviceRunStateSchema = z.enum(["running", "ended", "unknown"]);
|
|
127
127
|
export type DeviceRunState = z.infer<typeof DeviceRunStateSchema>;
|
|
128
128
|
|
|
129
|
+
// WHAT A RUN WAS BUILT FROM: the repository's commit and how much of its tree was uncommitted when `devices run` began
|
|
130
|
+
// its build (in the owner's tree that is mostly landed work, since a land leaves its changes uncommitted), and whether
|
|
131
|
+
// the tree moved while it compiled. With `landsSince` on the run, the Run dialog says whether the program on the
|
|
132
|
+
// computer is the newest work or a restart would bring more.
|
|
133
|
+
export const RunBuiltFromSchema = z.object({
|
|
134
|
+
// The full sha of HEAD when the build began.
|
|
135
|
+
commit: z.string().min(1).max(64),
|
|
136
|
+
// Paths with uncommitted changes then (`git status`): 0 is a clean tree.
|
|
137
|
+
changed: z.int().nonnegative(),
|
|
138
|
+
// When the build began.
|
|
139
|
+
at: z.string(),
|
|
140
|
+
// The tree changed while it compiled (a land that was already writing, the owner's own edits): it may mix versions.
|
|
141
|
+
movedDuringBuild: z.boolean().optional(),
|
|
142
|
+
});
|
|
143
|
+
export type RunBuiltFrom = z.infer<typeof RunBuiltFromSchema>;
|
|
144
|
+
|
|
129
145
|
export const DeviceRunSchema = z.object({
|
|
130
146
|
device: z.string(),
|
|
131
147
|
// The run id the computer's app_status, app_logs and app_stop take.
|
|
@@ -133,7 +149,7 @@ export const DeviceRunSchema = z.object({
|
|
|
133
149
|
name: z.string(),
|
|
134
150
|
// `unknown`: its process is alive but the computer cannot tell whether it is still this run, so it will not stop it.
|
|
135
151
|
state: DeviceRunStateSchema,
|
|
136
|
-
// The computer's own words for it: "running, pid 4120", "exited with code 101", "stopped by the
|
|
152
|
+
// The computer's own words for it: "running, pid 4120", "exited with code 101", "stopped by the Run dialog's Stop".
|
|
137
153
|
said: z.string(),
|
|
138
154
|
// How it ended, when it exited by itself with a code.
|
|
139
155
|
exitCode: z.int().optional(),
|
|
@@ -143,6 +159,12 @@ export const DeviceRunSchema = z.object({
|
|
|
143
159
|
repo: z.string().optional(),
|
|
144
160
|
// The computer's ports the sandbox reaches for it (the target's `reach`), open while it runs, closed when it stops.
|
|
145
161
|
ports: z.array(z.int().min(1).max(65535)),
|
|
162
|
+
// Who started it, when this sandbox did since its last restart: "the Run dialog", "conversation <id>", "a terminal".
|
|
163
|
+
startedBy: z.string().optional(),
|
|
164
|
+
// What its build was made from, when `devices run` built it (RunBuiltFromSchema).
|
|
165
|
+
builtFrom: RunBuiltFromSchema.optional(),
|
|
166
|
+
// Lands into its repository since its build began, as far as this sandbox has seen since it came up.
|
|
167
|
+
landsSince: z.int().nonnegative().optional(),
|
|
146
168
|
});
|
|
147
169
|
export type DeviceRun = z.infer<typeof DeviceRunSchema>;
|
|
148
170
|
|
package/src/schemas/settings.ts
CHANGED
|
@@ -239,6 +239,35 @@ export const MemberAudienceSchema = z.object({
|
|
|
239
239
|
});
|
|
240
240
|
export type MemberAudience = z.infer<typeof MemberAudienceSchema>;
|
|
241
241
|
|
|
242
|
+
/* THE HOST GPU, FOR A SANDBOX WHOSE GPU SWITCH IS ON (2026-11-03). On a Windows PC that GPU is the owner's display GPU,
|
|
243
|
+
shared through WSL (/dev/dxg). Until 2026-11-03 the engine put its driver libraries on every process's library path,
|
|
244
|
+
so 65 conversations' browsers and shells rendered on it unasked, and one GPU hang powered rog off. Now nothing uses it
|
|
245
|
+
unless asked: `gpu-run <command>` runs one command with it (bin/gpu-run), and `shells: "all"` gives it to every
|
|
246
|
+
command an agent runs. Read by the daemon (gpu/gpu-state.ts), which hands gpu-run what it needs in a state file. */
|
|
247
|
+
export const GpuShellsSchema = z.enum(["on-request", "all"]);
|
|
248
|
+
export const GpuSettingsSchema = z.object({
|
|
249
|
+
shells: GpuShellsSchema.default("on-request").describe(
|
|
250
|
+
"Which of an agent's commands may use this sandbox's GPU. `on-request` (the default): only a command run through `gpu-run`, so a browser, a test run or a build never lands on your display GPU by accident. `all`: every command an agent runs, as if each one went through gpu-run.",
|
|
251
|
+
),
|
|
252
|
+
timeoutMinutes: z
|
|
253
|
+
.number()
|
|
254
|
+
.int()
|
|
255
|
+
.min(0)
|
|
256
|
+
.max(24 * 60)
|
|
257
|
+
.default(0)
|
|
258
|
+
.describe("How long one gpu-run command may run before it is stopped, in minutes. Zero (the default) never stops it; `gpu-run --timeout` sets it for one command."),
|
|
259
|
+
// Written by the daemon when the computer this sandbox runs on reported a GPU reset (hosts/host-crashes.ts); cleared
|
|
260
|
+
// by the owner, which is the "resume" press. A sentence, so whoever reads the file sees why.
|
|
261
|
+
pausedFor: z
|
|
262
|
+
.string()
|
|
263
|
+
.max(400)
|
|
264
|
+
.optional()
|
|
265
|
+
.describe(
|
|
266
|
+
"Set by the sandbox when the computer it runs on reported that its GPU was reset or hung, naming the event: while it is set, gpu-run refuses, and every command runs without the GPU. Clear it once you have looked, to let agents use the GPU again.",
|
|
267
|
+
),
|
|
268
|
+
});
|
|
269
|
+
export type GpuSettings = z.infer<typeof GpuSettingsSchema>;
|
|
270
|
+
|
|
242
271
|
export const SandboxSettingsSchema = z.object({
|
|
243
272
|
// The zone every WALL-CLOCK RULE in this sandbox is meant in — an automation's cron, and anything else that says
|
|
244
273
|
// "at 09:00" instead of naming an instant. It is not a display preference: nothing formats through it, and an
|
|
@@ -557,6 +586,9 @@ export const SandboxSettingsSchema = z.object({
|
|
|
557
586
|
),
|
|
558
587
|
// Speaking replies aloud (schemas/voice.ts): which voice speaks each language, and whether a hands-free turn is
|
|
559
588
|
// answered out loud. Read by the daemon's voice engine on every utterance, so a change is heard on the next one.
|
|
589
|
+
gpu: GpuSettingsSchema.prefault({}).describe(
|
|
590
|
+
"This sandbox's use of the host GPU, where its GPU switch is on: whether agents' commands get it only through gpu-run or all of them do, how long one gpu-run command may run, and whether GPU work is paused after the host reported a GPU reset.",
|
|
591
|
+
),
|
|
560
592
|
voice: VoiceSettingsSchema.prefault({}).describe(
|
|
561
593
|
"How the agent's replies are spoken aloud: whether a hands-free conversation is answered out loud, which voice speaks each language, and a speech provider of your own if you connected one.",
|
|
562
594
|
),
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
// A repository a conversation cloned (or `git init`ed) inside its own copy of the workspace and left work in: it never
|
|
4
|
+
// rides that conversation's land, so the review lists it with what folding it into its parent, or keeping it as a
|
|
5
|
+
// workspace repository of its own, would carry.
|
|
6
|
+
export const StrandedCloneSchema = z.object({
|
|
7
|
+
dir: z.string().describe("The clone, as a folder relative to its own copy of the workspace."),
|
|
8
|
+
uncommitted: z.number().describe("Files changed in it and never committed."),
|
|
9
|
+
unpushed: z.number().describe("Commits in it its upstream does not have, or that no remote has when it follows none."),
|
|
10
|
+
commits: z
|
|
11
|
+
.number()
|
|
12
|
+
.optional()
|
|
13
|
+
.describe("Commits it holds at all, 0 for a repository `git init` made and nothing was committed in: what folding it would drop. Absent from a sandbox too old to count them."),
|
|
14
|
+
parent: z.string().optional().describe("The workspace repository it sits inside, `root` for the workspace's own: where folding puts its files."),
|
|
15
|
+
});
|
package/src/state/fix-stance.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { turnedAwayCode } from "../policy/
|
|
1
|
+
import { turnedAwayCode } from "../policy/failure-codes.js";
|
|
2
2
|
import { type AgentSummary, awaitsWake } from "../schemas/agents.js";
|
|
3
3
|
|
|
4
4
|
/* WHAT BECAME OF THE AGENT A SURFACE SENT AFTER A FAILURE — a failed pipeline row, a refused push. */
|
|
@@ -70,6 +70,10 @@ const RUNTIME_DOMAINS = [
|
|
|
70
70
|
// machine: what every page needs to hear before the sandbox goes quiet under it, wherever the reader is.
|
|
71
71
|
{ domain: "update", invalidates: [["update"]] },
|
|
72
72
|
|
|
73
|
+
// The disk watch's level moved or it removed build output to make room (system/resources/storage/disk-pressure.ts):
|
|
74
|
+
// the attention row and the Storage card read it, and no file under /work changes when the history volume fills.
|
|
75
|
+
{ domain: "disk", invalidates: [["disk"]] },
|
|
76
|
+
|
|
73
77
|
// A standing yes written or taken back outside a need's answer: a permission card's pass, a release, a purge. They
|
|
74
78
|
// live under the auth root, which no file push watches, and the Allowed list must move with the card that wrote one.
|
|
75
79
|
{ domain: "grants", invalidates: [["grants"]] },
|
|
@@ -666,8 +666,9 @@ export const REPORTED_MANIFEST_PATHS: readonly string[] = WORKSPACE_STATE_FILES.
|
|
|
666
666
|
// Files on the daemon's own volume whose unreadable records are reported too, named by their absolute path there: the
|
|
667
667
|
// conversation registry's rows, one of which this build could not read costs that conversation until a build that can
|
|
668
668
|
// runs. Reported, never repaired from the card (no route edits them), and refreshed whenever the card is fetched. The
|
|
669
|
-
// boot record (2026-10-05) is reported when a restart storm kept a boot from resuming the turns it cut
|
|
670
|
-
|
|
669
|
+
// boot record (2026-10-05) is reported when a restart storm kept a boot from resuming the turns it cut, and the git dirs
|
|
670
|
+
// (2026-11-03) when a check after an unclean stop found objects nothing could rebuild (git/integrity/crash-check.ts).
|
|
671
|
+
export const REPORTED_VOLUME_FILES: readonly string[] = [`${HISTORY_ROOT}/conversations.db`, `${HISTORY_ROOT}/boot-history.json`, `${HISTORY_ROOT}/gits`];
|
|
671
672
|
|
|
672
673
|
// Accepts either separator; the daemon holds these as platform paths and normalizing at every call site is what
|
|
673
674
|
// eventually gets forgotten.
|
|
@@ -32,7 +32,7 @@ describe("foldTurn", () => {
|
|
|
32
32
|
];
|
|
33
33
|
expect(foldOf("look", events).slice(1)).toEqual([
|
|
34
34
|
{ role: "assistant", text: "I'll look" },
|
|
35
|
-
{ role: "assistant", text: "found it", tools: [{ id: "t1", name: "Read", category: "read", status: "
|
|
35
|
+
{ role: "assistant", text: "found it", tools: [{ id: "t1", name: "Read", category: "read", status: "interrupted" }] },
|
|
36
36
|
{ role: "assistant", text: "and here's why" },
|
|
37
37
|
]);
|
|
38
38
|
});
|
|
@@ -100,9 +100,9 @@ describe("foldTurn", () => {
|
|
|
100
100
|
expect(Object.keys(bash ?? {})).not.toContain("input");
|
|
101
101
|
});
|
|
102
102
|
|
|
103
|
-
it("
|
|
103
|
+
it("marks an unanswered call interrupted when the turn ends", () => {
|
|
104
104
|
const events: AgentEvent[] = [{ kind: "tool_call", id: "t1", name: "Bash", category: "execute", status: "in_progress" }];
|
|
105
|
-
expect(foldOf("run", events).at(-1)?.tools?.[0]?.status).toBe("
|
|
105
|
+
expect(foldOf("run", events).at(-1)?.tools?.[0]?.status).toBe("interrupted");
|
|
106
106
|
});
|
|
107
107
|
|
|
108
108
|
it("nests a subagent's calls, thinking and live state under the card that spawned them", () => {
|
|
@@ -121,7 +121,7 @@ describe("foldTurn", () => {
|
|
|
121
121
|
id: "task-1",
|
|
122
122
|
name: "Agent",
|
|
123
123
|
category: "other",
|
|
124
|
-
status: "
|
|
124
|
+
status: "interrupted",
|
|
125
125
|
thinking: "hmm",
|
|
126
126
|
children: [{ id: "t2", name: "Read", category: "read", status: "completed" }],
|
|
127
127
|
subagent: { kind: "subagent", agentType: "Explore", background: true, status: "completed", toolUses: 1 },
|
|
@@ -294,7 +294,7 @@ describe("foldTurn", () => {
|
|
|
294
294
|
{ content: "step 2", status: "in_progress", activeForm: "Running step 2" },
|
|
295
295
|
{ content: "step 3", status: "pending" },
|
|
296
296
|
],
|
|
297
|
-
tools: [{ id: "t1", name: "Bash", category: "execute", status: "
|
|
297
|
+
tools: [{ id: "t1", name: "Bash", category: "execute", status: "interrupted" }],
|
|
298
298
|
},
|
|
299
299
|
]);
|
|
300
300
|
});
|
|
@@ -863,6 +863,7 @@ describe("patches", () => {
|
|
|
863
863
|
"replace",
|
|
864
864
|
"replace",
|
|
865
865
|
"replace",
|
|
866
|
+
"replace",
|
|
866
867
|
]);
|
|
867
868
|
});
|
|
868
869
|
|
|
@@ -892,9 +893,9 @@ describe("patches", () => {
|
|
|
892
893
|
{ op: "toolThinking", index: 1, id: "task-1", text: "in" },
|
|
893
894
|
{ op: "toolThinking", index: 1, id: "task-1", text: "ner" },
|
|
894
895
|
]);
|
|
895
|
-
const update = patches.
|
|
896
|
+
const update = patches.findLast((patch) => patch.op === "tool");
|
|
896
897
|
expect(update?.op === "tool" ? update.tool : undefined).toEqual({ id: "task-1", name: "Agent", category: "other", status: "completed" });
|
|
897
|
-
expect(applied[1]?.tools?.[0]).toMatchObject({ status: "completed", thinking: "inner", children: [{ id: "t2" }] });
|
|
898
|
+
expect(applied[1]?.tools?.[0]).toMatchObject({ status: "completed", thinking: "inner", children: [{ id: "t2", status: "interrupted" }] });
|
|
898
899
|
});
|
|
899
900
|
|
|
900
901
|
// The other half of the wake's delivery: a live turn takes it as a steer. It is the daemon's own words either way,
|
|
@@ -1453,3 +1454,16 @@ describe("transcriptIncidents", () => {
|
|
|
1453
1454
|
expect(sandboxNoticeOf(accountMovedRow({ why: "cold", from: "Work", to: "Home" }))).toEqual({ code: "accountMoved", params: { why: "cold", from: "Work", to: "Home" } });
|
|
1454
1455
|
});
|
|
1455
1456
|
});
|
|
1457
|
+
|
|
1458
|
+
|
|
1459
|
+
test.each(["settled", "stopped"] as const)("%s interrupts open top-level and nested calls and leaves completed calls intact", (ending) => {
|
|
1460
|
+
const fold = new TranscriptFold([], () => 123);
|
|
1461
|
+
fold.apply({ kind: "tool_call", id: "parent", name: "Agent", category: "execute", status: "in_progress" });
|
|
1462
|
+
fold.apply({ kind: "tool_call", id: "nested", name: "Bash", category: "execute", status: "pending", parentToolUseId: "parent" });
|
|
1463
|
+
fold.apply({ kind: "tool_call", id: "done", name: "Read", category: "read", status: "completed" });
|
|
1464
|
+
fold.finish(ending);
|
|
1465
|
+
expect(fold.rows[0]?.tools).toMatchObject([
|
|
1466
|
+
{ id: "parent", status: "interrupted", endedAt: 123, children: [{ id: "nested", status: "interrupted", endedAt: 123 }] },
|
|
1467
|
+
{ id: "done", status: "completed" },
|
|
1468
|
+
]);
|
|
1469
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { interruptAssistant } from "./transcript-interruption.js";
|
|
2
|
+
import { settledRequests } from "../policy/request-status.js";
|
|
2
3
|
import type { AgentEvent } from "../events/agent-events.js";
|
|
3
4
|
import { drawInline, type InlineEvent, supersedeEarlier } from "./transcript-inline.js";
|
|
4
5
|
import {
|
|
5
6
|
REQUEST_FIELDS,
|
|
6
7
|
holdsRequest,
|
|
7
|
-
isAwaitingDecision,
|
|
8
8
|
type TranscriptRequests,
|
|
9
9
|
type TranscriptPatch,
|
|
10
10
|
type TranscriptRow,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import { keptWarmLine, keptWarmNotice } from "../schemas/keep-warm.js";
|
|
15
15
|
import { isStartingFrame, startingRow } from "./notice-rows.js";
|
|
16
16
|
import { isLandConflict } from "../events/land-conflict.js";
|
|
17
|
-
import { turnedAwayCode } from "../policy/
|
|
17
|
+
import { turnedAwayCode } from "../policy/failure-codes.js";
|
|
18
18
|
import { errorRow, RENEWAL_WITHDRAWN, RENEWING } from "../events/failure-rows.js";
|
|
19
19
|
import { mentionedPathTokens } from "./mentions.js";
|
|
20
20
|
import { unspokenPromptRow } from "../events/agent-words.js";
|
|
@@ -60,7 +60,7 @@ const resultWords = (tool: TranscriptTool): string =>
|
|
|
60
60
|
.join("\n");
|
|
61
61
|
|
|
62
62
|
// Whether a call's status is final: the moment it turns so is when its result arrived.
|
|
63
|
-
const ended = (status: TranscriptTool["status"]): boolean => status === "completed" || status === "failed";
|
|
63
|
+
const ended = (status: TranscriptTool["status"]): boolean => status === "completed" || status === "failed" || status === "interrupted";
|
|
64
64
|
|
|
65
65
|
// `at` is the fold's clock reading as the call is seen, absent for a fold without one; a call that arrives already
|
|
66
66
|
// finished started and ended in that same moment, as far as anyone here can tell.
|
|
@@ -493,8 +493,7 @@ export class TranscriptFold {
|
|
|
493
493
|
finish(ending: TurnEnding): TranscriptPatch[] {
|
|
494
494
|
const patches = this.closeBubble();
|
|
495
495
|
for (const [index, row] of this.rows.entries()) {
|
|
496
|
-
if (row.
|
|
497
|
-
Object.assign(row, cancelledRequests(row));
|
|
496
|
+
if (interruptAssistant(row, this.now?.())) {
|
|
498
497
|
patches.push(this.replace(index));
|
|
499
498
|
}
|
|
500
499
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { cancelledRequests } from "../policy/request-status.js";
|
|
2
|
+
import { isAwaitingDecision, type TranscriptRow, type TranscriptTool } from "../events/transcript.js";
|
|
3
|
+
|
|
4
|
+
// A turn cannot leave a call running, including a helper's nested calls.
|
|
5
|
+
export const interruptTools = (tools: readonly TranscriptTool[], at: number | undefined): boolean => {
|
|
6
|
+
let changed = false;
|
|
7
|
+
for (const tool of tools) {
|
|
8
|
+
if (tool.status === "pending" || tool.status === "in_progress") {
|
|
9
|
+
tool.status = "interrupted";
|
|
10
|
+
if (at !== undefined) {
|
|
11
|
+
tool.endedAt = at;
|
|
12
|
+
}
|
|
13
|
+
changed = true;
|
|
14
|
+
}
|
|
15
|
+
changed = interruptTools(tool.children ?? [], at) || changed;
|
|
16
|
+
}
|
|
17
|
+
return changed;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** Freeze decisions whose waiter ended, and calls whose result will no longer arrive. */
|
|
21
|
+
export const interruptAssistant = (row: TranscriptRow, at: number | undefined): boolean => {
|
|
22
|
+
if (row.role !== "assistant") {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
const awaiting = isAwaitingDecision(row);
|
|
26
|
+
if (awaiting) {
|
|
27
|
+
Object.assign(row, cancelledRequests(row));
|
|
28
|
+
}
|
|
29
|
+
return interruptTools(row.tools ?? [], at) || awaiting;
|
|
30
|
+
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"turned-away.d.ts","sourceRoot":"","sources":["../../src/policy/turned-away.ts"],"names":[],"mappings":"AAgDA,eAAO,MAAM,kBAAkB,SAAU,MAAM,GAAG,SAAS,KAAG,OAA+D,CAAC;AAG9H,eAAO,MAAM,cAAc,SAAU,MAAM,GAAG,SAAS,KAAG,OAAsD,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
const TURNED_AWAY = new Set([
|
|
2
|
-
"claude-reauth",
|
|
3
|
-
"claude-not-entitled",
|
|
4
|
-
"account-not-allowed",
|
|
5
|
-
"unknown-command",
|
|
6
|
-
"context-window-too-small",
|
|
7
|
-
"model-helper-only",
|
|
8
|
-
"privacy-unshielded",
|
|
9
|
-
"tools-unenforced",
|
|
10
|
-
"agent-domain-refused",
|
|
11
|
-
"privacy-instructions",
|
|
12
|
-
"sandbox-memory-low",
|
|
13
|
-
"workspace-setup",
|
|
14
|
-
"sandbox-disk-low",
|
|
15
|
-
"trial-unavailable",
|
|
16
|
-
"trial-model-unavailable",
|
|
17
|
-
"trial-exhausted",
|
|
18
|
-
"model-unavailable",
|
|
19
|
-
"engine-version-floor",
|
|
20
|
-
]);
|
|
21
|
-
const ANOTHER_MODEL_CLEARS = new Set([
|
|
22
|
-
"claude-not-entitled",
|
|
23
|
-
"account-not-allowed",
|
|
24
|
-
"context-window-too-small",
|
|
25
|
-
"model-helper-only",
|
|
26
|
-
"trial-unavailable",
|
|
27
|
-
"trial-model-unavailable",
|
|
28
|
-
"trial-exhausted",
|
|
29
|
-
"model-unavailable",
|
|
30
|
-
]);
|
|
31
|
-
export const anotherModelClears = (code) => code !== undefined && ANOTHER_MODEL_CLEARS.has(code);
|
|
32
|
-
export const turnedAwayCode = (code) => code !== undefined && TURNED_AWAY.has(code);
|
|
33
|
-
//# sourceMappingURL=turned-away.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"turned-away.js","sourceRoot":"","sources":["../../src/policy/turned-away.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,GAAwB,IAAI,GAAG,CAAC;IAC7C,eAAe;IAGf,qBAAqB;IAErB,qBAAqB;IACrB,iBAAiB;IACjB,0BAA0B;IAC1B,mBAAmB;IAEnB,oBAAoB;IAEpB,kBAAkB;IAElB,sBAAsB;IAEtB,sBAAsB;IACtB,oBAAoB;IAEpB,iBAAiB;IACjB,kBAAkB;IAClB,mBAAmB;IACnB,yBAAyB;IACzB,iBAAiB;IACjB,mBAAmB;IACnB,sBAAsB;CACzB,CAAC,CAAC;AAIH,MAAM,oBAAoB,GAAwB,IAAI,GAAG,CAAC;IACtD,qBAAqB;IACrB,qBAAqB;IACrB,0BAA0B;IAC1B,mBAAmB;IACnB,mBAAmB;IACnB,yBAAyB;IACzB,iBAAiB;IACjB,mBAAmB;CACtB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAwB,EAAW,EAAE,CAAC,IAAI,KAAK,SAAS,IAAI,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAG9H,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAwB,EAAW,EAAE,CAAC,IAAI,KAAK,SAAS,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/* THE REFUSALS THAT TURN A WHOLE TURN AWAY AT THE DOOR: refused before the model saw a word, so nothing ran and the
|
|
2
|
-
message is still owed to somebody — the conversation's queue, held, for words a person sent, or the sandbox that
|
|
3
|
-
started the turn itself. */
|
|
4
|
-
|
|
5
|
-
// A set rather than a run of case labels: what they share is a fact about the turn, not a shape.
|
|
6
|
-
const TURNED_AWAY: ReadonlySet<string> = new Set([
|
|
7
|
-
"claude-reauth",
|
|
8
|
-
// An organisation turned the account's Claude Code access off, or no account of the provider can serve: the next
|
|
9
|
-
// turn is routed off it (the daemon's blocked-account route), so the words wait for it rather than being spent.
|
|
10
|
-
"claude-not-entitled",
|
|
11
|
-
// The people this conversation works for may not spend the account the turn would run on.
|
|
12
|
-
"account-not-allowed",
|
|
13
|
-
"unknown-command",
|
|
14
|
-
"context-window-too-small",
|
|
15
|
-
"model-helper-only",
|
|
16
|
-
// The privacy shield refused an untrusted provider on a runtime it cannot read by content at all.
|
|
17
|
-
"privacy-unshielded",
|
|
18
|
-
// The turn carries a tool list its runtime cannot keep.
|
|
19
|
-
"tools-unenforced",
|
|
20
|
-
// The protected execution boundary refused admission, not an executed provider/runtime failure.
|
|
21
|
-
"agent-domain-refused",
|
|
22
|
-
// The privacy shield found personal data in instructions a runtime loads itself, where it could not mask them.
|
|
23
|
-
"privacy-instructions",
|
|
24
|
-
"sandbox-memory-low",
|
|
25
|
-
// The conversation's own view of the workspace could not be set up in time: nothing was started in it.
|
|
26
|
-
"workspace-setup",
|
|
27
|
-
"sandbox-disk-low",
|
|
28
|
-
"trial-unavailable",
|
|
29
|
-
"trial-model-unavailable",
|
|
30
|
-
"trial-exhausted",
|
|
31
|
-
"model-unavailable",
|
|
32
|
-
"engine-version-floor",
|
|
33
|
-
]);
|
|
34
|
-
|
|
35
|
-
// The refusals about the model itself (its allowance, its account, its catalogue, its window), which another model
|
|
36
|
-
// gets past: a turn one of these stops partway offers to carry on elsewhere rather than to wait.
|
|
37
|
-
const ANOTHER_MODEL_CLEARS: ReadonlySet<string> = new Set([
|
|
38
|
-
"claude-not-entitled",
|
|
39
|
-
"account-not-allowed",
|
|
40
|
-
"context-window-too-small",
|
|
41
|
-
"model-helper-only",
|
|
42
|
-
"trial-unavailable",
|
|
43
|
-
"trial-model-unavailable",
|
|
44
|
-
"trial-exhausted",
|
|
45
|
-
"model-unavailable",
|
|
46
|
-
]);
|
|
47
|
-
|
|
48
|
-
/** Whether another model would get past a refusal: the trial's, the model's, or the account's on it. */
|
|
49
|
-
export const anotherModelClears = (code: string | undefined): boolean => code !== undefined && ANOTHER_MODEL_CLEARS.has(code);
|
|
50
|
-
|
|
51
|
-
/** Whether a failure code refuses a turn before the model sees any of it. */
|
|
52
|
-
export const turnedAwayCode = (code: string | undefined): boolean => code !== undefined && TURNED_AWAY.has(code);
|