From f3f2051c4531b2fe6793a15921d3623d2869b068 Mon Sep 17 00:00:00 2001 From: catlog22 Date: Mon, 22 Dec 2025 10:16:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=92=8C=E5=85=A8=E5=B1=80=E9=85=8D=E7=BD=AE=E7=9A=84=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E9=80=BB=E8=BE=91=EF=BC=8C=E6=B7=BB=E5=8A=A0Codex?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .claude/CLAUDE.md | 6 +++- .../dashboard-js/views/mcp-manager.js | 34 ++++++++++++++++--- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index b40d45b4..e94d6fb7 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -3,4 +3,8 @@ - **CLI Tools Usage**: @~/.claude/workflows/cli-tools-usage.md - **Coding Philosophy**: @~/.claude/workflows/coding-philosophy.md - **Context Requirements**: @~/.claude/workflows/context-tools.md -- **File Modification**: @~/.claude/workflows/file-modification.md \ No newline at end of file +- **File Modification**: @~/.claude/workflows/file-modification.md + +## Agent Execution + +- **Always use `run_in_background = false`** for Task tool agent calls to ensure synchronous execution and immediate result visibility \ No newline at end of file diff --git a/ccw/src/templates/dashboard-js/views/mcp-manager.js b/ccw/src/templates/dashboard-js/views/mcp-manager.js index fb0a5c70..af4302c4 100644 --- a/ccw/src/templates/dashboard-js/views/mcp-manager.js +++ b/ccw/src/templates/dashboard-js/views/mcp-manager.js @@ -42,17 +42,41 @@ function getCcwEnabledToolsCodex() { // Get current CCW_PROJECT_ROOT from config function getCcwProjectRoot() { + // Try project config first, then global config const currentPath = projectPath; const projectData = mcpAllProjects[currentPath] || {}; - const ccwConfig = projectData.mcpServers?.['ccw-tools']; - return ccwConfig?.env?.CCW_PROJECT_ROOT || ''; + const projectCcwConfig = projectData.mcpServers?.['ccw-tools']; + if (projectCcwConfig?.env?.CCW_PROJECT_ROOT) { + return projectCcwConfig.env.CCW_PROJECT_ROOT; + } + // Fallback to global config + const globalCcwConfig = mcpUserServers?.['ccw-tools']; + return globalCcwConfig?.env?.CCW_PROJECT_ROOT || ''; } // Get current CCW_ALLOWED_DIRS from config function getCcwAllowedDirs() { + // Try project config first, then global config const currentPath = projectPath; const projectData = mcpAllProjects[currentPath] || {}; - const ccwConfig = projectData.mcpServers?.['ccw-tools']; + const projectCcwConfig = projectData.mcpServers?.['ccw-tools']; + if (projectCcwConfig?.env?.CCW_ALLOWED_DIRS) { + return projectCcwConfig.env.CCW_ALLOWED_DIRS; + } + // Fallback to global config + const globalCcwConfig = mcpUserServers?.['ccw-tools']; + return globalCcwConfig?.env?.CCW_ALLOWED_DIRS || ''; +} + +// Get current CCW_PROJECT_ROOT from Codex config +function getCcwProjectRootCodex() { + const ccwConfig = codexMcpServers?.['ccw-tools']; + return ccwConfig?.env?.CCW_PROJECT_ROOT || ''; +} + +// Get current CCW_ALLOWED_DIRS from Codex config +function getCcwAllowedDirsCodex() { + const ccwConfig = codexMcpServers?.['ccw-tools']; return ccwConfig?.env?.CCW_ALLOWED_DIRS || ''; } @@ -260,7 +284,7 @@ async function renderMcpManager() { + value="${getCcwProjectRootCodex()}">