feat(core,cli,server,web): add goal mode — loop Tasks on one Session until an objective completes (#66)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
rank-Yu
2026-07-27 23:43:24 +08:00
committed by GitHub
parent e1141ca010
commit 46463bee26
61 changed files with 3411 additions and 188 deletions
@@ -582,4 +582,26 @@ describe("session-index", () => {
});
expect(bad.status).toBe(400);
});
it("rejects a malformed goal.budget with 400", async () => {
await configureModels();
const res = await api.post(base(), {});
const { session } = (await res.json()) as SessionCreateResponse;
for (const budget of ["500k", 0, -2, 1.5]) {
const bad = await api.post(`/api/sessions/${session.sessionId}/tasks`, {
input: [{ type: "text", text: "objective" }],
goal: { budget },
});
expect(bad.status).toBe(400);
}
// Image parts have no place in the re-injected objective.
const image = await api.post(`/api/sessions/${session.sessionId}/tasks`, {
input: [
{ type: "text", text: "objective" },
{ type: "image_url", imageUrl: "data:image/png;base64,aGk=" },
],
goal: {},
});
expect(image.status).toBe(400);
});
});