fix(cron): propagate cleanupCliLiveSessionOnRunEnd to isolated cron CLI branch (#97227)

* fix(cron): propagate cleanupCliLiveSessionOnRunEnd to isolated cron CLI branch

* test(cron): add CLI interim retry coverage for isolated cron cleanup flag

Verify cleanupCliLiveSessionOnRunEnd is passed on both the initial and
retry CLI runs during isolated cron interim-ack retry loops. Proves the
inner boundary is safe: each runCliAgent call creates a fresh context,
so cleanup cannot affect the retry's live session.

* fix(cron): remove unused variable in interim retry test

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(cron): trim redundant cleanup retry coverage

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@golden-gate.local>
This commit is contained in:
Peter Lee
2026-06-28 03:55:56 -05:00
committed by GitHub
parent 9c95abd49d
commit 6c7a6ff1c4
2 changed files with 3 additions and 0 deletions
+1
View File
@@ -322,6 +322,7 @@ export function createCronPromptExecutor(params: {
agentId: params.agentId,
trigger: "cron",
jobId: params.job.id,
cleanupCliLiveSessionOnRunEnd: params.job.sessionTarget === "isolated",
sessionFile,
workspaceDir: params.workspaceDir,
config: params.cfgWithAgentDefaults,
@@ -198,6 +198,7 @@ describe("runCronIsolatedAgentTurn isolated session identity", () => {
promptCacheKey?: string;
bootstrapContextMode?: string;
bootstrapContextRunKind?: string;
cleanupCliLiveSessionOnRunEnd?: boolean;
};
expect(runRequest.sessionId).toBe("isolated-cli-run-1");
expect(runRequest.sessionKey).toBe("agent:default:cron:cli-monitor:run:isolated-cli-run-1");
@@ -205,6 +206,7 @@ describe("runCronIsolatedAgentTurn isolated session identity", () => {
expect(runRequest.promptCacheKey).toBeUndefined();
expect(runRequest.bootstrapContextMode).toBe("lightweight");
expect(runRequest.bootstrapContextRunKind).toBe("cron");
expect(runRequest.cleanupCliLiveSessionOnRunEnd).toBe(true);
});
it("runs externally sourced CLI hook turns", async () => {