fix: harden executor session handling
This commit is contained in:
+10
-3
@@ -326,6 +326,7 @@ export async function startWorkflow(opts: StartWorkflowOpts): Promise<{ runId: s
|
||||
runDir: dir,
|
||||
cycleIndex,
|
||||
config: config.executorConfig,
|
||||
timeoutSeconds: state.timeoutSeconds,
|
||||
signal: ac.signal,
|
||||
});
|
||||
} catch (err) {
|
||||
@@ -338,8 +339,8 @@ export async function startWorkflow(opts: StartWorkflowOpts): Promise<{ runId: s
|
||||
persistExecutorAttempt(dir, cycleRecord, execResult);
|
||||
if (execResult.sessionHandle) {
|
||||
state.sessionHandle = execResult.sessionHandle;
|
||||
if (execResult.sessionHandle.kind === "agy" && execResult.sessionHandle.degraded) {
|
||||
state.agyDegraded = true;
|
||||
if (execResult.sessionHandle.kind === "agy") {
|
||||
state.agyDegraded = execResult.sessionHandle.degraded;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -725,6 +726,7 @@ async function resumeExecutorCycle(
|
||||
runDir: dir,
|
||||
cycleIndex,
|
||||
config: state.executorConfig ?? {},
|
||||
timeoutSeconds: state.timeoutSeconds,
|
||||
signal: ac.signal,
|
||||
});
|
||||
} catch (err) {
|
||||
@@ -741,7 +743,12 @@ async function resumeExecutorCycle(
|
||||
cleanup();
|
||||
|
||||
persistExecutorAttempt(dir, cycleRecord, execResult);
|
||||
if (execResult.sessionHandle) state.sessionHandle = execResult.sessionHandle;
|
||||
if (execResult.sessionHandle) {
|
||||
state.sessionHandle = execResult.sessionHandle;
|
||||
if (execResult.sessionHandle.kind === "agy") {
|
||||
state.agyDegraded = execResult.sessionHandle.degraded;
|
||||
}
|
||||
}
|
||||
|
||||
appendEvent(dir, {
|
||||
kind: "executor_completed",
|
||||
|
||||
Reference in New Issue
Block a user