@atolis-hq/wake 0.2.85 → 0.2.87
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.
|
@@ -5,8 +5,7 @@ import { writeRunnerTranscript } from '../runner/transcripts.js';
|
|
|
5
5
|
import { createAgentExecution } from '../../core/live-execution.js';
|
|
6
6
|
import { parseRunnerResult } from '../../domain/schema.js';
|
|
7
7
|
const CODEX_CLI_NAME = 'Codex';
|
|
8
|
-
|
|
9
|
-
const prompt = buildCodexPromptText(input);
|
|
8
|
+
function buildCodexExecPrefixArgs(input) {
|
|
10
9
|
return [
|
|
11
10
|
'--ask-for-approval',
|
|
12
11
|
'never',
|
|
@@ -22,16 +21,20 @@ export function buildCodexExecArgs(input) {
|
|
|
22
21
|
input.cwd,
|
|
23
22
|
'--model',
|
|
24
23
|
input.model,
|
|
25
|
-
prompt,
|
|
26
24
|
];
|
|
27
25
|
}
|
|
26
|
+
export function buildCodexExecArgs(input) {
|
|
27
|
+
const prompt = buildCodexPromptText(input);
|
|
28
|
+
return [...buildCodexExecPrefixArgs(input), prompt];
|
|
29
|
+
}
|
|
28
30
|
export function buildCodexPromptText(input) {
|
|
29
31
|
return input.harnessPrompt === undefined
|
|
30
32
|
? input.prompt
|
|
31
33
|
: `${input.harnessPrompt}\n\n${input.prompt}`;
|
|
32
34
|
}
|
|
33
35
|
export function buildCodexResumeArgs(input) {
|
|
34
|
-
|
|
36
|
+
const prompt = buildCodexPromptText(input);
|
|
37
|
+
return [...buildCodexExecPrefixArgs(input), 'resume', input.sessionId, prompt];
|
|
35
38
|
}
|
|
36
39
|
function compactLogValue(value) {
|
|
37
40
|
return value.replace(/\s+/g, ' ').trim();
|
|
@@ -204,7 +207,10 @@ export function createCodexRunner(options) {
|
|
|
204
207
|
return createAgentExecution(input, (liveInput) => runner.run(liveInput));
|
|
205
208
|
},
|
|
206
209
|
async run(input) {
|
|
207
|
-
const
|
|
210
|
+
const priorSessionId = input.projection.wake.sessionId;
|
|
211
|
+
const priorSessionCli = input.projection.wake.sessionCli;
|
|
212
|
+
const isResume = priorSessionId !== undefined && priorSessionCli === CODEX_CLI_NAME;
|
|
213
|
+
const runMode = isResume ? 'resume' : 'start';
|
|
208
214
|
const toolCapabilityNote = buildCodexToolCapabilityNote({
|
|
209
215
|
...(input.workspaceMode === undefined ? {} : { workspaceMode: input.workspaceMode }),
|
|
210
216
|
mode: runMode,
|
|
@@ -259,18 +265,30 @@ export function createCodexRunner(options) {
|
|
|
259
265
|
recentEventIds: input.recentEvents.map((event) => event.eventId),
|
|
260
266
|
model,
|
|
261
267
|
...(input.workspacePath === undefined ? {} : { workspacePath: input.workspacePath }),
|
|
268
|
+
...(isResume ? { sessionId: priorSessionId } : {}),
|
|
262
269
|
}));
|
|
263
270
|
const result = await runAgentCliCommand({
|
|
264
271
|
command: options.command,
|
|
265
|
-
args:
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
272
|
+
args: isResume
|
|
273
|
+
? buildCodexResumeArgs({
|
|
274
|
+
model,
|
|
275
|
+
prompt: promptText,
|
|
276
|
+
cwd,
|
|
277
|
+
sandboxMode,
|
|
278
|
+
sessionId: priorSessionId,
|
|
279
|
+
...(options.settings.reasoningEffort === undefined
|
|
280
|
+
? {}
|
|
281
|
+
: { reasoningEffort: options.settings.reasoningEffort }),
|
|
282
|
+
})
|
|
283
|
+
: buildCodexExecArgs({
|
|
284
|
+
model,
|
|
285
|
+
prompt: promptText,
|
|
286
|
+
cwd,
|
|
287
|
+
sandboxMode,
|
|
288
|
+
...(options.settings.reasoningEffort === undefined
|
|
289
|
+
? {}
|
|
290
|
+
: { reasoningEffort: options.settings.reasoningEffort }),
|
|
291
|
+
}),
|
|
274
292
|
cwd,
|
|
275
293
|
timeoutMs: options.settings.timeoutMs,
|
|
276
294
|
...(input.cancellationSignal === undefined
|
|
@@ -239,6 +239,7 @@ export function formatWakeComment(payload, controlPlaneUrl) {
|
|
|
239
239
|
const cost = typeof payload.cost === 'string' ? payload.cost : undefined;
|
|
240
240
|
const workspacePath = typeof payload.workspacePath === 'string' ? payload.workspacePath : undefined;
|
|
241
241
|
const idempotencyMarker = wakeIdempotencyMarker(payload.idempotencyKey);
|
|
242
|
+
const outcomeLine = formatOutcomeLine(payload);
|
|
242
243
|
const details = [
|
|
243
244
|
action === undefined ? undefined : `stage \`${action}\``,
|
|
244
245
|
runnerName === undefined ? undefined : `runner \`${runnerName}\``,
|
|
@@ -254,7 +255,7 @@ export function formatWakeComment(payload, controlPlaneUrl) {
|
|
|
254
255
|
? defaultAgentIdentity
|
|
255
256
|
: `[${defaultAgentIdentity}](${controlPlaneUrl})`;
|
|
256
257
|
const header = `**${name}** _(Wake ${wakeVersion}${details.length > 0 ? ` · ${details.join(' · ')}` : ''})_`;
|
|
257
|
-
const sections = [wakeCommentMarker, idempotencyMarker, header, body].filter((section) => section !== undefined);
|
|
258
|
+
const sections = [wakeCommentMarker, idempotencyMarker, header, outcomeLine, body].filter((section) => section !== undefined);
|
|
258
259
|
if (kind === 'approval-request') {
|
|
259
260
|
sections.push('_To approve this work, reply with `/approved`. To request changes, reply with `/changes` followed by your feedback. To ask a question without requesting changes, reply with `/ask` followed by your question._');
|
|
260
261
|
}
|
|
@@ -286,6 +287,26 @@ export function formatWakeComment(payload, controlPlaneUrl) {
|
|
|
286
287
|
}
|
|
287
288
|
return sections.join('\n\n');
|
|
288
289
|
}
|
|
290
|
+
function formatOutcomeLine(payload) {
|
|
291
|
+
const sentinel = typeof payload.sentinel === 'string' ? payload.sentinel : undefined;
|
|
292
|
+
const kind = typeof payload.kind === 'string' ? payload.kind : undefined;
|
|
293
|
+
if (kind === 'approval-request') {
|
|
294
|
+
return '**Outcome:** 🟡 Awaiting Approval';
|
|
295
|
+
}
|
|
296
|
+
if (sentinel === 'DONE') {
|
|
297
|
+
return '**Outcome:** ✅ Done';
|
|
298
|
+
}
|
|
299
|
+
if (sentinel === 'REJECTED') {
|
|
300
|
+
return '**Outcome:** 🔴 Changes Requested';
|
|
301
|
+
}
|
|
302
|
+
if (sentinel === 'BLOCKED' || kind === 'question') {
|
|
303
|
+
return '**Outcome:** 🟠 Blocked';
|
|
304
|
+
}
|
|
305
|
+
if (sentinel === 'FAILED' || kind === 'failure') {
|
|
306
|
+
return '**Outcome:** ❌ Failed';
|
|
307
|
+
}
|
|
308
|
+
return undefined;
|
|
309
|
+
}
|
|
289
310
|
function createIssueCommentPublishedEvent(input) {
|
|
290
311
|
return createEventEnvelope({
|
|
291
312
|
eventId: `${input.event.eventId}-published`,
|
|
@@ -93,14 +93,14 @@ export function createRunnerCliAdapter(input) {
|
|
|
93
93
|
};
|
|
94
94
|
},
|
|
95
95
|
buildResumeCommand({ sessionId }) {
|
|
96
|
-
return ['codex', 'resume', sessionId];
|
|
96
|
+
return ['codex', 'exec', 'resume', sessionId];
|
|
97
97
|
},
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
100
|
export function buildResumeCommandForCli(input) {
|
|
101
101
|
const normalizedCli = input.cli.trim().toLowerCase();
|
|
102
102
|
if (normalizedCli === 'codex') {
|
|
103
|
-
return ['codex', 'resume', input.sessionId];
|
|
103
|
+
return ['codex', 'exec', 'resume', input.sessionId];
|
|
104
104
|
}
|
|
105
105
|
if (normalizedCli === 'claude') {
|
|
106
106
|
return ['claude', '--resume', input.sessionId];
|
package/dist/src/version.js
CHANGED