Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/lib/mc-client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,18 @@ describe("queue, issues, pr-fix, groomer clients", () => {
expect(url).toContain("include_blocked=true");
});

it("markPrFix forwards the settled generation", async () => {
const { markPrFix } = await import("./mc-client");
const fetchMock = vi.spyOn(globalThis, "fetch").mockResolvedValueOnce(jsonResponse({ status: "BLOCKED" }));
await markPrFix({ repo: "org/repo", pr: 7, status: "blocked", generation: 3 });
expect(fetchMock).toHaveBeenCalledWith(
expect.stringContaining("/api/pr-fix-queue/mark"),
expect.objectContaining({
body: JSON.stringify({ repo: "org/repo", pr: 7, status: "blocked", generation: 3 }),
}),
);
});

it("markPrFix POSTs the mark body", async () => {
const { markPrFix } = await import("./mc-client");
const fetchMock = vi.spyOn(globalThis, "fetch").mockResolvedValueOnce(jsonResponse({ status: "FIXED" }));
Expand Down
1 change: 1 addition & 0 deletions src/lib/mc-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ export async function markPrFix(input: {
pr: number;
status: string;
note?: string;
generation?: number;
}): Promise<unknown> {
return mcJson<unknown>("/api/pr-fix-queue/mark", {
method: "POST",
Expand Down
7 changes: 7 additions & 0 deletions src/mcp/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ export async function markPrFixHandler(args: ExtraArgs): Promise<ToolResult> {
pr: args.pr as number,
status: args.status as string,
note: args.note as string | undefined,
generation: args.generation as number | undefined,
}),
);
}
Expand Down Expand Up @@ -376,6 +377,12 @@ export function createServer(): McpServerType {
pr: z.number().int().positive().describe("Pull request number"),
status: z.string().describe("Outcome: fixed, blocked, stale, or ignored"),
note: z.string().optional().describe("Optional note explaining the outcome"),
generation: z
.number()
.int()
.positive()
.optional()
.describe("Queue item generation being settled; agent marks are rejected without it once attempt-token settlement ships (#1074)"),
},
},
markPrFixHandler,
Expand Down
Loading