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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user