File tree Expand file tree Collapse file tree
src/vs/workbench/contrib/roopik/electron-main/mcp/installer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -169,15 +169,17 @@ export class McpInstaller extends Disposable {
169169 } else if ( agent === 'codex' ) {
170170 // Codex extension - check extension binary
171171 const extPath = this . _platformAdapter ?. getExternalExtensionPath ( CODEX_EXTENSION_ID ) ;
172- installed = ! ! getCodexBinaryPath ( extPath ) ;
172+ installed = ! ! getCodexBinaryPath ( extPath ) || installed ;
173173 registrationMethod = 'cli-command' ;
174174 } else if ( agent === 'codex-cli' ) {
175175 // Codex CLI - check global command
176176 installed = await isCommandAvailable ( 'codex' ) ;
177177 registrationMethod = 'cli-command' ;
178178 }
179179
180- if ( installed ) {
180+ // For CLI-based agents, we can't reliably check registration from config files
181+ // because they manage their own storage locations
182+ if ( installed && registrationMethod !== 'cli-command' ) {
181183 const config = readJsonConfig < { mcpServers ?: Record < string , unknown > } > ( configPath ) ;
182184 registered = isRoopikRegistered ( config ) ;
183185 }
Original file line number Diff line number Diff line change @@ -158,12 +158,14 @@ export function getAgentConfigPath(agent: AiAgent): string {
158158 return path . join ( home , '.gemini' , 'settings.json' ) ;
159159
160160 case 'codex' :
161- // Codex extension uses CLI commands, no config file
162- return path . join ( home , '.codex' , 'mcp.json' ) ;
161+ // Codex extension (uses binary from VS Code extension folder)
162+ // Both extension and CLI share the same config: ~/.codex/config.toml
163+ return path . join ( home , '.codex' , 'config.toml' ) ;
163164
164165 case 'codex-cli' :
165- // Codex CLI uses CLI commands, no config file
166- return path . join ( home , '.codex' , 'mcp.json' ) ;
166+ // Codex global CLI (uses `codex` command in PATH)
167+ // Both extension and CLI share the same config: ~/.codex/config.toml
168+ return path . join ( home , '.codex' , 'config.toml' ) ;
167169
168170 default :
169171 throw new Error ( `Unknown agent: ${ agent } ` ) ;
You can’t perform that action at this time.
0 commit comments