feat(core,server,docs): default max_turns to -1 (unlimited) to avoid unexpected run cutoffs (#232)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4a899a265f
commit
6e1c7cc28e
12 files changed
+80
-22
No files matched your search
@@ -297,6 +297,20 @@ describe("runGoalLoop", () => {
|
||||
expect(await readGoalStatus(file)).toBe("active");
|
||||
});
|
||||
|
||||
it("an explicit maxRounds of -1 disables the backstop: the goal runs past 100 rounds", async () => {
|
||||
// The default backstop stays 100; -1 is the explicit opt-out. Round 103 claims
|
||||
// complete, which the default cap would have ended as `aborted` at round 100.
|
||||
const behaviors = Array.from({ length: 103 }, (_, i) =>
|
||||
i === 102 ? { then: () => setStatus("complete") } : {},
|
||||
);
|
||||
const session = fakeSession(behaviors);
|
||||
const { outcome } = await drain(
|
||||
runGoalLoop(session, { text: "o", goalFilePath: file, maxRounds: -1 }),
|
||||
);
|
||||
expect(outcome).toEqual({ outcome: "complete", rounds: 103, tokensUsed: 0 });
|
||||
expect(session.prompts).toHaveLength(103);
|
||||
});
|
||||
|
||||
it("an abort landing between rounds stops the loop without a phantom round", async () => {
|
||||
const ac = new AbortController();
|
||||
// The signal aborts AFTER round 1's stream ends — no abort event ever hits the stream,
|
||||
|
||||
Reference in new issue
Block a user