fix: 收敛 one-shot runner 成功终态

This commit is contained in:
Codex
2026-06-01 23:47:49 +08:00
parent 5104d402c7
commit 8577e2fbdf
5 changed files with 10 additions and 3 deletions
+2 -1
View File
@@ -105,7 +105,7 @@ export async function runOnce(options: RunnerOnceOptions): Promise<JsonRecord> {
: await executeCommand(api, options, command, runner, attemptId, workspacePath);
commandResults.push(result);
if (options.oneShot === true) {
const run = await api.getRun(options.runId);
const run = await api.reportStatus(options.runId, { terminalStatus: result.terminalStatus, failureKind: result.failureKind, failureMessage: null });
return { runner, commandId: command.id, terminalStatus: result.terminalStatus, failureKind: result.failureKind, run, commandsProcessed: commandResults.length, commandResults, stopped: "one-shot" } as JsonRecord;
}
}
@@ -204,6 +204,7 @@ async function reportCommandFailure(api: RunnerManagerApi, runId: string, comman
async function reportCancelled(api: RunnerManagerApi, runId: string, commandId: string, runner: RunnerRecord, attemptId: string, message: string): Promise<CommandExecutionResult> {
await api.reportCommandStatus(commandId, { terminalStatus: "cancelled", failureKind: "cancelled", failureMessage: message });
await api.reportStatus(runId, { terminalStatus: "cancelled", failureKind: "cancelled", failureMessage: message });
await api.appendEvent(runId, { type: "backend_status", payload: { phase: "turn-cancelled", commandId, attemptId, runnerId: runner.id, failureKind: "cancelled", message } });
await api.appendEvent(runId, { type: "terminal_status", payload: { terminalStatus: "cancelled", failureKind: "cancelled", message, commandId, attemptId, runnerId: runner.id } });
return { commandId, terminalStatus: "cancelled", failureKind: "cancelled" };