Fix log
This commit is contained in:
+1
-1
@@ -19,7 +19,7 @@ export const claude = agent({
|
||||
delete process.env.ANTHROPIC_API_KEY;
|
||||
|
||||
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
|
||||
const sandboxOptions: Options = payload.sandbox
|
||||
|
||||
+1
-1
@@ -167,7 +167,7 @@ export const cursor = agent({
|
||||
|
||||
try {
|
||||
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
|
||||
// in sandbox mode: remove --force flag and rely on cli-config.json sandbox settings
|
||||
|
||||
+1
-1
@@ -162,7 +162,7 @@ export const gemini = agent({
|
||||
}
|
||||
|
||||
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
|
||||
// --allowed-tools restricts which tools are available (removes others from registry entirely)
|
||||
|
||||
+1
-1
@@ -314,7 +314,7 @@ export const opencode = agent({
|
||||
configureOpenCodeSandbox({ sandbox: payload.sandbox ?? false });
|
||||
|
||||
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];
|
||||
|
||||
if (payload.sandbox) {
|
||||
|
||||
@@ -3,7 +3,6 @@ import { agentsManifest } from "../external.ts";
|
||||
import type { Context } from "../main.ts";
|
||||
import { buildPullfrogFooter, stripExistingFooter } from "../utils/buildPullfrogFooter.ts";
|
||||
import { log } from "../utils/cli.ts";
|
||||
import { parseRepoContext } from "../utils/github.ts";
|
||||
import { containsSecrets } from "../utils/secrets.ts";
|
||||
import { $ } from "../utils/shell.ts";
|
||||
import { execute, tool } from "./shared.ts";
|
||||
@@ -15,16 +14,15 @@ export const PullRequest = type({
|
||||
});
|
||||
|
||||
function buildPrBodyWithFooter(ctx: Context, body: string): string {
|
||||
const repoContext = parseRepoContext();
|
||||
const runId = process.env.GITHUB_RUN_ID;
|
||||
|
||||
const agentName = ctx.payload.agent;
|
||||
const agentInfo = agentName ? agentsManifest[agentName] : null;
|
||||
|
||||
const footer = buildPullfrogFooter({
|
||||
triggeredBy: true,
|
||||
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);
|
||||
|
||||
+10
-5
@@ -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)
|
||||
*/
|
||||
@@ -319,11 +328,7 @@ export const log = {
|
||||
/**
|
||||
* Run a callback within a collapsed group
|
||||
*/
|
||||
group: (name: string, fn: (log: typeof log) => void): void => {
|
||||
startGroup(name);
|
||||
fn(log);
|
||||
endGroup();
|
||||
},
|
||||
group,
|
||||
|
||||
/**
|
||||
* Log tool call information to console with formatted output
|
||||
|
||||
Reference in New Issue
Block a user