@andorra-labs/code 0.1.17 → 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.
Files changed (94) hide show
  1. package/dist/src/agent-execution.js +97 -11
  2. package/dist/src/andorra/errors.js +3 -0
  3. package/dist/src/app-server/protocol.d.ts +13 -2
  4. package/dist/src/app-server/protocol.js +1 -1
  5. package/dist/src/app-server/workspace.d.ts +19 -0
  6. package/dist/src/app-server/workspace.js +155 -4
  7. package/dist/src/app-server.d.ts +32 -1
  8. package/dist/src/app-server.js +622 -74
  9. package/dist/src/attachments.d.ts +10 -0
  10. package/dist/src/attachments.js +102 -7
  11. package/dist/src/automation-tool.js +2 -1
  12. package/dist/src/bridge/command.js +12 -0
  13. package/dist/src/bridge/control.d.ts +3 -1
  14. package/dist/src/bridge/control.js +7 -2
  15. package/dist/src/bridge/github.d.ts +108 -0
  16. package/dist/src/bridge/github.js +378 -0
  17. package/dist/src/bridge/host-ops.d.ts +1 -1
  18. package/dist/src/bridge/host-ops.js +11 -1
  19. package/dist/src/bridge/host.js +7 -4
  20. package/dist/src/bug-report-attachments.d.ts +48 -0
  21. package/dist/src/bug-report-attachments.js +327 -0
  22. package/dist/src/bug-report.d.ts +23 -3
  23. package/dist/src/bug-report.js +72 -9
  24. package/dist/src/cli.d.ts +1 -3
  25. package/dist/src/cli.js +10 -4
  26. package/dist/src/codex-provider.js +1 -1
  27. package/dist/src/coding-tools.js +9 -2
  28. package/dist/src/commands.d.ts +1 -1
  29. package/dist/src/commands.js +2 -1
  30. package/dist/src/completion.js +8 -4
  31. package/dist/src/config.js +3 -1
  32. package/dist/src/context-budget.js +15 -2
  33. package/dist/src/decision/DecisionEngine.d.ts +2 -0
  34. package/dist/src/decision/DecisionManager.d.ts +11 -0
  35. package/dist/src/decision/DecisionManager.js +36 -0
  36. package/dist/src/decision/applyTaskKind.d.ts +8 -0
  37. package/dist/src/decision/applyTaskKind.js +53 -0
  38. package/dist/src/decision/hostedPolicy.js +2 -1
  39. package/dist/src/decision/providers/AndorraDecisionProvider.d.ts +2 -0
  40. package/dist/src/decision/providers/AndorraDecisionProvider.js +12 -0
  41. package/dist/src/decision/taskKind.d.ts +52 -0
  42. package/dist/src/decision/taskKind.js +76 -0
  43. package/dist/src/decision/types.d.ts +1 -1
  44. package/dist/src/default-graph.js +1 -1
  45. package/dist/src/efficiency.d.ts +5 -0
  46. package/dist/src/efficiency.js +5 -1
  47. package/dist/src/effort-routing.d.ts +27 -0
  48. package/dist/src/effort-routing.js +34 -0
  49. package/dist/src/evidence.d.ts +110 -0
  50. package/dist/src/evidence.js +195 -0
  51. package/dist/src/github-app/client.d.ts +19 -0
  52. package/dist/src/github-app/client.js +21 -1
  53. package/dist/src/github-names.d.ts +7 -0
  54. package/dist/src/github-names.js +7 -0
  55. package/dist/src/graph-preview.d.ts +2 -0
  56. package/dist/src/graph-preview.js +1 -0
  57. package/dist/src/graph-runner.js +1 -1
  58. package/dist/src/graph-server.js +4 -2
  59. package/dist/src/graph-ui/app.js +30 -0
  60. package/dist/src/graphs.d.ts +6 -0
  61. package/dist/src/graphs.js +7 -2
  62. package/dist/src/hardened-runtime.js +32 -21
  63. package/dist/src/model-health-cache.js +1 -1
  64. package/dist/src/model-override.d.ts +2 -1
  65. package/dist/src/model-override.js +9 -0
  66. package/dist/src/model-tiers.d.ts +3 -0
  67. package/dist/src/model-tiers.js +3 -3
  68. package/dist/src/provider-engine.d.ts +13 -1
  69. package/dist/src/provider-engine.js +74 -0
  70. package/dist/src/providers.d.ts +5 -0
  71. package/dist/src/providers.js +34 -8
  72. package/dist/src/pull-requests.d.ts +11 -1
  73. package/dist/src/pull-requests.js +53 -2
  74. package/dist/src/react-runtime.js +98 -15
  75. package/dist/src/remote/engine-pool.js +5 -5
  76. package/dist/src/runtime.d.ts +29 -1
  77. package/dist/src/runtime.js +8 -0
  78. package/dist/src/sessions.d.ts +24 -0
  79. package/dist/src/sessions.js +55 -2
  80. package/dist/src/skills/bundled/bug-report/SKILL.md +51 -7
  81. package/dist/src/skills/bundled/provenance.json +1 -1
  82. package/dist/src/task-checkout.d.ts +141 -0
  83. package/dist/src/task-checkout.js +558 -0
  84. package/dist/src/test-edit-guard.d.ts +30 -0
  85. package/dist/src/test-edit-guard.js +167 -2
  86. package/dist/src/thinking-level-detect.d.ts +11 -0
  87. package/dist/src/thinking-level-detect.js +47 -0
  88. package/dist/src/thinking-levels.d.ts +30 -0
  89. package/dist/src/thinking-levels.js +124 -0
  90. package/dist/src/timers.d.ts +1 -0
  91. package/dist/src/tool-catalog.js +1 -1
  92. package/dist/src/transcript.js +1 -1
  93. package/dist/src/types.d.ts +34 -0
  94. package/package.json +1 -1
