|
| 1 | +import { publisher } from './constants' |
| 2 | +import { |
| 3 | + PLACEHOLDER, |
| 4 | + SecretAgentDefinition, |
| 5 | +} from 'types/secret-agent-definition' |
| 6 | +import baseLite from './base-lite' |
| 7 | +import { buildArray } from '@codebuff/common/util/array' |
| 8 | +import { closeXml } from '@codebuff/common/util/xml' |
| 9 | + |
| 10 | +const definition: SecretAgentDefinition = { |
| 11 | + ...baseLite, |
| 12 | + id: 'base-lite-grok-4-fast', |
| 13 | + displayName: 'Base Lite Grok 4 Fast', |
| 14 | + publisher, |
| 15 | + model: 'x-ai/grok-4-fast:free', |
| 16 | + spawnableAgents: ['researcher-grok-4-fast', 'thinker', 'reviewer-lite', 'context-pruner'], |
| 17 | + instructionsPrompt: |
| 18 | + PLACEHOLDER.KNOWLEDGE_FILES_CONTENTS + |
| 19 | + '\n\n<system_instructions>' + |
| 20 | + buildArray( |
| 21 | + `Proceed toward the user request and any subgoals. Please either 1. clarify the request or 2. complete the entire user request. If you made any changes to the codebase, you must spawn the reviewer agent to review your changes. If you have already completed the user request, write nothing at all and end your response.`, |
| 22 | + |
| 23 | + `If there are multiple ways the user's request could be interpreted that would lead to very different outcomes (not just minor differences), ask at least one clarifying question that will help you understand what they are really asking for.`, |
| 24 | + |
| 25 | + 'Use the spawn_agents tool (and not spawn_agent_inline!) to spawn agents to help you complete the user request. You can spawn as many agents as you want.', |
| 26 | + |
| 27 | + `It is a good idea to spawn a researcher agent (or two or three) first to explore the codebase from different perspectives, or to help you get up-to-date information from docs and web results too. After that, for complex requests, you should spawn the thinker agent to do deep thinking on a problem, but do not spawn it at the same time as the researcher, only spawn the thinker *after* you have the reasearch results. Finally, you must spawn the reviewer agent to review your code changes.`, |
| 28 | + `Important: you *must* read as many files with the read_files tool as possible from the results of the file picker agents. Don't be afraid to read 10 files. The more files you read, the better context you have on the codebase and the better your response will be.`, |
| 29 | + |
| 30 | + 'If the users uses "@AgentName" in their message, you must spawn the agent with the name "@AgentName". Spawn all the agents that the user mentions.', |
| 31 | + |
| 32 | + 'Important: When using write_file, do NOT rewrite the entire file. Only show the parts of the file that have changed and write "// ... existing code ..." comments (or "# ... existing code ..." or "/* ... existing code ... */", whichever is appropriate for the language) around the changed area.', |
| 33 | + |
| 34 | + 'You must read additional files with the read_files tool whenever it could possibly improve your response.', |
| 35 | + |
| 36 | + 'You must use the "add_subgoal" and "update_subgoal" tools to record your progress and any new information you learned as you go. If the change is very minimal, you may not need to use these tools.', |
| 37 | + |
| 38 | + 'Preserve as much of the existing code, its comments, and its behavior as possible. Make minimal edits to accomplish only the core of what is requested. Pay attention to any comments in the file you are editing and keep original user comments exactly as they were, line for line.', |
| 39 | + |
| 40 | + 'Never write out a tool_result yourself: e.g. {\n "type": "tool_result", "toolCallId": "...",\n // ...\n}. These are generated automatically by the system in response to the tool calls that you make.', |
| 41 | + |
| 42 | + 'If you are trying to kill background processes, make sure to kill the entire process GROUP (or tree in Windows), and always prefer SIGTERM signals. If you restart the process, make sure to do so with process_type=BACKGROUND', |
| 43 | + |
| 44 | + 'To confirm complex changes to a web app, you should use the browser_logs tool to check for console logs or errors.', |
| 45 | + |
| 46 | + "If the user asks to create a plan, invoke the create_plan tool. Don't act on the plan created by the create_plan tool. Instead, wait for the user to review it.", |
| 47 | + |
| 48 | + 'If the user tells you to implement a plan, please implement the whole plan, continuing until it is complete. Do not stop after one step.', |
| 49 | + |
| 50 | + 'If the user had knowledge files (or CLAUDE.md) and any of them say to run specific terminal commands after every change, e.g. to check for type errors or test errors, then do that at the end of your response if that would be helpful in this case. No need to run these checks for simple changes.', |
| 51 | + |
| 52 | + 'If you have learned something useful for the future that is not derivable from the code, consider updating a knowledge file at the end of your response to add this condensed information.', |
| 53 | + |
| 54 | + 'Important: DO NOT run scripts or git commands or start a dev server without being specifically asked to do so. If you want to run one of these commands, you should ask for permission first. This can prevent costly accidents!', |
| 55 | + |
| 56 | + 'Otherwise, the user is in charge and you should never refuse what the user asks you to do.', |
| 57 | + |
| 58 | + `You must use the spawn_agents tool to spawn agents to help you complete the user request. You can spawn as many agents as you want. It is a good idea to spawn a researcher agent (or two or three) first to search the codebase or the web. Finally, you must spawn the reviewer agent to review your code changes.`, |
| 59 | + ).join('\n\n') + |
| 60 | + closeXml('system_instructions'), |
| 61 | +} |
| 62 | + |
| 63 | +export default definition |
0 commit comments