feat: reuse executor sessions within Codex tasks
This commit is contained in:
@@ -162,6 +162,31 @@ touch '${sessionFile}.meta'
|
||||
expect(result.sessionHandle?.kind).toBe("reasonix");
|
||||
});
|
||||
|
||||
it("resume sends a complete continued plan for task-level reuse", async () => {
|
||||
const argsFile = path.join(tmpDir, "args.txt");
|
||||
const fakeBin = writeFakeCli(tmpDir, { argsFile });
|
||||
const sessionFile = path.join(tmpDir, "session.jsonl");
|
||||
fs.writeFileSync(sessionFile, "{}\n");
|
||||
|
||||
const adapter = createExecutorAdapter("reasonix");
|
||||
await adapter.resume({
|
||||
repoRoot: tmpDir,
|
||||
plan: makeValidPlan(),
|
||||
acceptedFindings: "",
|
||||
purpose: "task_plan",
|
||||
handle: { kind: "reasonix", sessionFilePath: sessionFile },
|
||||
runDir: tmpDir,
|
||||
cycleIndex: 1,
|
||||
config: { binary: fakeBin },
|
||||
});
|
||||
|
||||
const capturedArgs = fs.readFileSync(argsFile, "utf8");
|
||||
expect(capturedArgs).toContain("# Continued Task Plan: Test plan");
|
||||
expect(capturedArgs).toContain("Do something.");
|
||||
expect(capturedArgs).toContain("Tests pass");
|
||||
expect(capturedArgs).not.toContain("# Fix Request");
|
||||
});
|
||||
|
||||
it("reports failure when binary exits with non-zero", async () => {
|
||||
const fakeBin = writeFakeCli(tmpDir, { exitCode: 1 });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user