@@ -0,0 +1,327 @@
1
+ import { createReadStream } from 'node:fs';
2
+ import { readFile, readdir, stat } from 'node:fs/promises';
3
+ import { join } from 'node:path';
4
+ import { createInterface } from 'node:readline';
5
+ import { redactSecrets } from './memory/redaction.js';
6
+ import { hiddenSession, validSavedSession } from './sessions.js';
7
+ /** Byte limits the service enforces on the two attachments (infra/andorra-auth/bug_report.py). */
8
+ export const GRAPH_LIMIT = 8000;
9
+ export const TRAJECTORY_LIMIT = 12000;
10
+ const ID = /^[A-Za-z0-9_-]{1,64}$/;
11
+ const CONTROL = /[\u0000-\u0008\u000B-\u001F\u007F-\u009F­؜​-‏‪-‮⁠-⁤⁦--]/g;
12
+ const fields = (value) => value && typeof value === 'object' && !Array.isArray(value) ? value : {};
13
+ const word = (value) => typeof value === 'string' && value.trim() ? value.trim() : undefined;
14
+ /** One line of attachment text: no line breaks or control characters, no credential, at most `limit` characters. */
15
+ function clip(value, limit) {
16
+ if (typeof value !== 'string')
17
+ return '';
18
+ const text = redactSecrets(value.replace(/\s+/g, ' ').replace(CONTROL, '').trim()).text;
19
+ return text.length <= limit ? text : `${text.slice(0, limit)}… [${text.length - limit} more characters]`;
20
+ }
21
+ /** Fit whole lines into a byte limit: the start and the end are kept, since the end is where a run went wrong. */
22
+ function fit(lines, limit) {
23
+ const size = (text) => Buffer.byteLength(text, 'utf8');
24
+ // A single line longer than the limit cannot be kept whole; every line here is already clipped far below it.
25
+ const kept = lines.filter(line => size(line) < limit / 4);
26
+ if (size(kept.join('\n')) <= limit)
27
+ return kept.join('\n');
28
+ const marker = (count) => `… ${count} lines left out to fit the limit …`;
29
+ const budget = limit - size(marker(kept.length)) - 2;
30
+ const head = [];
31
+ const tail = [];
32
+ let used = 0;
33
+ let first = 0;
34
+ let last = kept.length - 1;
35
+ while (first <= last && used + size(kept[first]) + 1 <= budget * 0.25) {
36
+ used += size(kept[first]) + 1;
37
+ head.push(kept[first++]);
38
+ }
39
+ while (last >= first && used + size(kept[last]) + 1 <= budget) {
40
+ used += size(kept[last]) + 1;
41
+ tail.unshift(kept[last--]);
42
+ }
43
+ return [...head, marker(last - first + 1), ...tail].join('\n');
44
+ }
45
+ /**
46
+ * The sessions a report can be about: the newest saved ones, with the one this run belongs to first. Only the
47
+ * newest files are opened, so a home with thousands of sessions costs a directory listing and a few reads.
48
+ */
49
+ export async function listReportSessions(home, currentId, limit = 8) {
50
+ const directory = join(home, 'sessions');
51
+ let names;
52
+ try {
53
+ names = (await readdir(directory)).filter(name => name.endsWith('.json') && ID.test(name.slice(0, -5)));
54
+ }
55
+ catch {
56
+ return [];
57
+ }
58
+ const dated = (await Promise.all(names.map(async (name) => {
59
+ try {
60
+ return { name, modified: (await stat(join(directory, name))).mtimeMs };
61
+ }
62
+ catch {
63
+ return undefined;
64
+ }
65
+ }))).filter((entry) => !!entry).sort((a, b) => b.modified - a.modified);
66
+ const wanted = currentId && ID.test(currentId) ? `${currentId}.json` : undefined;
67
+ const order = [...(wanted && dated.some(entry => entry.name === wanted) ? [wanted] : []), ...dated.map(entry => entry.name).filter(name => name !== wanted)];
68
+ const sessions = [];
69
+ for (const name of order) {
70
+ if (sessions.length >= limit)
71
+ break;
72
+ try {
73
+ const value = JSON.parse(await readFile(join(directory, name), 'utf8'));
74
+ if (!validSavedSession(value) || `${value.id}.json` !== name || hiddenSession(value))
75
+ continue;
76
+ sessions.push({ id: value.id, name: clip(value.name, 80) || 'Untitled', updatedAt: value.updatedAt, ...(name === wanted ? { current: true } : {}) });
77
+ }
78
+ catch { }
79
+ }
80
+ return sessions;
81
+ }
82
+ /**
83
+ * A graph as one line per node and edge. Settings are listed; the text of an instruction, prompt or command is
84
+ * replaced by its length, because a bug in routing or tools is visible without the user's wording.
85
+ */
86
+ export function graphOutline(value) {
87
+ const graph = fields(value);
88
+ const nodes = Object.values(fields(graph.nodes)).map(fields).filter(node => word(node.id));
89
+ if (!word(graph.id) || !nodes.length)
90
+ return undefined;
91
+ const lines = [`graph "${clip(graph.name, 80)}" (${clip(graph.id, 80)}) revision ${Number(graph.revision) || 0}, schema ${Number(graph.schemaVersion) || 0}, entry ${clip(graph.entry, 64)}`];
92
+ const limits = Object.entries(fields(graph.limits)).filter(([, amount]) => typeof amount === 'number').map(([name, amount]) => `${name}=${amount}`);
93
+ if (limits.length)
94
+ lines.push(`limits ${limits.join(' ')}`);
95
+ for (const node of nodes) {
96
+ const parts = [`node ${clip(node.id, 64)} "${clip(node.name, 60)}" ${clip(node.type, 16)}`];
97
+ for (const name of ['agentRole', 'executor', 'provider', 'model', 'maxIterations', 'maxSubagents', 'jevEnabled']) {
98
+ const setting = node[name];
99
+ if (typeof setting === 'string' || typeof setting === 'number' || typeof setting === 'boolean')
100
+ parts.push(`${name}=${clip(String(setting), 80)}`);
101
+ }
102
+ for (const name of ['instruction', 'systemPrompt', 'prompt']) {
103
+ if (typeof node[name] === 'string' && node[name])
104
+ parts.push(`${name}=[${node[name].length} characters]`);
105
+ }
106
+ if (Array.isArray(node.tools))
107
+ parts.push(`tools=${node.tools.filter(tool => typeof tool === 'string').map(tool => clip(tool, 48)).join(',') || 'none'}`);
108
+ const capabilities = Object.entries(fields(node.capabilities)).filter(([, level]) => typeof level === 'string').map(([name, level]) => `${name}:${clip(level, 24)}`);
109
+ if (capabilities.length)
110
+ parts.push(`capabilities=${capabilities.join(',')}`);
111
+ const completion = fields(node.completion);
112
+ if (completion.mode === 'single')
113
+ parts.push(`completion=single[${clip(completion.outcome, 48)}]`);
114
+ else if (Array.isArray(completion.outcomes))
115
+ parts.push(`completion=outcomes[${completion.outcomes.map(outcome => clip(outcome, 48)).join(',')}]`);
116
+ const nodeLimits = Object.entries(fields(node.limits)).filter(([, amount]) => typeof amount === 'number').map(([name, amount]) => `${name}=${amount}`);
117
+ if (nodeLimits.length)
118
+ parts.push(`limits=${nodeLimits.join(',')}`);
119
+ const retry = fields(node.retry);
120
+ if (typeof retry.maxAttempts === 'number')
121
+ parts.push(`retry=${retry.maxAttempts}${fields(retry.fallback).provider ? '+fallback' : ''}`);
122
+ const roles = fields(node.subagents).roles;
123
+ if (Array.isArray(roles))
124
+ parts.push(`subagentRoles=${roles.length}`);
125
+ if (fields(node.join).mode)
126
+ parts.push(`join=${clip(fields(node.join).mode, 8)}`);
127
+ if (typeof fields(node.loop).maxIterations === 'number')
128
+ parts.push(`loop=${fields(node.loop).maxIterations}`);
129
+ if (word(fields(node.condition).source))
130
+ parts.push(`condition=${clip(fields(node.condition).source, 64)}.${clip(fields(node.condition).path, 64)}`);
131
+ const action = fields(node.action);
132
+ if (word(action.kind))
133
+ parts.push(`action=${clip(action.kind, 16)}[${typeof action.command === 'string' ? action.command.length : 0} characters]`);
134
+ if (typeof fields(node.review).rounds === 'number')
135
+ parts.push(`review=${fields(node.review).rounds} rounds`);
136
+ lines.push(parts.join(' '));
137
+ }
138
+ for (const edge of Array.isArray(graph.edges) ? graph.edges.map(fields) : []) {
139
+ if (!word(edge.source) || !word(edge.target))
140
+ continue;
141
+ lines.push(`edge ${clip(edge.source, 64)} -> ${clip(edge.target, 64)}${word(edge.outcome) ? ` [${clip(edge.outcome, 48)}]` : ''}${word(edge.toInput) ? ` as ${clip(edge.toInput, 48)}` : ''}`);
142
+ }
143
+ return fit(lines, GRAPH_LIMIT);
144
+ }
145
+ const seconds = (ms) => typeof ms === 'number' && Number.isFinite(ms) ? `${(ms / 1000).toFixed(1)}s` : '';
146
+ const count = (value) => {
147
+ const amount = typeof value === 'number' && Number.isFinite(value) ? value : 0;
148
+ return amount >= 1e6 ? `${(amount / 1e6).toFixed(1)}M` : amount >= 1e3 ? `${Math.round(amount / 1e3)}k` : String(amount);
149
+ };
150
+ /**
151
+ * Reads a session's trajectory into the two attachments: the graph of the last run it reports, and each run as a short
152
+ * list of steps (nodes, tools, retries, refusals, how it stopped). It never copies a prompt, a model reply, tool
153
+ * arguments or a successful tool's output; a failed step keeps the first 200 characters of its error.
154
+ */
155
+ export class TrajectoryDigest {
156
+ runs = [];
157
+ /** One line of the trajectory file. Model requests and replies are the bulk of the file and are skipped unparsed. */
158
+ add(line) {
159
+ if (!line || line.startsWith('{"type":"model.'))
160
+ return;
161
+ let record;
162
+ try {
163
+ record = fields(JSON.parse(line));
164
+ }
165
+ catch {
166
+ return;
167
+ }
168
+ const time = Date.parse(String(record.time ?? ''));
169
+ if (record.type === 'run.started') {
170
+ const run = this.run(word(record.runId), time);
171
+ const graph = typeof record.graph === 'string' ? record.graph : fields(record.graph).id;
172
+ run.lines.push(`run started ${Number.isFinite(time) ? new Date(time).toISOString() : ''} graph=${clip(graph, 80) || 'default'} model=${clip(record.provider, 48)}/${clip(record.model, 64)}`.replace(/\s+/g, ' '));
173
+ }
174
+ else if (record.type === 'run.finished') {
175
+ const run = this.run(word(record.runId), time);
176
+ this.flush(run);
177
+ const usage = fields(record.usage);
178
+ // A run that fails before its graph starts (a model check, a graph that does not load) leaves its reason only here.
179
+ const error = clip(record.error, 200);
180
+ run.lines.push(`${this.at(run, time)} run finished: ${clip(record.status, 32)} · ${count(usage.requests)} requests, ${count(record.toolCalls)} tool calls, ${count(usage.inputTokens)} in / ${count(usage.outputTokens)} out${error ? ` — ${error}` : ''}`);
181
+ run.finished = true;
182
+ }
183
+ else if (record.type === 'runtime.event') {
184
+ const event = fields(record.event);
185
+ this.event(String(event.type ?? ''), fields(event.data), Date.parse(String(event.time ?? record.time ?? '')));
186
+ }
187
+ }
188
+ run(id, time) {
189
+ const found = id ? this.runs.find(run => run.id === id) : this.runs.at(-1);
190
+ if (found) {
191
+ if (found.started === undefined && Number.isFinite(time))
192
+ found.started = time;
193
+ return found;
194
+ }
195
+ const run = { id: id ?? `run-${this.runs.length + 1}`, ...(Number.isFinite(time) ? { started: time } : {}), finished: false, lines: [] };
196
+ this.runs.push(run);
197
+ return run;
198
+ }
199
+ at(run, time) {
200
+ if (run.started === undefined || !Number.isFinite(time))
201
+ return '+??:??';
202
+ const elapsed = Math.max(0, Math.round((time - run.started) / 1000));
203
+ return `+${String(Math.floor(elapsed / 60)).padStart(2, '0')}:${String(elapsed % 60).padStart(2, '0')}`;
204
+ }
205
+ flush(run) {
206
+ const tool = run.tool;
207
+ if (!tool)
208
+ return;
209
+ run.tool = undefined;
210
+ run.lines.push(`${tool.at} ${tool.node ? `[${tool.node}] ` : ''}${tool.name}${tool.count > 1 ? ` ×${tool.count}` : ''} ok ${seconds(tool.ms)}`.trimEnd());
211
+ }
212
+ event(type, data, time) {
213
+ if (!type)
214
+ return;
215
+ // Kept with its run: the graph of the run that is reporting the bug must not stand in for the one that had it.
216
+ if (type === 'graph.started') {
217
+ if (word(fields(data.graph).id))
218
+ this.run(word(data.runId), time).graph = data.graph;
219
+ return;
220
+ }
221
+ const quiet = type === 'node.tool.completed';
222
+ const telling = quiet || /^(?:graph\.(?:node\.(?:started|completed)|edge\.activated|stopped)|node\.tool\.failed|agent\.(?:model\.retry|completion\.(?:rejected|coerced)|turn\.continued|clarification\.requested))$/.test(type) || /(?:error|\.failed)$/.test(type);
223
+ if (!telling)
224
+ return;
225
+ const run = this.run(word(data.runId), time);
226
+ const at = this.at(run, time);
227
+ const node = clip(data.nodeName ?? data.nodeId, 48);
228
+ const name = clip(data.name, 64);
229
+ if (quiet) {
230
+ const ms = typeof data.durationMs === 'number' ? data.durationMs : 0;
231
+ if (run.tool && run.tool.name === name && run.tool.node === node) {
232
+ run.tool.count++;
233
+ run.tool.ms += ms;
234
+ }
235
+ else {
236
+ this.flush(run);
237
+ run.tool = { name, node, count: 1, ms, at };
238
+ }
239
+ return;
240
+ }
241
+ this.flush(run);
242
+ const where = node ? `[${node}] ` : '';
243
+ const line = (text) => run.lines.push(`${at} ${text}`.trimEnd());
244
+ switch (type) {
245
+ case 'graph.node.started':
246
+ line(`node ${node} (${clip(data.nodeType, 16)}) started, visit ${Number(data.visit) || 1}${word(data.model) ? `, model=${clip(data.provider, 48)}/${clip(data.model, 64)}` : ''}`);
247
+ break;
248
+ case 'graph.node.completed':
249
+ line(`node ${node} completed${word(fields(data.completion).outcome) ? `: ${clip(fields(data.completion).outcome, 48)}` : ''}`);
250
+ break;
251
+ case 'graph.edge.activated':
252
+ line(`edge ${clip(data.source, 64)} -> ${clip(data.target, 64)}${word(data.outcome) ? ` [${clip(data.outcome, 48)}]` : ''}`);
253
+ break;
254
+ case 'graph.stopped':
255
+ line(`${where}graph stopped: ${clip(data.status, 32)}${word(data.reason) ? `, ${clip(data.reason, 64)}` : ''}${word(data.reasonText) ? ` — ${clip(data.reasonText, 200)}` : ''}`);
256
+ break;
257
+ case 'node.tool.failed':
258
+ line(`${where}${name} failed ${seconds(data.durationMs)}: ${clip(data.output, 200)}`.replace(/\s+/g, ' '));
259
+ break;
260
+ case 'agent.model.retry':
261
+ line(`${where}model retry ${Number(data.retry) || 0}/${Number(data.maxRetries) || 0}: ${clip(data.reason, 200)}`);
262
+ break;
263
+ case 'agent.completion.rejected':
264
+ line(`${where}completion rejected: ${clip(data.reason, 200)}`);
265
+ break;
266
+ case 'agent.completion.coerced':
267
+ line(`${where}completion coerced`);
268
+ break;
269
+ case 'agent.turn.continued':
270
+ line(`${where}turn continued: ${clip(data.reason, 80)}`);
271
+ break;
272
+ case 'agent.clarification.requested':
273
+ line(`${where}asked the user a question`);
274
+ break;
275
+ default: line(`${where}${clip(type, 64)}: ${clip(data.message ?? data.reason ?? data.error ?? data.detail, 200)}`);
276
+ }
277
+ }
278
+ /** `skipOpenRun` leaves out a last run that has not finished: in the reporting session, that run is the report itself. */
279
+ result(options = {}) {
280
+ const runs = options.skipOpenRun && this.runs.at(-1)?.finished === false ? this.runs.slice(0, -1) : this.runs;
281
+ const lines = [];
282
+ runs.forEach((run, index) => {
283
+ this.flush(run);
284
+ if (!run.lines.length)
285
+ return;
286
+ if (!run.lines[0].startsWith('run started'))
287
+ lines.push(`run ${index + 1}`);
288
+ lines.push(...run.lines.map((line, at) => at === 0 && line.startsWith('run started') ? `run ${index + 1}: ${line.slice(4)}` : ` ${line}`));
289
+ });
290
+ const graph = graphOutline(runs.findLast(run => run.graph !== undefined)?.graph);
291
+ return { ...(graph ? { graph } : {}), ...(lines.length ? { trajectory: fit(lines, TRAJECTORY_LIMIT) } : {}) };
292
+ }
293
+ }
294
+ /** Whether this machine has a saved session or a trajectory under that id. */
295
+ export async function sessionExists(home, sessionId) {
296
+ if (!ID.test(sessionId))
297
+ return false;
298
+ const present = (path) => stat(path).then(entry => entry.isFile(), () => false);
299
+ return await present(join(home, 'sessions', `${sessionId}.json`)) || await present(join(home, 'trajectories', `${sessionId}.jsonl`));
300
+ }
301
+ /** The graph and compressed trajectory of one saved session, or nothing when the session left no trajectory. */
302
+ export async function sessionAttachments(home, sessionId, options = {}) {
303
+ if (!ID.test(sessionId))
304
+ return {};
305
+ let trajectoryId = sessionId;
306
+ try {
307
+ const saved = JSON.parse(await readFile(join(home, 'sessions', `${sessionId}.json`), 'utf8'));
308
+ if (validSavedSession(saved) && saved.id === sessionId && saved.trajectoryId && ID.test(saved.trajectoryId))
309
+ trajectoryId = saved.trajectoryId;
310
+ }
311
+ catch { }
312
+ const digest = new TrajectoryDigest();
313
+ const stream = createReadStream(join(home, 'trajectories', `${trajectoryId}.jsonl`), { encoding: 'utf8', ...(options.signal ? { signal: options.signal } : {}) });
314
+ try {
315
+ for await (const line of createInterface({ input: stream, crlfDelay: Infinity }))
316
+ digest.add(line);
317
+ }
318
+ catch (error) {
319
+ options.signal?.throwIfAborted();
320
+ if (error.code !== 'ENOENT')
321
+ throw error;
322
+ }
323
+ finally {
324
+ stream.destroy();
325
+ }
326
+ return digest.result({ skipOpenRun: options.current === true });
327
+ }
@@ -1,7 +1,13 @@
1
+ import { sessionAttachments, type SessionAttachments } from './bug-report-attachments.js';
1
2
  import type { Tool } from './types.js';
