test(coding-agent): pass autoApprove context to direct bash call in sdk-move-cwd

sdk-move-cwd.test.ts also calls bashTool.execute directly without context,
hitting the same approval gate as the eval cleanup tests. Same fix.
This commit is contained in:
oldschoola
2026-05-26 20:53:34 +02:00
committed by can1357
parent fc31e71e21
commit fd8593b190
@@ -2,6 +2,7 @@ import { afterEach, describe, expect, it } from "bun:test";
import * as fs from "node:fs";
import * as os from "node:os";
import * as path from "node:path";
import type { AgentToolContext } from "@oh-my-pi/pi-agent-core";
import { getBundledModel } from "@oh-my-pi/pi-ai";
import { Settings } from "@oh-my-pi/pi-coding-agent/config/settings";
import { createAgentSession } from "@oh-my-pi/pi-coding-agent/sdk";
@@ -62,7 +63,9 @@ describe("createAgentSession cwd after /move", () => {
const bashTool = session.getToolByName("bash");
if (!bashTool) throw new Error("Expected bash tool");
const result = await bashTool.execute("pwd-after-move", { command: "pwd" });
const result = await bashTool.execute("pwd-after-move", { command: "pwd" }, undefined, undefined, {
autoApprove: true,
} as AgentToolContext);
expect(textContent(result)).toContain(cwdB);
} finally {