mirror of
https://github.com/morluto/rea.git
synced 2026-11-22 06:25:44 +00:00
* test(mcp): observe cleanup failures at their current delivery boundary
* fix(mcp): preserve workflow completion progress through delivery
* test(setup): keep the Windows Kimi profile fixture on a supported profile
The Windows-only case at `clientConfigurationEnvironment.test.ts:226` wrote
`rea_mcp_input_schema_profile: "full"`. That profile was retired: the reader
now refuses it ("REA_MCP_INPUT_SCHEMA_PROFILE accepts only \"compact\" …"),
so `configureClientConfiguration` returned `failed/readback` before writing
and the case failed on every Windows run, including main's own
`Windows capability and package lane`.
The case has no Windows dependency — it passes an explicit `configPath` and
the Kimi write dialect is the same everywhere — so it now runs on every
platform, which is what let the stale value rot unnoticed. The fixture keeps
the lowercase explicit key the case is about, with the supported value.
Verified on `main` `d6bcfc10`: the same fixture driven through
`configureClientConfiguration(..., "win32")` on this host reproduced
`{"status":"failed","reason":"readback"}` with the retired value and now
returns `{"status":"configured"}` with `compact`. The file's 75 cases pass
here (66 run, 9 platform-conditioned skips) and `check:fast` passes.
* test(ci): restore verifier and MCP contract regressions
* test(captures): assert adapter-owned input issue field names
---------
Co-authored-by: g0at <50488370+g1at@users.noreply.github.com>
Co-authored-by: IvenKooLab <276572622@qq.com>
Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com>
79 lines
2.7 KiB
TypeScript
79 lines
2.7 KiB
TypeScript
import { expect, it, vi } from "vitest";
|
|
|
|
import { createOperationProgress } from "./operationProgress.js";
|
|
|
|
const cleanup = {
|
|
phase: "cleanup",
|
|
completed: 3,
|
|
total: null,
|
|
message: "disposition=timeout owned_process_group=cleaned",
|
|
terminal: true,
|
|
} as const;
|
|
|
|
it("preserves the complete workflow's terminal observation on successful delivery", async () => {
|
|
const report = vi.fn().mockResolvedValue(undefined);
|
|
const progress = createOperationProgress({ report }, "capture", "workflow");
|
|
await progress.start();
|
|
await progress.report(cleanup);
|
|
const response = { content: [] };
|
|
expect(await progress.complete(response)).toBe(response);
|
|
expect(report.mock.calls.at(-1)?.[0]).toEqual(cleanup);
|
|
expect(report).toHaveBeenCalledTimes(2);
|
|
});
|
|
|
|
it("retains cleanup facts when delivery fails after the workflow's terminal observation", async () => {
|
|
const report = vi.fn().mockResolvedValue(undefined);
|
|
const progress = createOperationProgress({ report }, "capture", "workflow");
|
|
await progress.report(cleanup);
|
|
await progress.complete({ content: [], isError: true });
|
|
expect(report.mock.calls.at(-1)?.[0]).toEqual({
|
|
...cleanup,
|
|
phase: "capture",
|
|
message: "failed; cleanup: disposition=timeout owned_process_group=cleaned",
|
|
});
|
|
});
|
|
|
|
it("does not treat a child terminal observation as the complete operation's terminal", async () => {
|
|
const report = vi.fn().mockResolvedValue(undefined);
|
|
const progress = createOperationProgress({ report }, "parent");
|
|
await progress.report(cleanup);
|
|
await progress.complete({ content: [] });
|
|
expect(report.mock.calls.at(-1)?.[0]).toMatchObject({
|
|
phase: "parent",
|
|
message: "completed",
|
|
terminal: true,
|
|
});
|
|
});
|
|
|
|
it("allows a workflow to continue after a child's terminal observation", async () => {
|
|
const report = vi.fn().mockResolvedValue(undefined);
|
|
const progress = createOperationProgress({ report }, "parent", "workflow");
|
|
await progress.report(cleanup);
|
|
await progress.report({
|
|
phase: "reconcile",
|
|
completed: 0,
|
|
total: null,
|
|
message: "examining",
|
|
});
|
|
await progress.complete({ content: [] });
|
|
expect(report.mock.calls.at(-1)?.[0]).toMatchObject({
|
|
phase: "parent",
|
|
message: "completed",
|
|
terminal: true,
|
|
});
|
|
});
|
|
|
|
it.each([false, true])(
|
|
"finishes a workflow with no producer terminal (isError=%s)",
|
|
async (isError) => {
|
|
const report = vi.fn().mockResolvedValue(undefined);
|
|
const progress = createOperationProgress({ report }, "plan", "workflow");
|
|
await progress.complete({ content: [], isError });
|
|
expect(report.mock.calls.at(-1)?.[0]).toMatchObject({
|
|
phase: "plan",
|
|
message: isError ? "failed" : "completed",
|
|
terminal: true,
|
|
});
|
|
},
|
|
);
|