You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an issue with how MyCoder loads configuration files, specifically when a user configures OpenAI as the provider in ~/.config/mycoder/config.js but the tool still attempts to use Anthropic API.
Investigation Findings
After examining the codebase, I have found the following:
Configuration Loading Mechanism:
MyCoder uses the c12 library to load configuration from multiple locations
The configuration search order is defined in packages/cli/src/settings/config.ts
The default provider is set to "anthropic" in the default configuration
API Key Handling:
API keys are loaded from environment variables based on the provider
The CLI checks for API keys in packages/cli/src/commands/$default.ts
Each provider has its own environment variable (ANTHROPIC_API_KEY, OPENAI_API_KEY)
Potential Issue:
When loading config from ~/.config/mycoder/config.js, it may not be properly merged with CLI options
The provider selection might be overridden by the default value or CLI arguments
Steps to Reproduce
Create a config file at ~/.config/mycoder/config.js with provider: "openai"
Run MyCoder without specifying a provider in the command line
Observe that it still tries to use Anthropic API
Possible Solutions
Add more debug logging to show which configuration files are being loaded and the merged configuration
Verify the priority order of configuration sources is being respected
Check if there is an issue with the c12 library configuration loading
Add a CLI flag to explicitly show the active configuration that is being used
Description
There is an issue with how MyCoder loads configuration files, specifically when a user configures OpenAI as the provider in
~/.config/mycoder/config.js
but the tool still attempts to use Anthropic API.Investigation Findings
After examining the codebase, I have found the following:
Configuration Loading Mechanism:
c12
library to load configuration from multiple locationspackages/cli/src/settings/config.ts
API Key Handling:
packages/cli/src/commands/$default.ts
Potential Issue:
~/.config/mycoder/config.js
, it may not be properly merged with CLI optionsSteps to Reproduce
~/.config/mycoder/config.js
withprovider: "openai"
Possible Solutions
c12
library configuration loadingRelated Files
/packages/cli/src/settings/config.ts
- Configuration loading/packages/cli/src/commands/$default.ts
- API key handling/packages/agent/src/core/llm/provider.ts
- Provider configuration/packages/cli/src/index.ts
- Main entry point with dotenv loadingWould appreciate help from anyone who can test this locally or has encountered similar issues.
The text was updated successfully, but these errors were encountered: