move instructions logging earlier and clarify built-in tool logs

Log the instructions box immediately after instruction resolution in main, and standardize agent permission summaries to debug-level "disallowed built-ins" output to reduce confusion with pullfrog MCP tools.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Colin McDonnell
2026-02-18 19:01:08 +00:00
committed by pullfrog[bot]
parent 9948c08e7d
commit 57537d1a95
7 changed files with 38 additions and 37 deletions
+8 -4
View File
@@ -63,7 +63,7 @@ function writeMcpConfig(ctx: AgentRunContext): string {
};
writeFileSync(configPath, JSON.stringify(mcpConfig, null, 2), "utf-8");
log.info(`» MCP config written to ${configPath}`);
log.debug(`» MCP config written to ${configPath}`);
return configPath;
}
@@ -91,7 +91,7 @@ export const claude = agent({
// build disallowedTools based on tool permissions
const disallowedTools = buildDisallowedTools(ctx);
if (disallowedTools.length > 0) {
log.info(`» disallowed tools: ${disallowedTools.join(", ")}`);
log.debug(`» disallowed built-ins: ${JSON.stringify(disallowedTools)}`);
}
// write MCP config file
@@ -253,8 +253,12 @@ const messageHandlers: SDKMessageHandlers = {
? content.content
: Array.isArray(content.content)
? content.content
.map((c) =>
typeof c === "string" ? c : "text" in c ? c.text : JSON.stringify(c)
.map((entry: unknown) =>
typeof entry === "string"
? entry
: typeof entry === "object" && entry !== null && "text" in entry
? String(entry.text)
: JSON.stringify(entry)
)
.join("\n")
: String(content.content);
+1
View File
@@ -440,5 +440,6 @@ function configureCursorTools(ctx: AgentRunContext): void {
writeFileSync(cliConfigPath, JSON.stringify(config, null, 2), "utf-8");
log.info(`» CLI config written to ${cliConfigPath}`);
log.debug(`» disallowed built-ins: ${JSON.stringify(deny)}`);
log.debug(`» CLI config contents: ${JSON.stringify(config, null, 2)}`);
}
+1 -1
View File
@@ -413,7 +413,7 @@ function configureGeminiSettings(ctx: AgentRunContext): string {
writeFileSync(settingsPath, JSON.stringify(newSettings, null, 2), "utf-8");
log.info(`» Gemini settings written to ${settingsPath}`);
if (exclude.length > 0) {
log.info(`» excluded tools: ${exclude.join(", ")}`);
log.debug(`» disallowed built-ins: ${JSON.stringify(exclude)}`);
}
return model;
+1 -3
View File
@@ -324,9 +324,7 @@ function configureOpenCode(ctx: AgentRunContext): void {
}
log.info(`» OpenCode config written to ${configPath}`);
log.debug(
`» OpenCode permissions: edit=${permission.edit}, bash=${permission.bash}, webfetch=${permission.webfetch}`
);
log.debug(`» disallowed built-ins: ${JSON.stringify(permission)}`);
log.debug(`OpenCode config contents:\n${configJson}`);
}
-12
View File
@@ -37,18 +37,6 @@ export const agent = <const input extends AgentInput>(input: input): defineAgent
log.info(`» bash: ${ctx.payload.bash}`);
log.debug(`» payload: ${JSON.stringify(ctx.payload, null, 2)}`);
// build log box content: eventInstructions (if any) + user request (if any) + event data
const logParts = [
ctx.instructions.eventInstructions
? `EVENT-LEVEL INSTRUCTIONS:\n${ctx.instructions.eventInstructions}`
: null,
ctx.instructions.user ? `USER REQUEST:\n${ctx.instructions.user}` : null,
ctx.instructions.event,
].filter(Boolean);
log.box(logParts.join("\n\n---\n\n"), {
title: "Instructions",
});
return input.run(ctx);
},
...agentsManifest[input.name],
+16 -17
View File
@@ -144838,16 +144838,6 @@ var agent = (input) => {
log.info(`\xBB push: ${ctx.payload.push}`);
log.info(`\xBB bash: ${ctx.payload.bash}`);
log.debug(`\xBB payload: ${JSON.stringify(ctx.payload, null, 2)}`);
const logParts = [
ctx.instructions.eventInstructions ? `EVENT-LEVEL INSTRUCTIONS:
${ctx.instructions.eventInstructions}` : null,
ctx.instructions.user ? `USER REQUEST:
${ctx.instructions.user}` : null,
ctx.instructions.event
].filter(Boolean);
log.box(logParts.join("\n\n---\n\n"), {
title: "Instructions"
});
return input.run(ctx);
},
...agentsManifest[input.name]
@@ -144885,7 +144875,7 @@ function writeMcpConfig(ctx) {
}
};
writeFileSync7(configPath, JSON.stringify(mcpConfig, null, 2), "utf-8");
log.info(`\xBB MCP config written to ${configPath}`);
log.debug(`\xBB MCP config written to ${configPath}`);
return configPath;
}
async function installClaude() {
@@ -144906,7 +144896,7 @@ var claude = agent({
log.info(`\xBB model: ${model}${effortLevel ? ` (effort: ${effortLevel})` : ""}`);
const disallowedTools = buildDisallowedTools(ctx);
if (disallowedTools.length > 0) {
log.info(`\xBB disallowed tools: ${disallowedTools.join(", ")}`);
log.debug(`\xBB disallowed built-ins: ${JSON.stringify(disallowedTools)}`);
}
const mcpConfigPath = writeMcpConfig(ctx);
const args2 = [
@@ -145019,7 +145009,7 @@ var messageHandlers = {
const toolUseId = content.tool_use_id;
const isBashTool = toolUseId && bashToolIds.has(toolUseId);
const outputContent = typeof content.content === "string" ? content.content : Array.isArray(content.content) ? content.content.map(
(c) => typeof c === "string" ? c : "text" in c ? c.text : JSON.stringify(c)
(entry) => typeof entry === "string" ? entry : typeof entry === "object" && entry !== null && "text" in entry ? String(entry.text) : JSON.stringify(entry)
).join("\n") : String(content.content);
if (isBashTool) {
log.startGroup(`bash output`);
@@ -145617,6 +145607,7 @@ function configureCursorTools(ctx) {
}
writeFileSync9(cliConfigPath, JSON.stringify(config3, null, 2), "utf-8");
log.info(`\xBB CLI config written to ${cliConfigPath}`);
log.debug(`\xBB disallowed built-ins: ${JSON.stringify(deny)}`);
log.debug(`\xBB CLI config contents: ${JSON.stringify(config3, null, 2)}`);
}
@@ -145879,7 +145870,7 @@ function configureGeminiSettings(ctx) {
writeFileSync10(settingsPath, JSON.stringify(newSettings, null, 2), "utf-8");
log.info(`\xBB Gemini settings written to ${settingsPath}`);
if (exclude.length > 0) {
log.info(`\xBB excluded tools: ${exclude.join(", ")}`);
log.debug(`\xBB disallowed built-ins: ${JSON.stringify(exclude)}`);
}
return model;
}
@@ -146111,9 +146102,7 @@ function configureOpenCode(ctx) {
throw error49;
}
log.info(`\xBB OpenCode config written to ${configPath}`);
log.debug(
`\xBB OpenCode permissions: edit=${permission.edit}, bash=${permission.bash}, webfetch=${permission.webfetch}`
);
log.debug(`\xBB disallowed built-ins: ${JSON.stringify(permission)}`);
log.debug(`OpenCode config contents:
${configJson}`);
}
@@ -147063,6 +147052,16 @@ async function main() {
repo: runContext.repo,
modes: modes2
});
const logParts = [
instructions.eventInstructions ? `EVENT-LEVEL INSTRUCTIONS:
${instructions.eventInstructions}` : null,
instructions.user ? `USER REQUEST:
${instructions.user}` : null,
instructions.event
].filter(Boolean);
log.box(logParts.join("\n\n---\n\n"), {
title: "Instructions"
});
activityTimeout = createProcessOutputActivityTimeout({
timeoutMs: DEFAULT_ACTIVITY_TIMEOUT_MS,
checkIntervalMs: DEFAULT_ACTIVITY_CHECK_INTERVAL_MS
+11
View File
@@ -167,6 +167,17 @@ export async function main(): Promise<MainResult> {
repo: runContext.repo,
modes,
});
// log instructions as soon as they are fully resolved
const logParts = [
instructions.eventInstructions
? `EVENT-LEVEL INSTRUCTIONS:\n${instructions.eventInstructions}`
: null,
instructions.user ? `USER REQUEST:\n${instructions.user}` : null,
instructions.event,
].filter(Boolean);
log.box(logParts.join("\n\n---\n\n"), {
title: "Instructions",
});
// run agent, optionally with timeout enforcement
activityTimeout = createProcessOutputActivityTimeout({