Flesh out debug logs
This commit is contained in:
@@ -19736,10 +19736,10 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
|
||||
error42(message);
|
||||
}
|
||||
exports.setFailed = setFailed2;
|
||||
function isDebug() {
|
||||
function isDebug2() {
|
||||
return process.env["RUNNER_DEBUG"] === "1";
|
||||
}
|
||||
exports.isDebug = isDebug;
|
||||
exports.isDebug = isDebug2;
|
||||
function debug(message) {
|
||||
(0, command_1.issueCommand)("debug", {}, message);
|
||||
}
|
||||
@@ -80222,7 +80222,7 @@ var package_default = {
|
||||
var core = __toESM(require_core(), 1);
|
||||
var import_table = __toESM(require_src(), 1);
|
||||
var isGitHubActions = !!process.env.GITHUB_ACTIONS;
|
||||
var isDebugEnabled = () => process.env.LOG_LEVEL === "debug" || process.env.ACTIONS_STEP_DEBUG === "true";
|
||||
var isDebugEnabled = () => process.env.LOG_LEVEL === "debug" || process.env.ACTIONS_STEP_DEBUG === "true" || process.env.RUNNER_DEBUG === "1" || core.isDebug();
|
||||
function startGroup2(name) {
|
||||
if (isGitHubActions) {
|
||||
core.startGroup(name);
|
||||
@@ -90162,7 +90162,7 @@ var claude = agent({
|
||||
run: async ({ payload, mcpServers, apiKey, cliPath, prepResults, repo }) => {
|
||||
delete process.env.ANTHROPIC_API_KEY;
|
||||
const prompt = addInstructions({ payload, prepResults, repo });
|
||||
log.group("Full prompt", () => log.info(prompt));
|
||||
log.group("\xBB Full prompt", () => log.info(prompt));
|
||||
const sandboxOptions = payload.sandbox ? {
|
||||
permissionMode: "default",
|
||||
disallowedTools: ["Bash", "WebSearch", "WebFetch", "Write"],
|
||||
@@ -90195,6 +90195,7 @@ var claude = agent({
|
||||
}
|
||||
});
|
||||
for await (const message of queryInstance) {
|
||||
log.debug(JSON.stringify(message, null, 2));
|
||||
const handler2 = messageHandlers[message.type];
|
||||
await handler2(message);
|
||||
}
|
||||
@@ -90843,7 +90844,7 @@ var cursor = agent({
|
||||
};
|
||||
try {
|
||||
const fullPrompt = addInstructions({ payload, prepResults, repo });
|
||||
log.group("Full prompt", () => log.info(fullPrompt));
|
||||
log.group("\xBB Full prompt", () => log.info(fullPrompt));
|
||||
const cursorArgs = payload.sandbox ? [
|
||||
"--print",
|
||||
fullPrompt,
|
||||
@@ -90876,6 +90877,7 @@ var cursor = agent({
|
||||
stdout += text;
|
||||
try {
|
||||
const event = JSON.parse(text);
|
||||
log.debug(JSON.stringify(event, null, 2));
|
||||
if (event.type === "thinking" && event.subtype === "delta" && !event.text) {
|
||||
return;
|
||||
}
|
||||
@@ -90953,7 +90955,7 @@ function configureCursorMcpServers({ mcpServers }) {
|
||||
};
|
||||
}
|
||||
writeFileSync2(mcpConfigPath, JSON.stringify({ mcpServers: cursorMcpServers }, null, 2), "utf-8");
|
||||
log.info(`MCP config written to ${mcpConfigPath}`);
|
||||
log.info(`\xBB MCP config written to ${mcpConfigPath}`);
|
||||
}
|
||||
function configureCursorSandbox({ sandbox }) {
|
||||
const realHome = homedir2();
|
||||
@@ -90982,7 +90984,7 @@ function configureCursorSandbox({ sandbox }) {
|
||||
}
|
||||
};
|
||||
writeFileSync2(cliConfigPath, JSON.stringify(config3, null, 2), "utf-8");
|
||||
log.info(`CLI config written to ${cliConfigPath} (sandbox: ${sandbox})`);
|
||||
log.info(`\xBB CLI config written to ${cliConfigPath} (sandbox: ${sandbox})`);
|
||||
}
|
||||
|
||||
// agents/gemini.ts
|
||||
@@ -91153,7 +91155,7 @@ var gemini = agent({
|
||||
throw new Error("google_api_key or gemini_api_key is required for gemini agent");
|
||||
}
|
||||
const sessionPrompt = addInstructions({ payload, prepResults, repo });
|
||||
log.group("Full prompt", () => log.info(sessionPrompt));
|
||||
log.group("\xBB Full prompt", () => log.info(sessionPrompt));
|
||||
const args3 = payload.sandbox ? [
|
||||
"--allowed-tools",
|
||||
"read_file,list_directory,search_file_content,glob,save_memory,write_todos",
|
||||
@@ -91276,7 +91278,7 @@ var opencode = agent({
|
||||
mkdirSync4(configDir, { recursive: true });
|
||||
configureOpenCode({ mcpServers, sandbox: payload.sandbox ?? false });
|
||||
const prompt = addInstructions({ payload, prepResults, repo });
|
||||
log.group("Full prompt", () => log.info(prompt));
|
||||
log.group("\xBB Full prompt", () => log.info(prompt));
|
||||
const args3 = ["run", prompt, "--format", "json"];
|
||||
if (payload.sandbox) {
|
||||
log.info("\u{1F512} sandbox mode enabled: restricting to read-only operations");
|
||||
@@ -91326,9 +91328,7 @@ var opencode = agent({
|
||||
try {
|
||||
const event = JSON.parse(trimmed);
|
||||
eventCount++;
|
||||
log.debug(
|
||||
`\xBB event: type=${event.type} data=${JSON.stringify(event).substring(0, 300)}`
|
||||
);
|
||||
log.debug(JSON.stringify(event, null, 2));
|
||||
const timeSinceLastActivity = Date.now() - lastActivityTime;
|
||||
if (timeSinceLastActivity > 1e4) {
|
||||
const activeToolCalls = toolCallTimings.size;
|
||||
@@ -91439,7 +91439,7 @@ function configureOpenCode({ mcpServers, sandbox }) {
|
||||
);
|
||||
throw error42;
|
||||
}
|
||||
log.info(`OpenCode config written to ${configPath} (sandbox: ${sandbox})`);
|
||||
log.info(`\xBB OpenCode config written to ${configPath} (sandbox: ${sandbox})`);
|
||||
log.debug(`OpenCode config contents:
|
||||
${configJson}`);
|
||||
}
|
||||
@@ -123903,7 +123903,7 @@ var CheckoutPr = type({
|
||||
pull_number: type.number.describe("the pull request number to checkout")
|
||||
});
|
||||
async function checkoutPrBranch(ctx, pull_number) {
|
||||
log.info(`\u{1F500} checking out PR #${pull_number}...`);
|
||||
log.debug(`\u{1F500} checking out PR #${pull_number}...`);
|
||||
const pr = await ctx.octokit.rest.pulls.get({
|
||||
owner: ctx.owner,
|
||||
repo: ctx.name,
|
||||
@@ -123919,18 +123919,18 @@ async function checkoutPrBranch(ctx, pull_number) {
|
||||
const currentBranch = $("git", ["rev-parse", "--abbrev-ref", "HEAD"], { log: false }).trim();
|
||||
const alreadyOnBranch = currentBranch === headBranch;
|
||||
if (alreadyOnBranch) {
|
||||
log.info(`already on PR branch ${headBranch}, skipping checkout`);
|
||||
log.debug(`already on PR branch ${headBranch}, skipping checkout`);
|
||||
} else {
|
||||
log.info(`\u{1F4E5} fetching base branch (${baseBranch})...`);
|
||||
log.debug(`\u{1F4E5} fetching base branch (${baseBranch})...`);
|
||||
$("git", ["fetch", "--no-tags", "origin", baseBranch]);
|
||||
$("git", ["checkout", "-B", baseBranch, `origin/${baseBranch}`]);
|
||||
log.info(`\u{1F33F} fetching PR #${pull_number} (${headBranch})...`);
|
||||
log.debug(`\u{1F33F} fetching PR #${pull_number} (${headBranch})...`);
|
||||
$("git", ["fetch", "--no-tags", "origin", `pull/${pull_number}/head:${headBranch}`]);
|
||||
$("git", ["checkout", headBranch]);
|
||||
log.info(`\u2713 checked out PR #${pull_number}`);
|
||||
log.debug(`\u2713 checked out PR #${pull_number}`);
|
||||
}
|
||||
if (alreadyOnBranch) {
|
||||
log.info(`\u{1F4E5} fetching base branch (${baseBranch})...`);
|
||||
log.debug(`\u{1F4E5} fetching base branch (${baseBranch})...`);
|
||||
$("git", ["fetch", "--no-tags", "origin", baseBranch]);
|
||||
}
|
||||
if (isFork) {
|
||||
@@ -123938,13 +123938,13 @@ async function checkoutPrBranch(ctx, pull_number) {
|
||||
const forkUrl = `https://x-access-token:${ctx.githubInstallationToken}@github.com/${headRepo.full_name}.git`;
|
||||
try {
|
||||
$("git", ["remote", "add", remoteName, forkUrl]);
|
||||
log.info(`\u{1F4CC} added remote '${remoteName}' for fork ${headRepo.full_name}`);
|
||||
log.debug(`\u{1F4CC} added remote '${remoteName}' for fork ${headRepo.full_name}`);
|
||||
} catch {
|
||||
$("git", ["remote", "set-url", remoteName, forkUrl]);
|
||||
log.info(`\u{1F4CC} updated remote '${remoteName}' for fork ${headRepo.full_name}`);
|
||||
log.debug(`\u{1F4CC} updated remote '${remoteName}' for fork ${headRepo.full_name}`);
|
||||
}
|
||||
$("git", ["config", `branch.${headBranch}.pushRemote`, remoteName]);
|
||||
log.info(`\u{1F4CC} configured branch '${headBranch}' to push to '${remoteName}'`);
|
||||
log.debug(`\u{1F4CC} configured branch '${headBranch}' to push to '${remoteName}'`);
|
||||
if (!pr.data.maintainer_can_modify) {
|
||||
log.warning(
|
||||
`\u26A0\uFE0F fork PR has maintainer_can_modify=false - push operations will fail. ask the PR author to enable "Allow edits from maintainers" or the fork may be owned by an organization.`
|
||||
@@ -124201,12 +124201,12 @@ function CreateBranchTool(ctx) {
|
||||
"Branch creation blocked: secrets detected in branch name. Please remove any sensitive information (API keys, tokens, passwords) before creating a branch."
|
||||
);
|
||||
}
|
||||
log.info(`Creating branch ${branchName} from ${resolvedBaseBranch}`);
|
||||
log.debug(`Creating branch ${branchName} from ${resolvedBaseBranch}`);
|
||||
$("git", ["fetch", "origin", resolvedBaseBranch, "--depth=1"]);
|
||||
$("git", ["checkout", "-B", resolvedBaseBranch, `origin/${resolvedBaseBranch}`]);
|
||||
$("git", ["checkout", "-b", branchName]);
|
||||
$("git", ["push", "-u", "origin", branchName]);
|
||||
log.info(`Successfully created and pushed branch ${branchName}`);
|
||||
log.debug(`Successfully created and pushed branch ${branchName}`);
|
||||
return {
|
||||
success: true,
|
||||
branchName,
|
||||
@@ -124250,7 +124250,7 @@ function CommitFilesTool(ctx) {
|
||||
}
|
||||
}
|
||||
const currentBranch = $("git", ["rev-parse", "--abbrev-ref", "HEAD"], { log: false });
|
||||
log.info(`Committing files on branch ${currentBranch}`);
|
||||
log.debug(`Committing files on branch ${currentBranch}`);
|
||||
if (files.length > 0) {
|
||||
$("git", ["add", ...files]);
|
||||
} else {
|
||||
@@ -124258,7 +124258,7 @@ function CommitFilesTool(ctx) {
|
||||
}
|
||||
$("git", ["commit", "-m", message]);
|
||||
const commitSha = $("git", ["rev-parse", "HEAD"], { log: false });
|
||||
log.info(`Successfully committed: ${commitSha.substring(0, 7)}`);
|
||||
log.debug(`Successfully committed: ${commitSha.substring(0, 7)}`);
|
||||
return {
|
||||
success: true,
|
||||
commitSha,
|
||||
@@ -124285,7 +124285,7 @@ function PushBranchTool(_ctx) {
|
||||
} catch {
|
||||
}
|
||||
const args3 = force ? ["push", "--force", "-u", remote, branch] : ["push", "-u", remote, branch];
|
||||
log.info(`pushing branch ${branch} to ${remote}`);
|
||||
log.debug(`pushing branch ${branch} to ${remote}`);
|
||||
if (force) {
|
||||
log.warning(`force pushing - this will overwrite remote history`);
|
||||
}
|
||||
@@ -124542,7 +124542,7 @@ function PullRequestTool(ctx) {
|
||||
parameters: PullRequest,
|
||||
execute: execute(ctx, async ({ title, body, base }) => {
|
||||
const currentBranch = $("git", ["rev-parse", "--abbrev-ref", "HEAD"], { log: false });
|
||||
log.info(`Current branch: ${currentBranch}`);
|
||||
log.debug(`Current branch: ${currentBranch}`);
|
||||
if (containsSecrets(title) || containsSecrets(body)) {
|
||||
throw new Error(
|
||||
"PR creation blocked: secrets detected in PR title or body. Please remove any sensitive information (API keys, tokens, passwords) before creating a PR."
|
||||
|
||||
Reference in New Issue
Block a user