Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [Unreleased]

### Fixed

- Prime Agent 0.10.1 launches now use its `settings.json` MCP format and no longer pass the
removed `--extension` or `--no-tools` flags.

## [0.3.0] - 2026-10-05

### Highlights
Expand Down
4 changes: 2 additions & 2 deletions scripts/ci/check-live.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ async function checkPrime() {
const prompt = `Live cache probe ${runId}. Reply with exactly ${marker}.`;
const cacheArgs = [
"launch", "prime", "--model", liveModel, "--", "--print", "--mode", "json",
"--no-tools", "--no-session", "--thinking", liveLevels.offPi, prompt
"--no-session", "--thinking", liveLevels.offPi, prompt
];

await cleanupPrime();
Expand All @@ -447,7 +447,7 @@ async function checkPrime() {
await cleanupPrime();
const turn = primeTurn(await runZro([
"launch", "prime", "--model", liveModel, "--", "--print", "--mode", "json",
"--no-tools", "--no-session", "--thinking", liveLevels.maxPi,
"--no-session", "--thinking", liveLevels.maxPi,
`Think briefly, then include ${reasoningMarker} in the answer.`
], "Prime Agent max reasoning", REASONING_TIMEOUT_MS), reasoningMarker, { expectThinking: true });
assert.ok(turn.hasThinking, "Prime Agent max effort returned no thinking content");
Expand Down
12 changes: 5 additions & 7 deletions src/engine/tools/prime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import type { ToolModule } from "../types.js";
import { asPlainObject, objectAt } from "./helpers.js";

const PRIME_AGENT_DIR_ENV_KEY = "PRIME_AGENT_CODING_AGENT_DIR";
const PRIME_MCP_EXTENSION = "npm:pi-mcp-extension@1.5.0";
const PRIME_THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh"] as const;

const PRIME_SUBCOMMANDS = new Set([
Expand All @@ -18,7 +17,7 @@ function primeArgs(model: string, extraArgs: string[]): string[] {
if (extraArgs[0] && PRIME_SUBCOMMANDS.has(extraArgs[0])) {
return extraArgs;
}
return ["--provider", PROVIDER_ID, "--model", model, "--extension", PRIME_MCP_EXTENSION, ...extraArgs];
return ["--provider", PROVIDER_ID, "--model", model, ...extraArgs];
}

export const primeTool: ToolModule = {
Expand All @@ -29,7 +28,7 @@ export const primeTool: ToolModule = {
const tempHome = path.join(ctx.tempDir, "prime", "home");
const tempAgentDir = path.join(tempHome, ".prime", "agent");
const filePath = path.join(tempAgentDir, "models.json");
const mcpConfigPath = path.join(tempAgentDir, "mcp.json");
const settingsPath = path.join(tempAgentDir, "settings.json");
const existing = await readConfig(path.join(existingAgentDir, "models.json"), jsonSerializer);
const nextConfig = buildPrimeModelsConfig(existing, ctx.models);
return {
Expand All @@ -49,14 +48,13 @@ export const primeTool: ToolModule = {
contents: jsonSerializer.stringify(nextConfig)
},
{
path: mcpConfigPath,
path: settingsPath,
contents: jsonSerializer.stringify({
mcpServers: {
zro: {
transport: "streamable-http",
type: "http",
url: MCP_URL,
lifecycle: "eager",
headers: { Authorization: `Bearer ${ctx.apiKey}` }
bearer_token_env_var: ZRO_ENV_KEY
}
}
})
Expand Down
47 changes: 47 additions & 0 deletions tests/prime.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { PassThrough } from "node:stream";
import { describe, expect, it } from "vitest";
import { primeTool } from "../src/engine/tools/prime.js";
import { TEST_MODELS } from "./fixtures.js";
import type { LaunchContext } from "../src/engine/types.js";

describe("prime agent launch", () => {
it("writes the current settings.json MCP format without the removed --extension flag", async () => {
const home = await fs.mkdtemp(path.join(os.tmpdir(), "zro-prime-settings-"));
const plan = await primeTool.launch(context(home));

expect(plan.args).not.toContain("--extension");
const settings = plan.files?.find((file) => file.path.endsWith("settings.json"));
expect(settings).toBeDefined();
expect(JSON.parse(String(settings?.contents))).toEqual({
mcpServers: {
zro: {
type: "http",
url: "https://zro.moonmath.ai/mcp/zro",
bearer_token_env_var: "ZRO_API_KEY"
}
}
});
expect(plan.files?.some((file) => file.path.endsWith("mcp.json"))).toBe(false);
});
});

function context(homeDir: string): LaunchContext {
return {
apiKey: "sk-prime-secret",
apiKeySource: "env",
env: {},
model: "glm-5.3",
models: TEST_MODELS,
extraArgs: [],
homeDir,
cwd: homeDir,
tempDir: path.join(homeDir, "session"),
platform: "linux",
stdin: new PassThrough(),
stdout: new PassThrough(),
stderr: new PassThrough()
};
}
Loading