Fix Codex config detection scope#1214
Conversation
📝 WalkthroughWalkthrough
ChangesCodex Multi-Path Config, Unregistration, and Startup Rewrite
Sequence Diagram(s)sequenceDiagram
participant StartupConfigRewrite
participant CodexMcpConfigurator
participant CodexConfigHelper
participant McpConfigurationHelper
StartupConfigRewrite->>CodexMcpConfigurator: CheckStatus(attemptAutoRewrite: false)
CodexMcpConfigurator->>CodexMcpConfigurator: GetCandidateConfigPaths()
CodexMcpConfigurator-->>StartupConfigRewrite: diskStatus
alt diskStatus is VersionMismatch or IncorrectPath
StartupConfigRewrite->>CodexMcpConfigurator: CheckStatus(attemptAutoRewrite: true)
CodexMcpConfigurator->>McpConfigurationHelper: ConfigureCodexClient(path, client)
McpConfigurationHelper-->>CodexMcpConfigurator: result
CodexMcpConfigurator-->>StartupConfigRewrite: updated status
end
Note over StartupConfigRewrite: Unregister flow (user-driven)
StartupConfigRewrite->>CodexMcpConfigurator: Unregister()
CodexMcpConfigurator->>CodexConfigHelper: RemoveCodexServerBlock(toml)
CodexConfigHelper-->>CodexMcpConfigurator: updated TOML, removed=true
CodexMcpConfigurator->>CodexMcpConfigurator: write updated TOML, set NotConfigured
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
MCPForUnity/Editor/Clients/McpClientConfiguratorBase.cs (1)
695-701: 💤 Low valueConsider extracting
GetClientProjectDir()to the base class.This method is nearly identical to
ClaudeCliMcpConfigurator.GetClientProjectDir()(lines 724-730). Both use the same EditorPrefs override pattern with the same fallback.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@MCPForUnity/Editor/Clients/McpClientConfiguratorBase.cs` around lines 695 - 701, The GetClientProjectDir() method exists as a duplicate in both the McpClientConfiguratorBase class and the ClaudeCliMcpConfigurator class with identical implementations using the same EditorPrefs override pattern. Remove the duplicate GetClientProjectDir() method from ClaudeCliMcpConfigurator class (around lines 724-730) and ensure the base class version in McpClientConfiguratorBase is accessible to derived classes by making it protected instead of private, so the derived class can inherit and use the same implementation without duplication.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@MCPForUnity/Editor/Clients/McpClientConfiguratorBase.cs`:
- Around line 695-701: The GetClientProjectDir() method exists as a duplicate in
both the McpClientConfiguratorBase class and the ClaudeCliMcpConfigurator class
with identical implementations using the same EditorPrefs override pattern.
Remove the duplicate GetClientProjectDir() method from ClaudeCliMcpConfigurator
class (around lines 724-730) and ensure the base class version in
McpClientConfiguratorBase is accessible to derived classes by making it
protected instead of private, so the derived class can inherit and use the same
implementation without duplication.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2a70fad1-8aad-4dae-a3e6-8695134c991a
📒 Files selected for processing (3)
MCPForUnity/Editor/Clients/McpClientConfiguratorBase.csMCPForUnity/Editor/Helpers/CodexConfigHelper.csMCPForUnity/Editor/Services/StartupConfigRewrite.cs
Summary
Test Plan
Summary by CodeRabbit
New Features
Improvements