Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7d85e653ca | |||
| 4b3c5ca905 | |||
| 2799cce4bf |
@@ -27,9 +27,22 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
agent: [claude, opentoad]
|
||||
agent: [claude, opencode]
|
||||
test:
|
||||
[mcpmerge, nobash, restricted, smoke, token-exfil]
|
||||
[
|
||||
mcpmerge,
|
||||
nobash,
|
||||
restricted,
|
||||
skill-invoke-claude,
|
||||
skill-invoke-opencode,
|
||||
smoke,
|
||||
token-exfil,
|
||||
]
|
||||
exclude:
|
||||
- agent: claude
|
||||
test: skill-invoke-opencode
|
||||
- agent: opencode
|
||||
test: skill-invoke-claude
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Claude Code agent — secure harness around the `claude` CLI.
|
||||
*
|
||||
* mirrors the opentoad harness's security model:
|
||||
* mirrors the opencode harness's security model:
|
||||
* - native Bash blocked via --disallowedTools (agent cannot shell out)
|
||||
* - managed-settings.json: filesystem sandbox — deny /proc, /sys reads
|
||||
* - MCP ShellTool provides restricted shell (filtered env, no secrets)
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import { claude } from "./claude.ts";
|
||||
import { opentoad } from "./opentoad.ts";
|
||||
import { opencode } from "./opencode.ts";
|
||||
import type { Agent } from "./shared.ts";
|
||||
|
||||
export type { Agent, AgentUsage } from "./shared.ts";
|
||||
|
||||
export const agents = { claude, opentoad } satisfies Record<string, Agent>;
|
||||
export const agents = { claude, opencode } satisfies Record<string, Agent>;
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
/**
|
||||
* OpenToad agent — secure harness around OpenCode CLI.
|
||||
* OpenCode agent — secure harness around OpenCode CLI.
|
||||
*
|
||||
* transparently wraps OpenCode with a security layer:
|
||||
* - bash: "deny" via OPENCODE_CONFIG_CONTENT (agent cannot shell out)
|
||||
* - OPENCODE_PERMISSION: filesystem sandbox — deny all external paths except /tmp
|
||||
* - untrusted .opencode/plugins/ and .opencode/tools/ deleted before launch
|
||||
* - MCP ShellTool provides restricted shell (filtered env, no secrets)
|
||||
* - MCP server injected alongside project config (not replacing)
|
||||
* - ASKPASS handles git auth separately (token never in subprocess env)
|
||||
@@ -607,8 +606,8 @@ async function runOpenCode(params: RunParams): Promise<AgentResult> {
|
||||
|
||||
// ── agent ───────────────────────────────────────────────────────────────────────
|
||||
|
||||
export const opentoad = agent({
|
||||
name: "opentoad",
|
||||
export const opencode = agent({
|
||||
name: "opencode",
|
||||
install: installOpencodeCli,
|
||||
run: async (ctx) => {
|
||||
const cliPath = await installOpencodeCli();
|
||||
@@ -676,7 +675,7 @@ export const opentoad = agent({
|
||||
log.info(`» dirty working tree (attempt ${attempt + 1}/${MAX_COMMIT_RETRIES}):\n${status}`);
|
||||
result = await runOpenCode({
|
||||
...runParams,
|
||||
args: [...baseArgs, "--continue", buildCommitPrompt("opentoad", status)],
|
||||
args: [...baseArgs, "--continue", buildCommitPrompt("opencode", status)],
|
||||
});
|
||||
}
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@
|
||||
export const pullfrogMcpName = "pullfrog";
|
||||
|
||||
/** @see {@link file://./agents/shared.ts} Agent interface that uses this type */
|
||||
export type AgentId = "claude" | "opentoad";
|
||||
export type AgentId = "claude" | "opencode";
|
||||
|
||||
/**
|
||||
* format a tool name the way each agent's MCP client presents it to the model.
|
||||
@@ -19,7 +19,7 @@ export function formatMcpToolRef(agentId: AgentId, toolName: string): string {
|
||||
switch (agentId) {
|
||||
case "claude":
|
||||
return `mcp__${pullfrogMcpName}__${toolName}`;
|
||||
case "opentoad":
|
||||
case "opencode":
|
||||
return `${pullfrogMcpName}_${toolName}`;
|
||||
default:
|
||||
return agentId satisfies never;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,7 @@
|
||||
// changes to tool permissions should be reflected in wiki/granular-tools.md
|
||||
|
||||
import { existsSync, readdirSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import * as core from "@actions/core";
|
||||
import { deleteProgressComment, reportProgress } from "./mcp/comment.ts";
|
||||
import { startInstallation } from "./mcp/dependencies.ts";
|
||||
@@ -337,6 +339,21 @@ export async function main(): Promise<MainResult> {
|
||||
log.info(instructions.full);
|
||||
});
|
||||
|
||||
// OpenCode loads .opencode/plugin/ files at startup. if the repo has any,
|
||||
// eagerly await dependency installation so plugin imports can resolve.
|
||||
if (agentId === "opencode") {
|
||||
const pluginDir = join(process.cwd(), ".opencode", "plugin");
|
||||
const hasPlugins =
|
||||
existsSync(pluginDir) && readdirSync(pluginDir).some((f) => /\.[jt]sx?$/.test(f));
|
||||
if (hasPlugins && toolState.dependencyInstallation?.promise) {
|
||||
log.info(
|
||||
"» .opencode/plugin/ detected — awaiting dependency installation before agent start"
|
||||
);
|
||||
await toolState.dependencyInstallation.promise.catch(() => {});
|
||||
timer.checkpoint("awaitDepsForPlugins");
|
||||
}
|
||||
}
|
||||
|
||||
// run agent, optionally with timeout enforcement
|
||||
activityTimeout = createProcessOutputActivityTimeout({
|
||||
timeoutMs: DEFAULT_ACTIVITY_TIMEOUT_MS,
|
||||
@@ -460,9 +477,12 @@ export async function main(): Promise<MainResult> {
|
||||
killTrackedChildren();
|
||||
log.error(errorMessage);
|
||||
|
||||
// best-effort summary — don't mask the original error
|
||||
// best-effort summary — write the error so it's visible in the Actions summary tab
|
||||
try {
|
||||
await writeJobSummary(toolState);
|
||||
const errorSummary = `### ❌ Pullfrog failed\n\n\`\`\`\n${errorMessage}\n\`\`\``;
|
||||
const usageSummary = formatUsageSummary(toolState.usageEntries);
|
||||
const parts = [errorSummary, toolState.lastProgressBody, usageSummary].filter(Boolean);
|
||||
await writeSummary(parts.join("\n\n"));
|
||||
} catch {}
|
||||
|
||||
try {
|
||||
|
||||
+9
-2
@@ -65,7 +65,7 @@ function detectSandboxMethod(): SandboxMethod {
|
||||
// continue to try sudo
|
||||
}
|
||||
|
||||
// try sudo unshare (works on GHA runners)
|
||||
// sudo unshare (works on GHA runners)
|
||||
try {
|
||||
const result = spawnSync("sudo", ["unshare", "--pid", "--fork", "--mount-proc", "true"], {
|
||||
timeout: 5000,
|
||||
@@ -81,7 +81,7 @@ function detectSandboxMethod(): SandboxMethod {
|
||||
}
|
||||
|
||||
detectedSandboxMethod = "none";
|
||||
log.info("PID namespace isolation not available - falling back to env filtering only");
|
||||
log.info("PID namespace isolation not available");
|
||||
return "none";
|
||||
}
|
||||
|
||||
@@ -97,6 +97,13 @@ const PROC_CLEANUP =
|
||||
function spawnShell(params: SpawnParams): ChildProcess {
|
||||
const spawnOpts = { env: params.env, cwd: params.cwd, stdio: params.stdio, detached: true };
|
||||
const sandboxMethod = detectSandboxMethod();
|
||||
const ci = process.env.CI === "true";
|
||||
|
||||
if (ci && sandboxMethod === "none") {
|
||||
throw new Error(
|
||||
"pid namespace isolation is required in CI but unavailable (both unshare and sudo unshare failed)"
|
||||
);
|
||||
}
|
||||
|
||||
if (sandboxMethod === "unshare") {
|
||||
return spawn(
|
||||
|
||||
@@ -298,5 +298,5 @@ ${PR_SUMMARY_FORMAT}`,
|
||||
];
|
||||
}
|
||||
|
||||
// static export for UI display — uses opentoad format as the readable default
|
||||
export const modes: Mode[] = computeModes("opentoad");
|
||||
// static export for UI display — uses opencode format as the readable default
|
||||
export const modes: Mode[] = computeModes("opencode");
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pullfrog",
|
||||
"version": "0.0.200",
|
||||
"version": "0.0.201",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
"pullfrog": "dist/cli.mjs",
|
||||
|
||||
@@ -90,6 +90,6 @@ export const test: TestRunnerOptions = {
|
||||
fixture,
|
||||
validator,
|
||||
tags: ["adhoc", "security"],
|
||||
agents: ["opentoad"],
|
||||
agents: ["opencode"],
|
||||
env: { PULLFROG_DISABLE_SECURITY_INSTRUCTIONS: "1" },
|
||||
};
|
||||
|
||||
@@ -107,6 +107,6 @@ export const test: TestRunnerOptions = {
|
||||
fixture,
|
||||
validator,
|
||||
tags: ["adhoc", "security"],
|
||||
agents: ["opentoad"],
|
||||
agents: ["opencode"],
|
||||
env: { PULLFROG_DISABLE_SECURITY_INSTRUCTIONS: "1" },
|
||||
};
|
||||
|
||||
@@ -78,6 +78,6 @@ export const test: TestRunnerOptions = {
|
||||
fixture,
|
||||
validator,
|
||||
tags: ["adhoc", "security"],
|
||||
agents: ["opentoad"],
|
||||
agents: ["opencode"],
|
||||
env: { PULLFROG_DISABLE_SECURITY_INSTRUCTIONS: "1" },
|
||||
};
|
||||
|
||||
@@ -94,5 +94,6 @@ export const test: TestRunnerOptions = {
|
||||
fixture,
|
||||
validator,
|
||||
repoSetup,
|
||||
env: { PULLFROG_DISABLE_SECURITY_INSTRUCTIONS: "1" },
|
||||
tags: ["agnostic", "security"],
|
||||
};
|
||||
|
||||
@@ -102,5 +102,6 @@ export const test: TestRunnerOptions = {
|
||||
fixture,
|
||||
validator,
|
||||
agentEnv,
|
||||
env: { PULLFROG_DISABLE_SECURITY_INSTRUCTIONS: "1" },
|
||||
tags: ["agnostic"],
|
||||
};
|
||||
|
||||
@@ -90,5 +90,6 @@ export const test: TestRunnerOptions = {
|
||||
name: "pkg-json-scripts",
|
||||
fixture,
|
||||
validator,
|
||||
env: { PULLFROG_DISABLE_SECURITY_INSTRUCTIONS: "1" },
|
||||
tags: ["agnostic", "security"],
|
||||
};
|
||||
|
||||
@@ -60,5 +60,6 @@ export const test: TestRunnerOptions = {
|
||||
fixture,
|
||||
validator,
|
||||
agentEnv,
|
||||
env: { PULLFROG_DISABLE_SECURITY_INSTRUCTIONS: "1" },
|
||||
tags: ["agnostic"],
|
||||
};
|
||||
|
||||
@@ -72,5 +72,6 @@ export const test: TestRunnerOptions = {
|
||||
name: "push-enabled",
|
||||
fixture,
|
||||
validator,
|
||||
env: { PULLFROG_DISABLE_SECURITY_INSTRUCTIONS: "1" },
|
||||
tags: ["agnostic"],
|
||||
};
|
||||
|
||||
@@ -65,5 +65,6 @@ export const test: TestRunnerOptions = {
|
||||
name: "push-restricted",
|
||||
fixture,
|
||||
validator,
|
||||
env: { PULLFROG_DISABLE_SECURITY_INSTRUCTIONS: "1" },
|
||||
tags: ["agnostic"],
|
||||
};
|
||||
|
||||
@@ -27,5 +27,6 @@ export const test: TestRunnerOptions = {
|
||||
fixture,
|
||||
validator,
|
||||
expectFailure: true,
|
||||
env: { PULLFROG_DISABLE_SECURITY_INSTRUCTIONS: "1" },
|
||||
tags: ["agnostic"],
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# outputs a JSON array of agent names to stdout.
|
||||
#
|
||||
# only agents whose harness file changed AND are exported from index.ts are included.
|
||||
# shared.ts/index.ts and other non-harness action changes fall back to opentoad as a canary.
|
||||
# shared.ts/index.ts and other non-harness action changes fall back to opencode as a canary.
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
@@ -58,9 +58,9 @@ while IFS= read -r file; do
|
||||
done <<< "$files"
|
||||
|
||||
# output agents based on change type.
|
||||
# non-agent action changes always include opentoad as a canary.
|
||||
# non-agent action changes always include opencode as a canary.
|
||||
if $has_non_agent_change; then
|
||||
changed_agents+=("opentoad")
|
||||
changed_agents+=("opencode")
|
||||
fi
|
||||
|
||||
if [[ ${#changed_agents[@]} -gt 0 ]]; then
|
||||
|
||||
+8
-8
@@ -87,29 +87,29 @@ describe("ci workflow consistency", () => {
|
||||
expect(rootJob.strategy!.matrix.agent).toBe(dynamicAgentsExpression);
|
||||
});
|
||||
|
||||
it("changed-agents.sh falls back to opentoad when shared agent code changed", () => {
|
||||
it("changed-agents.sh falls back to opencode when shared agent code changed", () => {
|
||||
const input = JSON.stringify(["action/agents/shared.ts"]);
|
||||
const output = execFileSync("bash", [join(__dirname, "changed-agents.sh")], {
|
||||
input,
|
||||
encoding: "utf-8",
|
||||
});
|
||||
expect(JSON.parse(output)).toEqual(["opentoad"]);
|
||||
expect(JSON.parse(output)).toEqual(["opencode"]);
|
||||
});
|
||||
|
||||
it("changed-agents.sh falls back to opentoad for non-agent action changes", () => {
|
||||
it("changed-agents.sh falls back to opencode for non-agent action changes", () => {
|
||||
const output = execFileSync("bash", [join(__dirname, "changed-agents.sh")], {
|
||||
input: JSON.stringify(["action/mcp/server.ts"]),
|
||||
encoding: "utf-8",
|
||||
});
|
||||
expect(JSON.parse(output)).toEqual(["opentoad"]);
|
||||
expect(JSON.parse(output)).toEqual(["opencode"]);
|
||||
});
|
||||
|
||||
it("changed-agents.sh includes opentoad canary alongside changed agents", () => {
|
||||
it("changed-agents.sh includes opencode canary alongside changed agents", () => {
|
||||
const output = execFileSync("bash", [join(__dirname, "changed-agents.sh")], {
|
||||
input: JSON.stringify(["action/agents/opentoad.ts", "action/mcp/server.ts"]),
|
||||
input: JSON.stringify(["action/agents/opencode.ts", "action/mcp/server.ts"]),
|
||||
encoding: "utf-8",
|
||||
});
|
||||
expect(JSON.parse(output)).toEqual(["opentoad"]);
|
||||
expect(JSON.parse(output)).toEqual(["opencode"]);
|
||||
});
|
||||
|
||||
it("changed-agents.sh treats legacy agent files as non-agent changes", () => {
|
||||
@@ -117,7 +117,7 @@ describe("ci workflow consistency", () => {
|
||||
input: JSON.stringify(["action/agents/codex.ts", "action/agents/gemini.ts"]),
|
||||
encoding: "utf-8",
|
||||
});
|
||||
expect(JSON.parse(output)).toEqual(["opentoad"]);
|
||||
expect(JSON.parse(output)).toEqual(["opencode"]);
|
||||
});
|
||||
|
||||
it("action agent matrix matches agents map", () => {
|
||||
|
||||
@@ -38,6 +38,7 @@ export const test: TestRunnerOptions = {
|
||||
validator,
|
||||
env: {
|
||||
GITHUB_REPOSITORY: "pullfrog/test-repo-mcp",
|
||||
PULLFROG_DISABLE_SECURITY_INSTRUCTIONS: "1",
|
||||
PULLFROG_MCP_SECRET: secret,
|
||||
},
|
||||
repoSetup:
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
import { randomUUID } from "node:crypto";
|
||||
import type { AgentResult, TestRunnerOptions, ValidationCheck } from "../utils.ts";
|
||||
import { defineFixture, getAgentOutput } from "../utils.ts";
|
||||
|
||||
const skillName = "pullfrog-skill-check";
|
||||
const token = randomUUID();
|
||||
|
||||
const fixture = defineFixture(
|
||||
{
|
||||
prompt: `Do not modify any files.
|
||||
|
||||
Use the skill tool to load ${skillName}.
|
||||
Then call set_output with exactly this token and nothing else: ${token}`,
|
||||
shell: "restricted",
|
||||
push: "disabled",
|
||||
timeout: "4m",
|
||||
},
|
||||
{ localOnly: true }
|
||||
);
|
||||
|
||||
const repoSetup = `mkdir -p .claude/skills/${skillName} .opencode/skills/${skillName} && printf '%s\\n' '---' 'name: ${skillName}' 'description: local skill test token source' '---' '' 'token: ${token}' > .claude/skills/${skillName}/SKILL.md && cp .claude/skills/${skillName}/SKILL.md .opencode/skills/${skillName}/SKILL.md`;
|
||||
|
||||
function validator(result: AgentResult): ValidationCheck[] {
|
||||
const setOutputCalled = result.structuredOutput !== null;
|
||||
const tokenMatches = result.structuredOutput === token;
|
||||
|
||||
const agentOutput = getAgentOutput(result);
|
||||
const skillInvoked = /Skill\(\{[^)]*"skill":"pullfrog-skill-check"/.test(agentOutput);
|
||||
|
||||
return [
|
||||
{ name: "set_output", passed: setOutputCalled },
|
||||
{ name: "token_matches", passed: tokenMatches },
|
||||
{ name: "skill_invoked", passed: skillInvoked },
|
||||
];
|
||||
}
|
||||
|
||||
export const test: TestRunnerOptions = {
|
||||
name: "skill-invoke-claude",
|
||||
fixture,
|
||||
validator,
|
||||
agents: ["claude"],
|
||||
repoSetup,
|
||||
env: {
|
||||
PULLFROG_DISABLE_SECURITY_INSTRUCTIONS: "1",
|
||||
PULLFROG_MODEL: "anthropic/claude-sonnet-4-6",
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,47 @@
|
||||
import { randomUUID } from "node:crypto";
|
||||
import type { AgentResult, TestRunnerOptions, ValidationCheck } from "../utils.ts";
|
||||
import { defineFixture, getAgentOutput } from "../utils.ts";
|
||||
|
||||
const skillName = "pullfrog-skill-check";
|
||||
const token = randomUUID();
|
||||
|
||||
const fixture = defineFixture(
|
||||
{
|
||||
prompt: `Do not modify any files.
|
||||
|
||||
Use the skill tool to load ${skillName}.
|
||||
Then call set_output with exactly this token and nothing else: ${token}`,
|
||||
shell: "restricted",
|
||||
push: "disabled",
|
||||
timeout: "4m",
|
||||
},
|
||||
{ localOnly: true }
|
||||
);
|
||||
|
||||
const repoSetup = `mkdir -p .claude/skills/${skillName} .opencode/skills/${skillName} && printf '%s\\n' '---' 'name: ${skillName}' 'description: local skill test token source' '---' '' 'token: ${token}' > .claude/skills/${skillName}/SKILL.md && cp .claude/skills/${skillName}/SKILL.md .opencode/skills/${skillName}/SKILL.md`;
|
||||
|
||||
function validator(result: AgentResult): ValidationCheck[] {
|
||||
const setOutputCalled = result.structuredOutput !== null;
|
||||
const tokenMatches = result.structuredOutput === token;
|
||||
|
||||
const agentOutput = getAgentOutput(result);
|
||||
const skillInvoked = /skill\(\{[^)]*"name":"pullfrog-skill-check"/.test(agentOutput);
|
||||
|
||||
return [
|
||||
{ name: "set_output", passed: setOutputCalled },
|
||||
{ name: "token_matches", passed: tokenMatches },
|
||||
{ name: "skill_invoked", passed: skillInvoked },
|
||||
];
|
||||
}
|
||||
|
||||
export const test: TestRunnerOptions = {
|
||||
name: "skill-invoke-opencode",
|
||||
fixture,
|
||||
validator,
|
||||
agents: ["opencode"],
|
||||
repoSetup,
|
||||
env: {
|
||||
PULLFROG_DISABLE_SECURITY_INSTRUCTIONS: "1",
|
||||
PULLFROG_MODEL: "anthropic/claude-sonnet-4-6",
|
||||
},
|
||||
};
|
||||
@@ -28,4 +28,5 @@ export const test: TestRunnerOptions = {
|
||||
name: "smoke",
|
||||
fixture,
|
||||
validator,
|
||||
env: { PULLFROG_DISABLE_SECURITY_INSTRUCTIONS: "1" },
|
||||
};
|
||||
|
||||
@@ -6,7 +6,7 @@ import { defineFixture, generateAgentUuids, getAgentOutput } from "../utils.ts";
|
||||
* process environment. SANDBOX_TEST_TOKEN is set in the agent's process env
|
||||
* but should be invisible via:
|
||||
* - shell: filterEnv() strips *_TOKEN vars, PID namespace hides parent /proc
|
||||
* - native tools: OPENCODE_PERMISSION denies external_directory (opentoad),
|
||||
* - native tools: OPENCODE_PERMISSION denies external_directory (opencode),
|
||||
* managed-settings.json denies /proc reads (claude)
|
||||
*
|
||||
* runs with both agents to verify each sandbox independently.
|
||||
|
||||
+7
-7
@@ -27,14 +27,14 @@ import {
|
||||
* filters can be test names, tags, or agent names:
|
||||
* node test/run.ts # run all tests (excludes adhoc-tagged tests)
|
||||
* node test/run.ts smoke # run tests named "smoke" or tagged "smoke"
|
||||
* node test/run.ts opentoad # run all tests for opentoad only
|
||||
* node test/run.ts opencode # run all tests for opencode only
|
||||
* node test/run.ts security # run all tests tagged "security"
|
||||
* node test/run.ts agnostic # run all agnostic-tagged tests (with opentoad)
|
||||
* node test/run.ts agnostic # run all agnostic-tagged tests (with opencode)
|
||||
* node test/run.ts adhoc # run all adhoc-tagged tests
|
||||
* node test/run.ts smoke opentoad # run smoke tests for opentoad only
|
||||
* node test/run.ts smoke opencode # run smoke tests for opencode only
|
||||
*
|
||||
* special tags:
|
||||
* - "agnostic": runs with opentoad only, excluded when filtering by agent
|
||||
* - "agnostic": runs with opencode only, excluded when filtering by agent
|
||||
* - "adhoc": excluded from default runs, must be explicitly requested
|
||||
*
|
||||
* by default, runs in a Docker container for isolation.
|
||||
@@ -303,7 +303,7 @@ async function runTestForAgent(ctx: RunContext): Promise<ValidationResult> {
|
||||
if (!Object.hasOwn(env, "PULLFROG_MODEL")) {
|
||||
const defaultModels: Record<string, string> = {
|
||||
claude: "anthropic/claude-sonnet-4-6",
|
||||
opentoad: "anthropic/claude-sonnet-4-6",
|
||||
opencode: "anthropic/claude-sonnet-4-6",
|
||||
};
|
||||
const model = defaultModels[ctx.agent];
|
||||
if (model) {
|
||||
@@ -414,11 +414,11 @@ async function main(): Promise<void> {
|
||||
const isAgnostic = hasTag(testInfo, "agnostic");
|
||||
|
||||
if (isAgnostic) {
|
||||
// agnostic tests: skip if only filtering by agent, otherwise run with opentoad
|
||||
// agnostic tests: skip if only filtering by agent, otherwise run with opencode
|
||||
if (parsed.filters.length === 0 && parsed.agentFilters.length > 0) {
|
||||
continue;
|
||||
}
|
||||
runs.push({ testInfo, agent: "opentoad" });
|
||||
runs.push({ testInfo, agent: "opencode" });
|
||||
} else {
|
||||
// determine which agents to run for this test
|
||||
const testAgents = testInfo.config.agents ?? agents;
|
||||
|
||||
+2
-2
@@ -90,7 +90,7 @@ export function generateAgentUuids<T extends string>(envVarNames: T[]): AgentUui
|
||||
|
||||
// assign consistent colors to agents (using ANSI codes)
|
||||
const AGENT_COLORS: Record<string, string> = {
|
||||
opentoad: "\x1b[32m", // green
|
||||
opencode: "\x1b[32m", // green
|
||||
};
|
||||
const RESET = "\x1b[0m";
|
||||
|
||||
@@ -325,7 +325,7 @@ export interface TestRunnerOptions {
|
||||
repoSetup?: string;
|
||||
// tags for grouping tests (e.g., ["agnostic"], ["fs"])
|
||||
// special tags:
|
||||
// - "agnostic": runs with opentoad only, excluded when filtering by agent
|
||||
// - "agnostic": runs with opencode only, excluded when filtering by agent
|
||||
// - "adhoc": excluded from default runs, must be explicitly requested
|
||||
tags?: TestTag[];
|
||||
}
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@ import { describe, expect, it } from "vitest";
|
||||
import { resolveAgent } from "./agent.ts";
|
||||
|
||||
describe("resolveAgent", () => {
|
||||
it("returns opentoad", () => {
|
||||
it("returns opencode", () => {
|
||||
const agent = resolveAgent({});
|
||||
expect(agent.name).toBe("opentoad");
|
||||
expect(agent.name).toBe("opencode");
|
||||
});
|
||||
});
|
||||
|
||||
+1
-1
@@ -64,5 +64,5 @@ export function resolveAgent(ctx: { model?: string | undefined }): Agent {
|
||||
}
|
||||
|
||||
// 3. default: OpenCode (universal, supports all providers)
|
||||
return agents.opentoad;
|
||||
return agents.opencode;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
||||
import { validateAgentApiKey } from "./apiKeys.ts";
|
||||
|
||||
const base = {
|
||||
agent: { name: "opentoad" },
|
||||
agent: { name: "opencode" },
|
||||
owner: "test-owner",
|
||||
name: "test-repo",
|
||||
};
|
||||
|
||||
@@ -281,6 +281,8 @@ Never use \`sleep\` to wait for commands to complete. Commands run synchronously
|
||||
|
||||
When posting comments via ${pullfrogMcpName}, write as a professional team member would. Your final comments should be polished and actionable — do not include intermediate reasoning like "I'll now look at the code" or "Let me respond to the question."
|
||||
|
||||
When embedding images (e.g. uploaded screenshots) in comments or PR bodies, always use markdown image syntax: \`\`. Never paste a naked URL — it will not render as an image.
|
||||
|
||||
### Progress reporting
|
||||
|
||||
**Task list**: at the start of every run, create an internal task list based on the steps in your current mode. Update it as you complete each step. The system automatically renders this list to the progress comment — you do not need to call \`report_progress\` for this.
|
||||
|
||||
Reference in New Issue
Block a user