fix(x): clear remaining tsc drift in runtime test fixtures

Same class as the two review findings — type errors only tsc sees
(tests run untyped under vitest; the build tsconfig excludes them):

- headless.test.ts read .agent.overrides without narrowing the
  RequestedAgent union; the assertions now compare the whole agent
  object, which is also stricter
- real-agent-resolver.test.ts's byte-identity fixture predates the
  videoMode/coachMode flags (explicit false = the schema defaults,
  so the composed bytes are unchanged)
- real-tool-registry.test.ts's permission asks predate isRead being
  required (options: [] was from the older ask shape)

npx tsc --noEmit -p tsconfig.json is now clean for the whole package.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Ramnique Singh 2026-07-10 16:21:21 +05:30
parent 05eb94cd3a
commit 02912ba9ef
3 changed files with 8 additions and 5 deletions

View file

@ -252,7 +252,7 @@ describe("HeadlessAgentRunner", () => {
const { runner, resolve } = createRunner(runtime);
await runner.start({ agentId: "worker", message: "go" });
expect(resolve).not.toHaveBeenCalled();
expect(runtime.createInputs[0].agent.overrides).toBeUndefined();
expect(runtime.createInputs[0].agent).toEqual({ agentId: "worker" });
});
it("uses an injected default only for a partial model override", async () => {
@ -264,8 +264,9 @@ describe("HeadlessAgentRunner", () => {
model: "custom-model",
});
expect(resolve).toHaveBeenCalledOnce();
expect(runtime.createInputs[0].agent.overrides).toEqual({
model: { provider: "default-provider", model: "custom-model" },
expect(runtime.createInputs[0].agent).toEqual({
agentId: "worker",
overrides: { model: { provider: "default-provider", model: "custom-model" } },
});
});

View file

@ -163,6 +163,8 @@ describe("RealAgentResolver", () => {
searchEnabled: true,
codeMode: "claude",
codeCwd: null,
videoMode: false,
coachMode: false,
}),
);
});

View file

@ -153,11 +153,11 @@ describe("RealToolRegistry", () => {
const chunk = { type: "message", role: "agent", text: "hi" } as const;
const resolution = {
type: "permission",
ask: { toolCallId: "x", title: "write file", options: [] },
ask: { toolCallId: "x", title: "write file", isRead: false },
decision: "allow_once",
auto: false,
} as const;
const ask = { toolCallId: "x", title: "write file", options: [] };
const ask = { toolCallId: "x", title: "write file", isRead: false };
const { registry } = makeRegistry(async ({ ctx }) => {
// Chatty stream events are ephemeral (CodeRunFeed) — NOT progress.
await ctx.publish({