Fix broken CI checks workflow (#204)

* fix: repair ci checks workflow

* fix: run release checks via pnpm exec

* fix: install tsx in ci
This commit is contained in:
Nathan Flurry 2026-03-05 17:49:06 -08:00 committed by GitHub
parent c3a95c3611
commit fba06d3304
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 49 additions and 26 deletions

View file

@ -14,15 +14,16 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@main
- uses: Swatinem/rust-cache@v2
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- run: pnpm install
- run: npm install -g tsx
- name: Run checks
run: ./scripts/release/main.ts --version 0.0.0 --check
run: ./scripts/release/main.ts --version 0.0.0 --only-steps run-ci-checks
- name: Run ACP v1 server tests
run: |
cargo test -p sandbox-agent-agent-management
@ -31,5 +32,3 @@ jobs:
cargo test -p sandbox-agent --lib
- name: Run SDK tests
run: pnpm --dir sdks/typescript test
- name: Run Inspector browser E2E
run: pnpm --filter @sandbox-agent/inspector test:agent-browser

View file

@ -1,18 +1,29 @@
import { chmodSync, mkdirSync, writeFileSync } from "node:fs";
import { join } from "node:path";
export function prepareMockAgentDataHome(dataHome: string): void {
const installDir = join(dataHome, "sandbox-agent", "bin");
const processDir = join(installDir, "agent_processes");
mkdirSync(processDir, { recursive: true });
function candidateInstallDirs(dataHome: string): string[] {
const dirs = [join(dataHome, "sandbox-agent", "bin")];
if (process.platform === "darwin") {
dirs.push(join(dataHome, "Library", "Application Support", "sandbox-agent", "bin"));
} else if (process.platform === "win32") {
dirs.push(join(dataHome, "AppData", "Roaming", "sandbox-agent", "bin"));
}
return dirs;
}
const runner = process.platform === "win32"
? join(processDir, "mock-acp.cmd")
: join(processDir, "mock-acp");
const scriptFile = process.platform === "win32"
? join(processDir, "mock-acp.js")
: runner;
export function prepareMockAgentDataHome(dataHome: string): Record<string, string> {
const runtimeEnv: Record<string, string> = {};
if (process.platform === "darwin") {
runtimeEnv.HOME = dataHome;
runtimeEnv.XDG_DATA_HOME = join(dataHome, ".local", "share");
} else if (process.platform === "win32") {
runtimeEnv.USERPROFILE = dataHome;
runtimeEnv.APPDATA = join(dataHome, "AppData", "Roaming");
runtimeEnv.LOCALAPPDATA = join(dataHome, "AppData", "Local");
} else {
runtimeEnv.HOME = dataHome;
runtimeEnv.XDG_DATA_HOME = dataHome;
}
const nodeScript = String.raw`#!/usr/bin/env node
const { createInterface } = require("node:readline");
@ -127,14 +138,29 @@ rl.on("line", (line) => {
});
`;
writeFileSync(scriptFile, nodeScript);
for (const installDir of candidateInstallDirs(dataHome)) {
const processDir = join(installDir, "agent_processes");
mkdirSync(processDir, { recursive: true });
if (process.platform === "win32") {
writeFileSync(runner, `@echo off\r\nnode "${scriptFile}" %*\r\n`);
const runner = process.platform === "win32"
? join(processDir, "mock-acp.cmd")
: join(processDir, "mock-acp");
const scriptFile = process.platform === "win32"
? join(processDir, "mock-acp.js")
: runner;
writeFileSync(scriptFile, nodeScript);
if (process.platform === "win32") {
writeFileSync(runner, `@echo off\r\nnode "${scriptFile}" %*\r\n`);
}
chmodSync(scriptFile, 0o755);
if (process.platform === "win32") {
chmodSync(runner, 0o755);
}
}
chmodSync(scriptFile, 0o755);
if (process.platform === "win32") {
chmodSync(runner, 0o755);
}
return runtimeEnv;
}

View file

@ -72,15 +72,13 @@ describe("Integration: TypeScript SDK flat session API", () => {
beforeAll(async () => {
dataHome = mkdtempSync(join(tmpdir(), "sdk-integration-"));
prepareMockAgentDataHome(dataHome);
const agentEnv = prepareMockAgentDataHome(dataHome);
handle = await spawnSandboxAgent({
enabled: true,
log: "silent",
timeoutMs: 30000,
env: {
XDG_DATA_HOME: dataHome,
},
env: agentEnv,
});
baseUrl = handle.baseUrl;
token = handle.token;