This commit is contained in:
Colin McDonnell
2025-12-16 19:01:13 -08:00
parent 114c0b5632
commit a2f6b938de
6 changed files with 17 additions and 14 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ export const claude = agent({
delete process.env.ANTHROPIC_API_KEY; delete process.env.ANTHROPIC_API_KEY;
const prompt = addInstructions({ payload, prepResults, repo }); const prompt = addInstructions({ payload, prepResults, repo });
log.group("Full prompt", (log) => log.info(prompt)); log.group("Full prompt", () => log.info(prompt));
// configure sandbox mode if enabled // configure sandbox mode if enabled
const sandboxOptions: Options = payload.sandbox const sandboxOptions: Options = payload.sandbox
+1 -1
View File
@@ -167,7 +167,7 @@ export const cursor = agent({
try { try {
const fullPrompt = addInstructions({ payload, prepResults, repo }); const fullPrompt = addInstructions({ payload, prepResults, repo });
log.group("Full prompt", (log) => log.info(fullPrompt)); log.group("Full prompt", () => log.info(fullPrompt));
// configure sandbox mode if enabled // configure sandbox mode if enabled
// in sandbox mode: remove --force flag and rely on cli-config.json sandbox settings // in sandbox mode: remove --force flag and rely on cli-config.json sandbox settings
+1 -1
View File
@@ -162,7 +162,7 @@ export const gemini = agent({
} }
const sessionPrompt = addInstructions({ payload, prepResults, repo }); const sessionPrompt = addInstructions({ payload, prepResults, repo });
log.group("Full prompt", (log) => log.info(sessionPrompt)); log.group("Full prompt", () => log.info(sessionPrompt));
// configure sandbox mode if enabled // configure sandbox mode if enabled
// --allowed-tools restricts which tools are available (removes others from registry entirely) // --allowed-tools restricts which tools are available (removes others from registry entirely)
+1 -1
View File
@@ -314,7 +314,7 @@ export const opencode = agent({
configureOpenCodeSandbox({ sandbox: payload.sandbox ?? false }); configureOpenCodeSandbox({ sandbox: payload.sandbox ?? false });
const prompt = addInstructions({ payload, prepResults, repo }); const prompt = addInstructions({ payload, prepResults, repo });
log.group("Full prompt", (log) => log.info(prompt)); log.group("Full prompt", () => log.info(prompt));
const args = ["run", "--format", "json", prompt]; const args = ["run", "--format", "json", prompt];
if (payload.sandbox) { if (payload.sandbox) {
+3 -5
View File
@@ -3,7 +3,6 @@ import { agentsManifest } from "../external.ts";
import type { Context } from "../main.ts"; import type { Context } from "../main.ts";
import { buildPullfrogFooter, stripExistingFooter } from "../utils/buildPullfrogFooter.ts"; import { buildPullfrogFooter, stripExistingFooter } from "../utils/buildPullfrogFooter.ts";
import { log } from "../utils/cli.ts"; import { log } from "../utils/cli.ts";
import { parseRepoContext } from "../utils/github.ts";
import { containsSecrets } from "../utils/secrets.ts"; import { containsSecrets } from "../utils/secrets.ts";
import { $ } from "../utils/shell.ts"; import { $ } from "../utils/shell.ts";
import { execute, tool } from "./shared.ts"; import { execute, tool } from "./shared.ts";
@@ -15,16 +14,15 @@ export const PullRequest = type({
}); });
function buildPrBodyWithFooter(ctx: Context, body: string): string { function buildPrBodyWithFooter(ctx: Context, body: string): string {
const repoContext = parseRepoContext();
const runId = process.env.GITHUB_RUN_ID;
const agentName = ctx.payload.agent; const agentName = ctx.payload.agent;
const agentInfo = agentName ? agentsManifest[agentName] : null; const agentInfo = agentName ? agentsManifest[agentName] : null;
const footer = buildPullfrogFooter({ const footer = buildPullfrogFooter({
triggeredBy: true, triggeredBy: true,
agent: agentInfo ? { displayName: agentInfo.displayName, url: agentInfo.url } : undefined, agent: agentInfo ? { displayName: agentInfo.displayName, url: agentInfo.url } : undefined,
workflowRun: runId ? { owner: repoContext.owner, repo: repoContext.name, runId } : undefined, workflowRun: ctx.runId
? { owner: ctx.owner, repo: ctx.name, runId: ctx.runId, jobId: ctx.jobId }
: undefined,
}); });
const bodyWithoutFooter = stripExistingFooter(body); const bodyWithoutFooter = stripExistingFooter(body);
+10 -5
View File
@@ -32,6 +32,15 @@ function endGroup(): void {
} }
} }
/**
* Run a callback within a collapsed group
*/
function group(name: string, fn: () => void): void {
startGroup(name);
fn();
endGroup();
}
/** /**
* Print a formatted box with text (for console output) * Print a formatted box with text (for console output)
*/ */
@@ -319,11 +328,7 @@ export const log = {
/** /**
* Run a callback within a collapsed group * Run a callback within a collapsed group
*/ */
group: (name: string, fn: (log: typeof log) => void): void => { group,
startGroup(name);
fn(log);
endGroup();
},
/** /**
* Log tool call information to console with formatted output * Log tool call information to console with formatted output