mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 19:04:37 +00:00
fix(coding-agent): use describe.skipIf for RPC test with explicit model
- Use describe.skipIf pattern matching other tests - Skip when ANTHROPIC_API_KEY and ANTHROPIC_OAUTH_TOKEN are missing - Use explicit --provider anthropic --model claude-sonnet-4-5
This commit is contained in:
parent
c43f1d307c
commit
bc4aa4aaa1
1 changed files with 11 additions and 10 deletions
|
|
@ -7,16 +7,13 @@ import { fileURLToPath } from "node:url";
|
||||||
import type { AgentEvent } from "@mariozechner/pi-agent-core";
|
import type { AgentEvent } from "@mariozechner/pi-agent-core";
|
||||||
import { afterEach, beforeEach, describe, expect, test } from "vitest";
|
import { afterEach, beforeEach, describe, expect, test } from "vitest";
|
||||||
|
|
||||||
// Skip RPC integration test on CI runners; it depends on external LLM calls and can exit early
|
|
||||||
const maybeDescribe = process.env.CI ? describe.skip : describe;
|
|
||||||
|
|
||||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RPC mode tests.
|
* RPC mode tests.
|
||||||
* Regression test for issue #83: https://github.com/badlogic/pi-mono/issues/83
|
* Regression test for issue #83: https://github.com/badlogic/pi-mono/issues/83
|
||||||
*/
|
*/
|
||||||
maybeDescribe("RPC mode", () => {
|
describe.skipIf(!process.env.ANTHROPIC_API_KEY && !process.env.ANTHROPIC_OAUTH_TOKEN)("RPC mode", () => {
|
||||||
let agent: ChildProcess;
|
let agent: ChildProcess;
|
||||||
let sessionDir: string;
|
let sessionDir: string;
|
||||||
|
|
||||||
|
|
@ -38,13 +35,17 @@ maybeDescribe("RPC mode", () => {
|
||||||
|
|
||||||
test("should save messages to session file", async () => {
|
test("should save messages to session file", async () => {
|
||||||
// Spawn agent in RPC mode with custom session directory
|
// Spawn agent in RPC mode with custom session directory
|
||||||
agent = spawn("node", ["dist/cli.js", "--mode", "rpc"], {
|
agent = spawn(
|
||||||
cwd: join(__dirname, ".."),
|
"node",
|
||||||
env: {
|
["dist/cli.js", "--mode", "rpc", "--provider", "anthropic", "--model", "claude-sonnet-4-5"],
|
||||||
...process.env,
|
{
|
||||||
PI_CODING_AGENT_DIR: sessionDir,
|
cwd: join(__dirname, ".."),
|
||||||
|
env: {
|
||||||
|
...process.env,
|
||||||
|
PI_CODING_AGENT_DIR: sessionDir,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
);
|
||||||
|
|
||||||
const events: AgentEvent[] = [];
|
const events: AgentEvent[] = [];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue