| title | Troubleshooting Agent Customization | |||
|---|---|---|---|---|
| section | agents | |||
| tags |
|
|||
| order | 5 |
Quick fixes for common agent customization issues.
- Restart Codebuff to reload templates
- Check JSON syntax:
cat your-agent-file.json | jq - Verify file paths are relative to project root
- Ensure
"override": trueis set for overrides
Error: Agent 'my-custom-agent' not found
Fix: Check agent ID spelling, file location (.agents/templates/), JSON syntax (cat file.json | jq)
Validation error: spawnableAgents contains invalid agent 'researcher-typo'
Fix: Check spelling against built-in agents list, use exact IDs
Error: Cannot resolve prompt file './my-prompt.md'
Causes:
- File doesn't exist at specified path
- Incorrect relative path resolution
- File permissions issue
Solutions:
- Use paths relative to project root:
.agents/templates/my-prompt.md - Verify file exists:
ls -la .agents/templates/my-prompt.md - Check file permissions are readable
{
"systemPrompt": {
"type": "add", // ❌ Invalid
"content": "..."
}
}Fix: Use valid override types:
{
"systemPrompt": {
"type": "append", // ✅ Valid: append, prepend, replace
"content": "..."
}
}{
"id": "my-agent",
"override": false,
"displayName": "My Agent"
// ❌ Missing required fields for new agents
}Fix: Include all required fields for new agents:
{
"id": "my-agent",
"version": "1.0.0",
"override": false,
"displayName": "My Agent",
"purpose": "Brief description of the agent's purpose",
"model": "anthropic/claude-4-sonnet-20250522",
"systemPrompt": "You are a helpful assistant...",
"instructionsPrompt": "Process the user's request...",
"stepPrompt": "Continue working on the task..."
}Fix: Use project root relative paths: .agents/templates/my-prompt.md, verify file exists
Symptoms:
- Agent behaves like default version
- Custom instructions ignored
Debug Steps:
- Check override is properly applied:
# Restart Codebuff to reload templates
codebuff- Verify override syntax:
{
"id": "CodebuffAI/reviewer", // ✅ Exact match required
"override": true, // ✅ Must be true for overrides
"systemPrompt": {
"type": "append", // ✅ Valid override type
"content": "Custom instructions..."
}
}Symptoms:
- Unexpected agents being created
- Missing expected specialized agents
Solutions:
- Check
spawnableAgentsconfiguration:
{
"spawnableAgents": {
"type": "replace", // Use "replace" to override completely
"content": ["researcher", "thinker"]
}
}- Verify agent names are correct (no typos)
Causes:
- Complex prompts causing slow generation
- Too many tools enabled
- Large context from message history
Solutions:
- Simplify prompts and remove unnecessary instructions
- Limit
toolNamesto only required tools - Set
includeMessageHistory: falsefor stateless agents - Use faster models for simple tasks:
{
"model": "anthropic/claude-3-5-haiku-20241022" // Faster model
}Causes:
- Using expensive models unnecessarily
- Agents spawning too many sub-agents
- Large context windows
Solutions:
- Use cost-effective models:
{
"model": "google/gemini-2.5-flash" // More economical
}- Limit spawnable agents:
{
"spawnableAgents": [] // Prevent sub-agent spawning
}Symptoms:
- No custom agents available
- Validation errors on startup
Debug Steps:
- Check directory structure:
your-project/
├── .agents/
│ ├── my-agent.json
│ └── my-prompts.md- Verify file permissions:
ls -la .agents/templates/- Check for hidden characters or encoding issues:
file .agents/templates/*.jsonBegin with minimal overrides and add complexity gradually:
{
"id": "CodebuffAI/reviewer",
"override": true,
"model": "anthropic/claude-4-sonnet-20250522"
}- JSON validator:
cat file.json | jq - File existence:
ls -la .agents/templates/ - Syntax check: Most editors highlight JSON errors
Restart Codebuff to see validation errors:
codebuff # Look for error messages on startupAdd one override at a time to isolate issues:
- Test basic override (model change)
- Add simple prompt override
- Add external file reference
- Add tool modifications
Track your agent templates in git to easily revert problematic changes:
git add .agents/
git commit -m "Add custom reviewer agent"If you're still experiencing issues:
- Check the logs: Look for specific error messages when starting Codebuff
- Simplify: Remove customizations until it works, then add back gradually
- Community: Join our Discord for real-time help
- Documentation: Review the Agent Reference for complete field descriptions
"append"- Add to existing content"prepend"- Add before existing content"replace"- Replace entire content
id,version,override: falsedisplayName,purpose,modelsystemPrompt,instructionsPrompt,stepPrompt
- Agent templates:
.agents/templates/*.json - External prompts:
.agents/templates/*.md - Project root:
./(for absolute paths)