-
Notifications
You must be signed in to change notification settings - Fork 44
MyCoder is not recognizing my config file #397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Issue Triage AnalysisThank you for reporting this issue with MyCoder's configuration handling. I've investigated the problem and found the likely cause of the error you're experiencing. Issue Classification
Root Cause AnalysisThe issue appears to be related to the configuration file format and how environment variables are handled. Here's what's happening:
The problem is likely caused by one of these factors:
Recommended SolutionsTry these solutions in order:
Additional InformationThe error message also indicates:
Please let us know if any of these solutions work for you or if you need further assistance. |
Thanks for the support and for responding so quickly, but even after renaming the configuration file to the one suggested above, the error ANTHROPIC_API_KEY environment variable is not set occurs. This error does not only occur when I pass the parameters in the command. I have been trying to avoid using the official Anthropic and OpenAI APIs, but I wanted to use my Ollama server that is exposed on the internet at https://ollama.sv3.cloud.atla.pro/ollama, with an API Key for authentication, is that possible? I tried using a local proxy solution |
I created a configuration file like this in ~/.config/mycoder, however, it keeps pointing out a configuration error to consume the anthropic api, even though I didn't define the usage as being this:
`
// mycoder.config.js
export default {
// GitHub integration
githubMode: true,
// Browser settings
headless: true,
userSession: false,
// System browser detection settings
browser: {
// Whether to use system browsers or Playwright's bundled browsers
useSystemBrowsers: true,
},
// Model settings
provider: 'openai',
model: 'deepseek-r1:7b',
maxTokens: 4096,
temperature: 0.7,
// Custom settings
// customPrompt can be a string or an array of strings for multiple lines
customPrompt: '',
// Example of multiple line custom prompts:
// customPrompt: [
// 'Custom instruction line 1',
// 'Custom instruction line 2',
// 'Custom instruction line 3',
// ],
profile: false,
// Base URL configuration (for providers that need it)
baseUrl: 'https://ollama.sv3.cloud.atla.pro/ollama', // Example for Ollama
// MCP configuration
mcp: {
servers: [
{
name: 'example',
url: 'https://mcp.example.com',
auth: {
type: 'bearer',
token: 'your-token-here',
},
},
],
defaultResources: ['example://docs/api'],
defaultTools: ['example://tools/search'],
},
};
`
when executing the command:
mycoder "Implement a React component that displays a list of items"
I get the following error:
`[Sentry] You are using Node.js in ESM mode ("import syntax"). The Sentry Node.js SDK is not compatible with ESM in Node.js versions before 18.19.0 or before 20.6.0. Please either build your application with CommonJS ("require() syntax"), or upgrade your Node.js version.
Detected 2 browsers on the system
Available browsers:
GitHub mode is enabled but there are issues with git/gh CLI tools:
GitHub mode requires git and gh CLI tools to be installed.
Please install the missing tools or disable GitHub mode with --githubMode false
An error occurred:
Error: Error calling Anthropic API: 401 {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}}
Error: Error calling Anthropic API: 401 {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}}
at AnthropicProvider.generateText (file:///Users/saviocamacam/.nvm/versions/node/v18.17.1/lib/node_modules/mycoder/node_modules/mycoder-agent/src/core/llm/providers/anthropic.ts:184:13)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at toolAgent (file:///Users/saviocamacam/.nvm/versions/node/v18.17.1/lib/node_modules/mycoder/node_modules/mycoder-agent/src/core/toolAgent/toolAgentCore.ts:142:45)
at executePrompt (file:///Users/saviocamacam/.nvm/versions/node/v18.17.1/lib/node_modules/mycoder/src/commands/$default.ts:187:20)
at Object.handler (file:///Users/saviocamacam/.nvm/versions/node/v18.17.1/lib/node_modules/mycoder/src/commands/$default.ts:280:5)
0
[Token Usage Total] Root: input: 0 cache-writes: 0 cache-reads: 0 output: 0 COST: $0.00
Forcing exit after 5000ms timeout`
The text was updated successfully, but these errors were encountered: