Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/agent/src/core/toolAgent/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,6 @@ export function getDefaultSystemPrompt(toolContext: ToolContext): string {
'When you run into issues or unexpected results, take a step back and read the project documentation and configuration files and look at other source files in the project for examples of what works.',
'',
'Use sub-agents for parallel tasks, providing them with specific context they need rather than having them rediscover it.',
toolContext.customPrompt ? `\n\n${toolContext.customPrompt}` : '',
].join('\n');
}
1 change: 1 addition & 0 deletions packages/agent/src/core/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type ToolContext = {
pageFilter: pageFilter;
tokenTracker: TokenTracker;
githubMode: boolean;
customPrompt?: string;
};

export type Tool<TParams = Record<string, any>, TReturn = any> = {
Expand Down
1 change: 1 addition & 0 deletions packages/agent/src/tools/interaction/subAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export const subAgentTool: Tool<Parameters, ReturnType> = {
const result = await toolAgent(prompt, tools, config, {
...context,
workingDirectory: workingDirectory ?? context.workingDirectory,
customPrompt: context.customPrompt,
});
return { response: result.result };
},
Expand Down
1 change: 0 additions & 1 deletion packages/agent/src/tools/io/textEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ const parameterSchema = z.object({
),
description: z
.string()
.max(80)
.describe('The reason you are using the text editor (max 80 chars)'),
});

Expand Down
4 changes: 4 additions & 0 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ mycoder --modelProvider openai --modelName gpt-4o-2024-05-13 "Your prompt here"
- `userSession`: Use user's existing browser session instead of sandboxed session (default: `false`)
- `pageFilter`: Method to process webpage content: 'simple', 'none', or 'readability' (default: `none`)
- `ollamaBaseUrl`: Base URL for Ollama API (default: `http://localhost:11434/api`)
- `customPrompt`: Custom instructions to append to the system prompt for both main agent and sub-agents (default: `""`)

Example:

Expand All @@ -137,6 +138,9 @@ mycoder config set pageFilter readability

# Set custom Ollama server URL
mycoder config set ollamaBaseUrl http://your-ollama-server:11434/api

# Set custom instructions for the agent
mycoder config set customPrompt "Always prioritize readability and simplicity in your code. Prefer TypeScript over JavaScript when possible."
```

## Environment Variables
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/commands/$default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ export const command: CommandModule<SharedOptions, DefaultArgs> = {
workingDirectory: '.',
tokenTracker,
githubMode: config.githubMode,
customPrompt: config.customPrompt,
});

const output =
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/settings/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const defaultConfig = {
modelProvider: 'anthropic',
modelName: 'claude-3-7-sonnet-20250219',
ollamaBaseUrl: 'http://localhost:11434/api',
customPrompt: '',
};

export type Config = typeof defaultConfig;
Expand Down
Loading