add github token to codex
This commit is contained in:
+5
-3
@@ -15,9 +15,9 @@ export const codex = agent({
|
||||
executablePath: "bin/codex.js",
|
||||
});
|
||||
},
|
||||
run: async ({ prompt, mcpServers, apiKey, cliPath }) => {
|
||||
run: async ({ prompt, mcpServers, apiKey, cliPath, githubInstallationToken }) => {
|
||||
process.env.OPENAI_API_KEY = apiKey;
|
||||
|
||||
process.env.GITHUB_INSTALLATION_TOKEN = githubInstallationToken;
|
||||
// Configure MCP servers for Codex (global config is fine - not part of repo)
|
||||
if (mcpServers && Object.keys(mcpServers).length > 0) {
|
||||
configureMcpServers({ mcpServers, apiKey, cliPath });
|
||||
@@ -192,13 +192,15 @@ function configureMcpServers({
|
||||
const envVars = serverConfig.env || {};
|
||||
|
||||
// Build the codex mcp add command with proper argument handling
|
||||
const addArgs = ["mcp", "add", serverName, "--", command, ...args];
|
||||
const addArgs = ["mcp", "add", serverName];
|
||||
|
||||
// Add environment variables as --env flags
|
||||
for (const [key, value] of Object.entries(envVars)) {
|
||||
addArgs.push("--env", `${key}=${value}`);
|
||||
}
|
||||
|
||||
addArgs.push("--", command, ...args);
|
||||
|
||||
log.info(`Adding MCP server '${serverName}'...`);
|
||||
const addResult = spawnSync("node", [cliPath, ...addArgs], {
|
||||
stdio: "pipe",
|
||||
|
||||
@@ -28177,7 +28177,7 @@ var schema = ark.schema;
|
||||
var define2 = ark.define;
|
||||
var declare = ark.declare;
|
||||
|
||||
// ../node_modules/.pnpm/@anthropic-ai+claude-agent-sdk@0.1.37_zod@4.1.12/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs
|
||||
// ../node_modules/.pnpm/@anthropic-ai+claude-agent-sdk@0.1.37_zod@3.25.76/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs
|
||||
import { join as join3 } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
import { setMaxListeners } from "events";
|
||||
@@ -41425,7 +41425,7 @@ var messageHandlers = {
|
||||
// agents/codex.ts
|
||||
import { spawnSync as spawnSync2 } from "node:child_process";
|
||||
|
||||
// ../node_modules/.pnpm/@openai+codex-sdk@0.58.0/node_modules/@openai/codex-sdk/dist/index.js
|
||||
// ../node_modules/.pnpm/@openai+codex-sdk@0.57.0/node_modules/@openai/codex-sdk/dist/index.js
|
||||
import { promises as fs2 } from "fs";
|
||||
import os from "os";
|
||||
import path2 from "path";
|
||||
@@ -41759,8 +41759,9 @@ var codex = agent({
|
||||
executablePath: "bin/codex.js"
|
||||
});
|
||||
},
|
||||
run: async ({ prompt, mcpServers, apiKey, cliPath }) => {
|
||||
run: async ({ prompt, mcpServers, apiKey, cliPath, githubInstallationToken }) => {
|
||||
process.env.OPENAI_API_KEY = apiKey;
|
||||
process.env.GITHUB_INSTALLATION_TOKEN = githubInstallationToken;
|
||||
if (mcpServers && Object.keys(mcpServers).length > 0) {
|
||||
configureMcpServers({ mcpServers, apiKey, cliPath });
|
||||
}
|
||||
@@ -41902,10 +41903,11 @@ function configureMcpServers({
|
||||
const command = serverConfig.command;
|
||||
const args2 = serverConfig.args || [];
|
||||
const envVars = serverConfig.env || {};
|
||||
const addArgs = ["mcp", "add", serverName, "--", command, ...args2];
|
||||
const addArgs = ["mcp", "add", serverName];
|
||||
for (const [key, value2] of Object.entries(envVars)) {
|
||||
addArgs.push("--env", `${key}=${value2}`);
|
||||
}
|
||||
addArgs.push("--", command, ...args2);
|
||||
log.info(`Adding MCP server '${serverName}'...`);
|
||||
const addResult = spawnSync2("node", [cliPath, ...addArgs], {
|
||||
stdio: "pipe",
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
add a comment to https://github.com/pullfrogai/scratch/issues/21
|
||||
add a comment to https://github.com/pullfrogai/scratch/issues/21 and say Shawn > David
|
||||
|
||||
+5909
-6765
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user