test: fix local-midnight logger flake and stale kimi k3 thinking format pin
- logger-multiprocess asserted the UTC day (toISOString) while DailyRotateFile names files with the LOCAL date, failing nightly between 00:00 and 02:00 local (UTC+2); the per-pid rotation-file invariant now matches any dated name. - kimi-code k3 bundled compat moved to thinkingFormat 'kimi' with the catalog regen; the K3 named-tool-choice downgrade gate keys on provider/id/baseUrl, so only the stale precondition needed updating.
This commit is contained in:
@@ -161,7 +161,7 @@ describe("Kimi K3 thinking transport", () => {
|
||||
it("downgrades named tool choice to required for K3 thinking", async () => {
|
||||
vi.spyOn(kimiOauth, "getKimiCommonHeaders").mockReturnValue(KIMI_HEADERS);
|
||||
const bundledModel = getBundledModel<"openai-completions">("kimi-code", "k3");
|
||||
expect(bundledModel.compat.thinkingFormat).toBe("zai");
|
||||
expect(bundledModel.compat.thinkingFormat).toBe("kimi");
|
||||
let payload: unknown;
|
||||
const capturePayload = async (
|
||||
model: Model<"openai-completions">,
|
||||
|
||||
@@ -70,7 +70,7 @@ describe("jtdToJsonSchema", () => {
|
||||
});
|
||||
});
|
||||
it("does not misinterpret user-named properties that collide with JTD keywords (#1345)", () => {
|
||||
// Mirrors the `files[]` shape declared by the built-in explore agent:
|
||||
// Mirrors the `files[]` shape declared by the built-in scout agent:
|
||||
// a JTD elements form whose item properties include one literally named `ref`.
|
||||
const converted = jtdToJsonSchema({
|
||||
properties: {
|
||||
|
||||
@@ -1106,8 +1106,8 @@ describe("YieldTool", () => {
|
||||
).rejects.toThrow("Output does not match schema");
|
||||
});
|
||||
|
||||
it("rejects nested-array shape mismatches with a retry hint (explore-style JTD)", async () => {
|
||||
// Regression for the GLM/explore failure mode: model invents per-file fields
|
||||
it("rejects nested-array shape mismatches with a retry hint (scout-style JTD)", async () => {
|
||||
// Regression for the GLM/scout failure mode: model invents per-file fields
|
||||
// (`ref`, `surface`, …) instead of the schema's `path` + `description`. The
|
||||
// in-tool validator MUST surface the mismatch with a retry directive so the
|
||||
// subagent can fix its output before the parent runs its post-mortem check.
|
||||
@@ -1138,13 +1138,13 @@ describe("YieldTool", () => {
|
||||
],
|
||||
};
|
||||
|
||||
await expect(tool.execute("call-explore-1", { result: { data: badPayload } } as never)).rejects.toThrow(
|
||||
await expect(tool.execute("call-scout-1", { result: { data: badPayload } } as never)).rejects.toThrow(
|
||||
/files\/0\/path: is required.*Call yield again with the corrected shape/,
|
||||
);
|
||||
|
||||
// Third retry still throws with one attempt remaining advertised in the hint.
|
||||
await tool.execute("call-explore-2", { result: { data: badPayload } } as never).catch(() => {});
|
||||
await expect(tool.execute("call-explore-3", { result: { data: badPayload } } as never)).rejects.toThrow(
|
||||
await tool.execute("call-scout-2", { result: { data: badPayload } } as never).catch(() => {});
|
||||
await expect(tool.execute("call-scout-3", { result: { data: badPayload } } as never)).rejects.toThrow(
|
||||
"this is the final retry before the schema constraint is dropped",
|
||||
);
|
||||
});
|
||||
|
||||
@@ -50,9 +50,12 @@ describe("multiprocess file logging", () => {
|
||||
|
||||
expect(await Promise.all(processes.map(proc => proc.exited))).toEqual([0, 0]);
|
||||
const entries = await fs.readdir(logsDir);
|
||||
const datedPrefix = `omp.${new Date().toISOString().slice(0, 10)}`;
|
||||
// DailyRotateFile's %DATE% uses the LOCAL date; don't pin an exact day
|
||||
// (toISOString is UTC and diverges around local midnight) — the invariant
|
||||
// is one dated rotation file per pid.
|
||||
for (const proc of processes) {
|
||||
expect(entries).toContain(`${datedPrefix}.${proc.pid}.log`);
|
||||
const perPid = new RegExp(`^omp\\.\\d{4}-\\d{2}-\\d{2}\\.${proc.pid}\\.log$`);
|
||||
expect(entries.some(name => perPid.test(name))).toBe(true);
|
||||
}
|
||||
expect(entries.filter(name => name.endsWith("-audit.json"))).toHaveLength(2);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user