fix(ci): harden windows tests
This commit is contained in:
@@ -17,7 +17,7 @@ const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
|
||||
|
||||
async function waitForCompletion(sessionId: string) {
|
||||
let status = "running";
|
||||
const deadline = Date.now() + 2000;
|
||||
const deadline = Date.now() + (process.platform === "win32" ? 8000 : 2000);
|
||||
while (Date.now() < deadline && status === "running") {
|
||||
const poll = await processTool.execute("call-wait", {
|
||||
action: "poll",
|
||||
@@ -47,7 +47,7 @@ describe("bash tool backgrounding", () => {
|
||||
|
||||
let status = "running";
|
||||
let output = "";
|
||||
const deadline = Date.now() + 2000;
|
||||
const deadline = Date.now() + (process.platform === "win32" ? 8000 : 2000);
|
||||
|
||||
while (Date.now() < deadline && status === "running") {
|
||||
const poll = await processTool.execute("call2", {
|
||||
|
||||
@@ -901,13 +901,6 @@ export async function compactEmbeddedPiSession(params: {
|
||||
sandboxEnabled: !!sandbox?.enabled,
|
||||
});
|
||||
|
||||
const extraParams = resolveExtraParams({
|
||||
cfg: params.config,
|
||||
provider,
|
||||
modelId,
|
||||
thinkLevel: params.thinkLevel,
|
||||
});
|
||||
|
||||
let session: Awaited<ReturnType<typeof createAgentSession>>["session"];
|
||||
({ session } = await createAgentSession({
|
||||
cwd: resolvedWorkspace,
|
||||
@@ -924,7 +917,6 @@ export async function compactEmbeddedPiSession(params: {
|
||||
skills: [],
|
||||
contextFiles: [],
|
||||
additionalExtensionPaths,
|
||||
extraParams,
|
||||
}));
|
||||
|
||||
try {
|
||||
@@ -1220,13 +1212,6 @@ export async function runEmbeddedPiAgent(params: {
|
||||
sandboxEnabled: !!sandbox?.enabled,
|
||||
});
|
||||
|
||||
const extraParams = resolveExtraParams({
|
||||
cfg: params.config,
|
||||
provider,
|
||||
modelId,
|
||||
thinkLevel,
|
||||
});
|
||||
|
||||
let session: Awaited<
|
||||
ReturnType<typeof createAgentSession>
|
||||
>["session"];
|
||||
@@ -1247,7 +1232,6 @@ export async function runEmbeddedPiAgent(params: {
|
||||
skills: [],
|
||||
contextFiles: [],
|
||||
additionalExtensionPaths,
|
||||
extraParams,
|
||||
}));
|
||||
|
||||
try {
|
||||
|
||||
@@ -3,6 +3,12 @@ import type { ClawdbotConfig } from "../config/config.js";
|
||||
import { createClawdbotCodingTools } from "./pi-tools.js";
|
||||
import type { SandboxDockerConfig } from "./sandbox.js";
|
||||
|
||||
const nodePath = process.execPath.includes(" ")
|
||||
? `"${process.execPath}"`
|
||||
: process.execPath;
|
||||
const nodeEval = (script: string) =>
|
||||
`${nodePath} -e "${script.replaceAll('"', '\\"')}"`;
|
||||
|
||||
describe("Agent-specific tool filtering", () => {
|
||||
it("should apply global tool policy when no agent-specific policy exists", () => {
|
||||
const cfg: ClawdbotConfig = {
|
||||
@@ -233,7 +239,7 @@ describe("Agent-specific tool filtering", () => {
|
||||
expect(bash).toBeDefined();
|
||||
|
||||
const result = await bash?.execute("call1", {
|
||||
command: "node -e \"setTimeout(() => { console.log('done') }, 50)\"",
|
||||
command: nodeEval("setTimeout(function(){ console.log('done') }, 50)"),
|
||||
yieldMs: 10,
|
||||
});
|
||||
|
||||
|
||||
@@ -532,7 +532,7 @@ describe("doctor", () => {
|
||||
([message, title]) =>
|
||||
title === "Legacy workspace" &&
|
||||
typeof message === "string" &&
|
||||
message.includes(path.join("/Users/steipete", "clawdis")),
|
||||
message.includes(path.resolve("/Users/steipete/clawdis")),
|
||||
),
|
||||
).toBe(true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user