From 0c533aaff5c6416d283ae948646517b2f7762827 Mon Sep 17 00:00:00 2001 From: km-anthropic Date: Mon, 11 Aug 2025 16:17:01 -0700 Subject: [PATCH] Fix: Pass GitHub token to MCP servers in agent mode The token was being obtained successfully but not outputted from the prepare step for use in later steps. Added explicit output of the GitHub token and debug logging. --- src/entrypoints/prepare.ts | 1 + src/modes/agent/index.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/entrypoints/prepare.ts b/src/entrypoints/prepare.ts index d485f82..ab71c9e 100644 --- a/src/entrypoints/prepare.ts +++ b/src/entrypoints/prepare.ts @@ -56,6 +56,7 @@ async function run() { mode, githubToken, }); + core.setOutput("GITHUB_TOKEN", githubToken); // MCP config is handled by individual modes (tag/agent) and included in their claude_args output diff --git a/src/modes/agent/index.ts b/src/modes/agent/index.ts index e9d6ce4..07fe742 100644 --- a/src/modes/agent/index.ts +++ b/src/modes/agent/index.ts @@ -41,6 +41,8 @@ export const agentMode: Mode = { async prepare({ context, githubToken }: ModeOptions): Promise { // Agent mode handles automation events and any event with explicit prompts + + console.log(`Agent mode: githubToken provided: ${!!githubToken}, length: ${githubToken?.length || 0}`); // TODO: handle by createPrompt (similar to tag and review modes) // Create prompt directory