Compare commits

...

3 Commits

Author SHA1 Message Date
ssalbdivad 314f669f10 add debug logging 2025-10-09 19:28:00 -04:00
ssalbdivad a24275e21b bump version 2025-10-09 18:07:42 -04:00
ssalbdivad 872e620342 Revert "try to add debugging to mcp server"
This reverts commit 6d9c6fd2b1.
2025-10-09 18:07:28 -04:00
5 changed files with 12 additions and 65 deletions
-24
View File
@@ -1,4 +1,3 @@
import { readFileSync } from "node:fs";
import { access, constants } from "node:fs/promises";
import * as core from "@actions/core";
import { createMcpConfig } from "../mcp/config.ts";
@@ -193,29 +192,6 @@ function processJSONChunk(chunk: string, agent?: ClaudeAgent): void {
],
])
);
// Check for failed MCP servers and show debug logs
if (parsedChunk.mcp_servers?.length > 0) {
const failedServers = parsedChunk.mcp_servers.filter(
(server: any) => server.status === "failed"
);
if (failedServers.length > 0) {
const failedNames = failedServers.map((server: any) => server.name).join(", ");
// Try to read MCP server debug logs
let debugInfo = "";
try {
const logContent = readFileSync("/tmp/mcp-server.log", "utf-8");
core.error("MCP Server Debug Log:");
core.error(logContent);
debugInfo = " (see debug log above)";
} catch (logError) {
debugInfo = ` (could not read debug log: ${logError instanceof Error ? logError.message : String(logError)})`;
}
throw new Error(`MCP servers failed to start: ${failedNames}${debugInfo}`);
}
}
}
break;
+6 -22
View File
@@ -25500,7 +25500,6 @@ var core4 = __toESM(require_core(), 1);
var core2 = __toESM(require_core(), 1);
// agents/claude.ts
var import_node_fs = require("node:fs");
var import_promises = require("node:fs/promises");
var core = __toESM(require_core(), 1);
@@ -25509,17 +25508,20 @@ var actionPath = process.env.GITHUB_ACTION_PATH || process.cwd();
function createMcpConfig(githubInstallationToken) {
const githubRepository = process.env.GITHUB_REPOSITORY;
if (!githubRepository) {
throw new Error("GITHUB_REPOSITORY environment variable is required for MCP GitHub integration");
throw new Error(
"GITHUB_REPOSITORY environment variable is required for MCP GitHub integration"
);
}
return JSON.stringify(
{
mcpServers: {
minimal_github_comment: {
command: `${actionPath}/mcp/debug-server.sh`,
command: "node",
args: [`${actionPath}/mcp/server.ts`],
env: {
GITHUB_INSTALLATION_TOKEN: githubInstallationToken,
GITHUB_REPOSITORY: githubRepository
GITHUB_REPOSITORY: githubRepository,
LOG_LEVEL: "debug"
}
}
}
@@ -25859,24 +25861,6 @@ function processJSONChunk(chunk, agent) {
]
])
);
if (parsedChunk.mcp_servers?.length > 0) {
const failedServers = parsedChunk.mcp_servers.filter(
(server) => server.status === "failed"
);
if (failedServers.length > 0) {
const failedNames = failedServers.map((server) => server.name).join(", ");
let debugInfo = "";
try {
const logContent = (0, import_node_fs.readFileSync)("/tmp/mcp-server.log", "utf-8");
core.error("MCP Server Debug Log:");
core.error(logContent);
debugInfo = " (see debug log above)";
} catch (logError) {
debugInfo = ` (could not read debug log: ${logError instanceof Error ? logError.message : String(logError)})`;
}
throw new Error(`MCP servers failed to start: ${failedNames}${debugInfo}`);
}
}
}
break;
case "assistant":
+5 -2
View File
@@ -6,18 +6,21 @@ const actionPath = process.env.GITHUB_ACTION_PATH || process.cwd();
export function createMcpConfig(githubInstallationToken: string) {
const githubRepository = process.env.GITHUB_REPOSITORY;
if (!githubRepository) {
throw new Error('GITHUB_REPOSITORY environment variable is required for MCP GitHub integration');
throw new Error(
"GITHUB_REPOSITORY environment variable is required for MCP GitHub integration"
);
}
return JSON.stringify(
{
mcpServers: {
minimal_github_comment: {
command: `${actionPath}/mcp/debug-server.sh`,
command: "node",
args: [`${actionPath}/mcp/server.ts`],
env: {
GITHUB_INSTALLATION_TOKEN: githubInstallationToken,
GITHUB_REPOSITORY: githubRepository,
LOG_LEVEL: "debug",
},
},
},
-16
View File
@@ -1,16 +0,0 @@
#!/bin/bash
# Wrapper script to capture MCP server logs for debugging
LOG_FILE="/tmp/mcp-server.log"
echo "=== MCP Server Debug Wrapper Starting ===" >> "$LOG_FILE"
echo "Timestamp: $(date)" >> "$LOG_FILE"
echo "Working directory: $(pwd)" >> "$LOG_FILE"
echo "Environment variables:" >> "$LOG_FILE"
env | grep -E "(GITHUB_|MCP_|NODE_)" >> "$LOG_FILE"
echo "Node.js version: $(node --version)" >> "$LOG_FILE"
echo "Arguments: $@" >> "$LOG_FILE"
echo "=== Starting MCP Server ===" >> "$LOG_FILE"
# Execute the actual MCP server, capturing both stdout and stderr
exec node "$@" 2>&1 | tee -a "$LOG_FILE"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@pullfrog/action",
"version": "0.0.19",
"version": "0.0.21",
"type": "module",
"files": [
"index.js",