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