feat(coding-agent): removed resume support and switched task execution to spawn-only
- Removed `resume` from task params and schema, requiring agent and assignment inputs. - Dropped resume continuation paths in task execution and call rendering, always spawning a new agent. - Removed the `irc.enabled` setting and computed IRC availability by task-depth rules. - Updated task follow-up guidance to use IRC messaging/history links instead of `task(resume:)`.
This commit is contained in:
@@ -5,7 +5,7 @@ import * as discoveryModule from "@oh-my-pi/pi-coding-agent/task/discovery";
|
||||
import type { ToolSession } from "@oh-my-pi/pi-coding-agent/tools";
|
||||
|
||||
// Contract (rework-contracts.md §3): the task tool spawns ONE agent per call.
|
||||
// `tasks[]` and `context` are gone; `resume` continues an existing agent.
|
||||
// `tasks[]` and `context` are gone; follow-ups go through `irc` messaging.
|
||||
|
||||
describe("task schema (single-spawn)", () => {
|
||||
it("accepts {agent, assignment}", () => {
|
||||
@@ -13,9 +13,9 @@ describe("task schema (single-spawn)", () => {
|
||||
expect(parsed.success).toBe(true);
|
||||
});
|
||||
|
||||
it("accepts {resume, assignment}", () => {
|
||||
const parsed = taskSchema.safeParse({ resume: "AuthLoader", assignment: "Also check refresh tokens." });
|
||||
expect(parsed.success).toBe(true);
|
||||
it("requires agent", () => {
|
||||
const parsed = taskSchema.safeParse({ assignment: "Map the auth module." });
|
||||
expect(parsed.success).toBe(false);
|
||||
});
|
||||
|
||||
it("requires assignment", () => {
|
||||
@@ -39,7 +39,7 @@ describe("task schema (single-spawn)", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("task spawn/resume validation", () => {
|
||||
describe("task spawn validation", () => {
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
@@ -61,21 +61,11 @@ describe("task spawn/resume validation", () => {
|
||||
return result.content.find(part => part.type === "text")?.text ?? "";
|
||||
}
|
||||
|
||||
it("rejects resume + agent together", async () => {
|
||||
const text = await executeText({ agent: "explore", resume: "AuthLoader", assignment: "..." });
|
||||
expect(text).toContain("not both");
|
||||
});
|
||||
|
||||
it("rejects neither resume nor agent", async () => {
|
||||
it("rejects a missing agent", async () => {
|
||||
const text = await executeText({ assignment: "..." });
|
||||
expect(text).toContain("Missing `agent`");
|
||||
});
|
||||
|
||||
it("rejects resume + isolated", async () => {
|
||||
const text = await executeText({ resume: "AuthLoader", isolated: true, assignment: "..." });
|
||||
expect(text).toContain("not resumable");
|
||||
});
|
||||
|
||||
it("rejects a missing assignment", async () => {
|
||||
const text = await executeText({ agent: "explore" });
|
||||
expect(text).toContain("Missing `assignment`");
|
||||
|
||||
Reference in New Issue
Block a user