2
3
  /** The built-in skill that interviews the user; a run that carries it also gets the tool below. */
3
4
  export declare const BUG_REPORT_SKILL = "andorra:bug-report";
4
5
  export declare const BUG_REPORT_TOOL = "submit_bug_report";
6
+ /** Tells the interview which session this conversation is and which others exist, so it can ask where the bug was. */
7
+ export declare const BUG_REPORT_SESSIONS_TOOL = "list_bug_report_sessions";
8
+ /** The two `session` answers that are not a session id. */
9
+ export declare const CURRENT_SESSION = "current";
10
+ export declare const NO_SESSION = "none";
5
11
  export declare const SEND_CHOICE = "Send report";
6
12
  export declare const CANCEL_CHOICE = "Do not send";
7
13
  /** The report's text fields with the byte limits the service enforces (infra/andorra-auth/bug_report.py). */
@@ -32,10 +38,11 @@ declare const FIELDS: readonly [{
32
38
  readonly heading: "Actual";
33
39
  }];
34
40
  type FieldName = typeof FIELDS[number]['name'];
41
+ /** `graph` and `trajectory` are read from the session the user named; the model never writes them. */
35
42
  export type BugReport = {
36
43
  title: string;
37
44
  description: string;
38
- } & Partial<Record<Exclude<FieldName, 'title' | 'description'>, string>>;
45
+ } & Partial<Record<Exclude<FieldName, 'title' | 'description'>, string>> & SessionAttachments;
39
46
  export interface BugReportEnvironment {
40
47
  appVersion?: string;
41
48
  surface?: 'cli' | 'desktop';
@@ -49,8 +56,16 @@ export declare class BugReportError extends Error {
49
56
  }
50
57
  /** The report as it will be sent: trimmed, bounded, and with anything credential-shaped replaced. */
51
58
  export declare function normalizeBugReport(args: Record<string, unknown>): BugReport;
52
- /** Exactly what the user is asked to approve: every field that will be sent, and what is attached. */
53
- export declare function bugReportPreview(report: BugReport, environment: BugReportEnvironment): string;
59
+ /** Which session the report is about: this one, a named one, or none (a bug in the program, not in a session). */
60
+ export declare function reportSession(args: Record<string, unknown>): string;
61
+ /** What the closing line of the confirmation promises about the report. Shown every time, just above the choices. */
62
+ export declare const REPORT_USE = "is used only to debug the problem. It is kept in the Andorra team's private bug tracker and is never used to train models.";
63
+ /**
64
+ * Exactly what the user is asked to approve: every field that will be sent, the graph and trajectory in full
65
+ * when a session is attached, and how the report is used. `sessionNamed` is set when the user named a session,
66
+ * so a session that left nothing to attach is said rather than passed over.
67
+ */
68
+ export declare function bugReportPreview(report: BugReport, environment: BugReportEnvironment, sessionNamed?: boolean): string;
54
69
  export declare function bugReportEnvironment(env?: NodeJS.ProcessEnv, version?: () => Promise<string | undefined>): Promise<BugReportEnvironment>;
55
70
  export interface BugReportDependencies {
56
71
  accessToken(signal?: AbortSignal): Promise<string>;
@@ -69,10 +84,15 @@ export declare function createBugReportClient(deps: BugReportDependencies): BugR
69
84
  export declare const bugReports: BugReportClient;
70
85
  export interface BugReportToolOptions {
71
86
  client?: BugReportClient;
87
+ /** Where sessions and trajectories are kept. Defaults to the run's own home. */
88
+ home?: string;
89
+ attachments?: typeof sessionAttachments;
72
90
  environment?: () => Promise<BugReportEnvironment>;
73
91
  /** Tells the surface a question is open, the way ask_user does, so the tool clock pauses while it waits. */
74
92
  emit?: (type: string, data: Record<string, unknown>) => void | Promise<void>;
75
93
  }
94
+ /** Lists the sessions a report can be about. It reads names and dates only, and nothing leaves the machine. */
95
+ export declare function bugReportSessionsTool(options?: Pick<BugReportToolOptions, 'home'>): Tool;
76
96
  /**
77
97
  * Files a bug report with the Andorra team. The report leaves the machine only after the user has read
78
98
  * exactly what will be sent and chosen to send it, so the tool refuses on a surface where nobody can answer.
@@ -2,10 +2,17 @@ import { readFile } from 'node:fs/promises';
2
2
  import { fileURLToPath } from 'node:url';
3
3
  import { AUTH_DEPLOYMENT } from './auth/deployment.js';
4
4
  import { AuthError } from './auth/types.js';
5
+ import { configDirectory } from './config.js';
5
6
  import { redactSecrets } from './memory/redaction.js';
7
+ import { GRAPH_LIMIT, TRAJECTORY_LIMIT, listReportSessions, sessionAttachments, sessionExists } from './bug-report-attachments.js';
6
8
  /** The built-in skill that interviews the user; a run that carries it also gets the tool below. */
7
9
  export const BUG_REPORT_SKILL = 'andorra:bug-report';
8
10
  export const BUG_REPORT_TOOL = 'submit_bug_report';
11
+ /** Tells the interview which session this conversation is and which others exist, so it can ask where the bug was. */
12
+ export const BUG_REPORT_SESSIONS_TOOL = 'list_bug_report_sessions';
13
+ /** The two `session` answers that are not a session id. */
14
+ export const CURRENT_SESSION = 'current';
15
+ export const NO_SESSION = 'none';
9
16
  export const SEND_CHOICE = 'Send report';
10
17
  export const CANCEL_CHOICE = 'Do not send';
11
18
  /** The report's text fields with the byte limits the service enforces (infra/andorra-auth/bug_report.py). */
@@ -49,9 +56,9 @@ function fieldText(value, field) {
49
56
  }
50
57
  /** The report as it will be sent: trimmed, bounded, and with anything credential-shaped replaced. */
51
58
  export function normalizeBugReport(args) {
52
- const unknown = Object.keys(args).filter(key => !FIELDS.some(field => field.name === key));
59
+ const unknown = Object.keys(args).filter(key => key !== 'session' && !FIELDS.some(field => field.name === key));
53
60
  if (unknown.length)
54
- throw new BugReportError('invalid', `Unknown bug report field${unknown.length === 1 ? '' : 's'}: ${unknown.join(', ')}. Use title, description, steps, expected and actual.`);
61
+ throw new BugReportError('invalid', `Unknown bug report field${unknown.length === 1 ? '' : 's'}: ${unknown.join(', ')}. Use title, description, steps, expected, actual and session.`);
55
62
  const report = {};
56
63
  for (const field of FIELDS) {
57
64
  const text = fieldText(args[field.name], field);
@@ -60,13 +67,32 @@ export function normalizeBugReport(args) {
60
67
  }
61
68
  return report;
62
69
  }
63
- /** Exactly what the user is asked to approve: every field that will be sent, and what is attached. */
64
- export function bugReportPreview(report, environment) {
70
+ const SESSION_ID = /^[A-Za-z0-9_-]{1,64}$/;
71
+ /** Which session the report is about: this one, a named one, or none (a bug in the program, not in a session). */
72
+ export function reportSession(args) {
73
+ const value = typeof args.session === 'string' ? args.session.trim() : '';
74
+ if (value === CURRENT_SESSION || value === NO_SESSION || SESSION_ID.test(value))
75
+ return value;
76
+ throw new BugReportError('invalid', `A bug report needs session: "${CURRENT_SESSION}" when the problem is in this conversation's session, a session id from ${BUG_REPORT_SESSIONS_TOOL} when it is in another one, or "${NO_SESSION}" when it is not tied to a session. Ask the user which, and call again.`);
77
+ }
78
+ /** What the closing line of the confirmation promises about the report. Shown every time, just above the choices. */
79
+ export const REPORT_USE = 'is used only to debug the problem. It is kept in the Andorra team\'s private bug tracker and is never used to train models.';
80
+ /**
81
+ * Exactly what the user is asked to approve: every field that will be sent, the graph and trajectory in full
82
+ * when a session is attached, and how the report is used. `sessionNamed` is set when the user named a session,
83
+ * so a session that left nothing to attach is said rather than passed over.
84
+ */
85
+ export function bugReportPreview(report, environment, sessionNamed = false) {
65
86
  const attached = [environment.appVersion ? `Andorra Code ${environment.appVersion}` : undefined, environment.surface, environment.os, environment.arch].filter(Boolean).join(', ');
87
+ const session = report.graph !== undefined || report.trajectory !== undefined;
66
88
  return [
67
89
  'Send this bug report to the Andorra team?',
68
90
  ...FIELDS.filter(field => report[field.name] !== undefined).map(field => `${field.heading}:\n${report[field.name]}`),
69
- `Also sent: your account id and plan, and ${attached}. Nothing else: no files, prompts or conversation.`,
91
+ ...(report.graph === undefined ? [] : [`Affected graph (its settings and routes; the text of each instruction is left out):\n${report.graph}`]),
92
+ ...(report.trajectory === undefined ? [] : [`Compressed trajectory of the session (steps, tools, outcomes and error text):\n${report.trajectory}`]),
93
+ ...(sessionNamed && !session ? ['That session left no graph or trajectory on this machine, so none is attached.'] : []),
94
+ `Also sent: your account id and plan, and ${attached}. Nothing else: no files, prompts or ${session ? 'model replies' : 'conversation'}.`,
95
+ `This report${session ? ', with the graph and trajectory above,' : ''} ${REPORT_USE}`,
70
96
  ].join('\n\n');
71
97
  }
72
98
  async function packageVersion() {
@@ -173,6 +199,29 @@ export const bugReports = createBugReportClient({
173
199
  apiBaseUrl: () => AUTH_DEPLOYMENT.apiBaseUrl,
174
200
  fetch: (...args) => globalThis.fetch(...args),
175
201
  });
202
+ function attachment(name, value, limit) {
203
+ const text = value?.trim();
204
+ return text && Buffer.byteLength(text, 'utf8') <= limit ? { [name]: text } : {};
205
+ }
206
+ /** Lists the sessions a report can be about. It reads names and dates only, and nothing leaves the machine. */
207
+ export function bugReportSessionsTool(options = {}) {
208
+ return {
209
+ name: BUG_REPORT_SESSIONS_TOOL, executionMode: 'sequential',
210
+ description: 'List the sessions a bug report can be about: the one this conversation is in (marked current) and the most recent others, newest first. Call it once during the bug-report interview, before asking the user which session has the problem. It reads session names and dates on this machine and sends nothing.',
211
+ parameters: { type: 'object', properties: {}, additionalProperties: false },
212
+ eventOutput: () => 'Listed sessions.',
213
+ execute: async (_args, ctx) => {
214
+ ctx.signal.throwIfAborted();
215
+ const sessions = await listReportSessions(options.home ?? ctx.automationDirectory ?? configDirectory(), ctx.sessionId);
216
+ const current = sessions.find(session => session.current);
217
+ return JSON.stringify({
218
+ current: current ? { id: current.id, name: current.name } : null,
219
+ others: sessions.filter(session => !session.current).map(({ id, name, updatedAt }) => ({ id, name, updatedAt })),
220
+ note: `Ask the user whether the problem is in ${current ? `this session ("${current.name}")` : 'this conversation'}, in another session, or not tied to a session. Pass ${BUG_REPORT_TOOL} session "${CURRENT_SESSION}", the other session's id, or "${NO_SESSION}".${current ? '' : ' This conversation has not been saved as a session yet, so "current" has nothing to attach.'}`,
221
+ });
222
+ },
223
+ };
224
+ }
176
225
  /**
177
226
  * Files a bug report with the Andorra team. The report leaves the machine only after the user has read
178
227
  * exactly what will be sent and chosen to send it, so the tool refuses on a surface where nobody can answer.
@@ -183,14 +232,15 @@ export function bugReportTool(options = {}) {
183
232
  const text = { type: 'string', minLength: 1 };
184
233
  return {
185
234
  name: BUG_REPORT_TOOL, executionMode: 'sequential',
186
- description: 'Send a bug report about Andorra Code to the Andorra team. Call it only after the bug-report skill\'s interview, with the answers the user gave: never invent steps or details. The tool shows the user the exact report and sends it only if they choose to; a different answer comes back to you as their requested change. It needs a signed-in Andorra account (any plan). Never put credentials, private code or file contents in a report.',
235
+ description: 'Send a bug report about Andorra Code to the Andorra team. Call it only after the bug-report skill\'s interview, with the answers the user gave: never invent steps or details. Pass the session the user said has the problem; the tool reads that session\'s graph and a compressed trajectory itself and attaches them, so do not write either into the text. The tool shows the user the exact report and sends it only if they choose to; a different answer comes back to you as their requested change. It needs a signed-in Andorra account (any plan). Never put credentials, private code or file contents in a report.',
187
236
  parameters: { type: 'object', properties: {
188
237
  title: { ...text, maxLength: 120, description: 'One line naming the problem, for example "Send button does nothing after attaching a file".' },
189
238
  description: { ...text, maxLength: 4000, description: 'What happened, in the user\'s words, with any error text they saw.' },
190
239
  steps: { ...text, maxLength: 2000, description: 'Numbered steps that reproduce it, if the user knows them.' },
191
240
  expected: { ...text, maxLength: 1000, description: 'What the user expected to happen.' },
192
241
  actual: { ...text, maxLength: 2000, description: 'What happened instead.' },
193
- }, required: ['title', 'description'], additionalProperties: false },
242
+ session: { ...text, maxLength: 64, description: `Where the problem happened, as the user answered: "${CURRENT_SESSION}" for this conversation's session, the id of another session from ${BUG_REPORT_SESSIONS_TOOL}, or "${NO_SESSION}" for a bug in the program that is not tied to a session.` },
243
+ }, required: ['title', 'description', 'session'], additionalProperties: false },
194
244
  eventOutput: output => {
195
245
  try {
196
246
  const result = JSON.parse(output);
@@ -202,13 +252,26 @@ export function bugReportTool(options = {}) {
202
252
  },
203
253
  execute: async (args, ctx) => {
204
254
  ctx.signal.throwIfAborted();
205
- const report = normalizeBugReport(args);
255
+ const written = normalizeBugReport(args);
256
+ const session = reportSession(args);
206
257
  if (ctx.approvalMode === 'headless' || !ctx.askUser)
207
258
  throw new BugReportError('refused', 'A bug report is sent only after the user reads and confirms it, and nobody can answer on this surface. Nothing was sent. Tell the user to run /bug-report in an interactive session (the terminal app or the desktop app).');
208
259
  // Checked first so a signed-out user is never asked to confirm a report that cannot be sent.
209
260
  await client.token(ctx.signal);
210
261
  const environment = await environmentOf();
211
- const question = bugReportPreview(report, environment);
262
+ const home = options.home ?? ctx.automationDirectory ?? configDirectory();
263
+ let found = {};
264
+ if (session !== NO_SESSION) {
265
+ const id = session === CURRENT_SESSION ? ctx.sessionId : session;
266
+ if (!id)
267
+ throw new BugReportError('invalid', `This conversation has no saved session to attach. Nothing was sent. Ask the user whether another session has the problem (${BUG_REPORT_SESSIONS_TOOL} lists them) or pass session "${NO_SESSION}".`);
268
+ if (!options.attachments && !await sessionExists(home, id))
269
+ throw new BugReportError('invalid', `There is no session ${id} on this machine. Nothing was sent. Use an id from ${BUG_REPORT_SESSIONS_TOOL}, "${CURRENT_SESSION}" or "${NO_SESSION}".`);
270
+ found = await (options.attachments ?? sessionAttachments)(home, id, { current: id === ctx.sessionId, signal: ctx.signal });
271
+ }
272
+ // Bounded again here: the attachments are built on this machine, and the service refuses a report over its limits.
273
+ const report = { ...written, ...attachment('graph', found.graph, GRAPH_LIMIT), ...attachment('trajectory', found.trajectory, TRAJECTORY_LIMIT) };
274
+ const question = bugReportPreview(report, environment, session !== NO_SESSION);
212
275
  const choices = [SEND_CHOICE, CANCEL_CHOICE];
213
276
  await options.emit?.('agent.clarification.requested', { question, choices });
214
277
  let answer;
package/dist/src/cli.d.ts CHANGED
@@ -13,9 +13,7 @@ export declare function isContinuationPrompt(text: string): boolean;
13
13
  export declare function continuedTodos(task: string, lastRun?: RunResult): import('./todos.js').TodoItem[];
14
14
  export { providerSecrets };
15
15
  export declare function appendRunEvent(directory: string, event: RuntimeEvent): Promise<void>;
16
- export type ResolvedNodeModel = import('./runtime.js').ResolvedGraphModel & {
17
- reasoningEffort?: string;
18
- };
16
+ export type ResolvedNodeModel = import('./runtime.js').ResolvedGraphModel;
19
17
  export declare function withNodeModelResolution(event: RuntimeEvent, lookup: (provider: string, model: string) => Promise<ResolvedNodeModel | undefined> | undefined): Promise<RuntimeEvent>;
20
18
  export declare function main(argv?: string[], dependencies?: {
21
19
  loadGraph?: typeof loadAccessibleGraph;
package/dist/src/cli.js CHANGED
@@ -14,7 +14,8 @@ import { homedir } from 'node:os';
14
14
  import { workspacePermissionKey, permissionLabel } from './permissions.js';
15
15
  import { configDirectory, loadConfig, resolveCodeIntelConfig, resolveConfiguredLimits, saveConfig } from './config.js';
16
16
  import { andorraRefusal, compactHistory, compactedContextEstimate, executeCommand, HELP } from './commands.js';
17
- import { applyModelContextWindow, createAdapter, findProviderById, providerModelId, modelDisplayName, modelIdForDisplayName, providerModelNames, providerSecrets, recordProviderModel, runProvider } from './providers.js';
17
+ import { applyModelContextWindow, createAdapter, findProviderById, providerModelId, modelDisplayName, modelIdForDisplayName, providerModelNames, providerSecrets, recordProviderModel, runProvider, supportsReasoningEffort } from './providers.js';
18
+ import { autoLevels, enabledLevels } from './thinking-levels.js';
18
19
  import { disposeAllQaProcesses, disposeAllQaPtys, getQaPtyManager } from './qa/index.js';
19
20
  import { disposePooledPowerShell } from './powershell-pool.js';
20
21
  import { loadWorkspaceInstructions, systemPromptOverrideFor } from './workspace-instructions.js';
@@ -1608,16 +1609,19 @@ export async function main(argv = process.argv.slice(2), dependencies = {}) {
1608
1609
  terminal?.setStatus({ graph, jevEnabled, jevOffThisRun: jevEnabled && !membership.subject });
1609
1610
  const commandMemory = config.commandMemory === false || isolated ? undefined : await LocalToolMemory.open({ workspace, directory });
1610
1611
  const projectMemory = config.projectMemory === false || isolated ? undefined : await ProjectMemory.open({ home: directory, workspace });
1611
- const resolveRunModel = (id, model, wait = preflight) => {
1612
+ const resolveRunModel = (id, model, wait = preflight, effort) => {
1612
1613
  const provider = runProvider(config, runProviders, id);
1613
1614
  if (!provider)
1614
1615
  throw new Error(`Unknown provider: ${id}. Use /providers to add or edit providers.`);
1615
1616
  const wanted = model || runDefaults.get(id) || provider.model;
1616
- const key = JSON.stringify([id, wanted]);
1617
+ // A node's own thinking level is a different model snapshot from the provider's saved one.
1618
+ const level = effort !== undefined && supportsReasoningEffort(provider.type) ? effort : undefined;
1619
+ const key = JSON.stringify(level === undefined ? [id, wanted] : [id, wanted, level]);
1617
1620
  let pending = resolvedModels.get(key);
1618
1621
  if (!pending) {
1619
1622
  pending = wait(signal => resolveModelContext(provider, wanted, signal))
1620
1623
  .then(snapshot => withEvaluationReasoningEffort(snapshot, process.env.ANDORRA_EVAL_REASONING_EFFORT))
1624
+ .then(snapshot => level === undefined ? snapshot : { ...snapshot, reasoningEffort: level })
1621
1625
  .then(snapshot => ({ model: snapshot.model, adapter: tracedAdapter(snapshot), contextWindow: snapshot.contextWindow, reasoningEffort: snapshot.reasoningEffort, providerType: provider.type, baseUrl: provider.baseUrl }));
1622
1626
  resolvedModels.set(key, pending);
1623
1627
  void pending.catch(() => { if (resolvedModels.get(key) === pending)
@@ -1725,7 +1729,8 @@ export async function main(argv = process.argv.slice(2), dependencies = {}) {
1725
1729
  };
1726
1730
  const execute = (options) => runGraph(graph, { ...options, runInput, runState, commandMemory, projectMemory, todoStore,
1727
1731
  ...(runSkill.skills?.length ? { inheritedSkills: runSkill.skills.map(skill => skill.id), skillInvocationInstruction: runSkill.instruction } : {}),
1728
- resolveModel: (id, model) => resolveRunModel(id, model),
1732
+ resolveModel: (id, model, _signal, effort) => resolveRunModel(id, model, undefined, effort),
1733
+ thinkingLevels: (id, model, forAuto) => (forAuto ? autoLevels : enabledLevels)(runProvider(config, runProviders, id), model),
1729
1734
  getLiveModel: async (nodeId, currentProvider, currentModel) => {
1730
1735
  while (true) {
1731
1736
  const current = liveSelection;
@@ -1802,6 +1807,7 @@ export async function main(argv = process.argv.slice(2), dependencies = {}) {
1802
1807
  } : undefined,
1803
1808
  context: { workspace, signal: active.signal, runControl, timers: terminal ? sessionTimers : undefined,
1804
1809
  automationDirectory: directory,
1810
+ get sessionId() { return savedSession?.id ?? trajectory.sessionId; },
1805
1811
  wakeCarry,
1806
1812
  get yolo() { return state.yolo; }, get permissions() { return state.permissions; }, get attachmentRoots() { return [...attachmentSpools]; }, approvalMode: terminal ? 'interactive' : 'headless',
1807
1813
  askUser: terminal ? async (question, signal, choices) => {
@@ -155,7 +155,7 @@ export function createCodexAdapter(config, connect = codexConnectFor(config)) {
155
155
  request.onRequest?.();
156
156
  const startedTurn = await rpc.request('turn/start', {
157
157
  threadId, environments: [], outputSchema,
158
- input: [{ type: 'text', text: JSON.stringify({ conversation: request.messages.map(({ images, ...message }) => ({ ...message,
158
+ input: [{ type: 'text', text: JSON.stringify({ conversation: request.messages.map(({ images, providerContinuation, ...message }) => ({ ...message,
159
159
  ...(images?.length ? { imageCount: images.length } : {}) })), availableTools: request.tools }), text_elements: [] },
160
160
  ...request.messages.flatMap(message => (message.images ?? []).map(image => ({ type: 'image', url: `data:${image.mimeType};base64,${image.data}` })))],
161
161
  });
@@ -924,15 +924,22 @@ export function createCodingTools(policy) {
924
924
  const current = kind === 'powershell'
925
925
  ? andorraCreatePowerShellTool(cwd, { operations, persistOutput: false, exposeSessionEnvironment: false })
926
926
  : andorraCreateBashTool(cwd, { operations, persistOutput: false, exposeSessionEnvironment: false });
927
+ // The turn's evidence cites what ran: the runtime records it before it starts and when it ends.
928
+ const observed = await context.observeCommand?.({ command, directory: cwd, signal: context.signal }).catch(() => undefined);
927
929
  return auditedCommand(cwd, command, launchPolicy, async () => {
928
930
  try {
929
931
  const result = await current.execute(randomUUID(), { command, timeout: timeout / 1000 }, context.signal);
930
- return nativeObservation(result.content.filter(part => part.type === 'text').map(part => part.text).join('\n'), true);
932
+ const text = result.content.filter(part => part.type === 'text').map(part => part.text).join('\n');
933
+ observed?.({ exitCode: 0, output: text });
934
+ return nativeObservation(text, true);
931
935
  }
932
936
  catch (error) {
933
- if (!(error instanceof Error))
937
+ if (!(error instanceof Error)) {
938
+ observed?.({ output: String(error) });
934
939
  throw error;
940
+ }
935
941
  const exited = /(?:^|\n\n)Command exited with code (\d+)$/.exec(error.message);
942
+ observed?.({ ...(exited ? { exitCode: Number(exited[1]) } : {}), output: error.message });
936
943
  if (exited)
937
944
  throw new CommandExitError(nativeObservation(error.message, true), Number(exited[1]));
938
945
  const message = shellTimeoutGuidance(error.message, timeout);