test(coding-agent): updated test input to match model typing and replacements

- Narrowed the xai-oauth bundled model cast to `Model<"openai-responses">` in its regression test.
- Changed hashline stale-recovery fixtures to use `repl(...)` for both line-replacement payloads instead of `extra(pl(...))`.
This commit is contained in:
can1357
2026-05-27 19:01:11 +02:00
parent 9362cbf13d
commit 0ab8e87f7d
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ import type { Model } from "../src/types";
//
// Failure here means: run `bun run generate-models` and commit the diff.
describe("xai-oauth bundled catalog (regression)", () => {
const bundled = (MODELS_JSON as Record<string, Record<string, Model>>)["xai-oauth"] ?? {};
const bundled = (MODELS_JSON as Record<string, Record<string, Model<"openai-responses">>>)["xai-oauth"] ?? {};
const seed = buildXaiOAuthStaticSeed();
it("bundles every curated id", () => {
@@ -1107,7 +1107,7 @@ describe("hashline — anchor-stale recovery via read snapshot cache", () => {
});
// First edit lands cleanly against v0: line 5 becomes L5-FIRST.
const firstInput = `${header("a.ts", v0Text)}\n${sameLineRange(tag(5, "L5"))}:\n${extra(pl("L5-FIRST"))}\n`;
const firstInput = `${header("a.ts", v0Text)}\n${sameLineRange(tag(5, "L5"))}:\n${repl("L5-FIRST")}\n`;
await executeHashlineSingle(hashlineExecuteOptions(tempDir, firstInput, undefined, session));
const v1Lines = [...v0Lines];
@@ -1118,7 +1118,7 @@ describe("hashline — anchor-stale recovery via read snapshot cache", () => {
// again targets line 5 — the very line the first edit rewrote.
// Recovery must refuse so the model re-reads instead of silently
// overwriting L5-FIRST with payload authored against L5.
const secondInput = `${header("a.ts", v0Text)}\n${sameLineRange(tag(5, "L5"))}:\n${extra(pl("L5-SECOND"))}\n`;
const secondInput = `${header("a.ts", v0Text)}\n${sameLineRange(tag(5, "L5"))}:\n${repl("L5-SECOND")}\n`;
await expect(
executeHashlineSingle(hashlineExecuteOptions(tempDir, secondInput, undefined, session)),
).rejects.toThrow(HashlineMismatchError);