Skip to content

Commit 8e6f5ef

Browse files
charleslienbrandonkachencodebuff-team
authored
gpt 5 (#232)
Co-authored-by: brandonkachen <brandonchenjiacheng@gmail.com> Co-authored-by: Codebuff <noreply@codebuff.com>
1 parent 2f02f1f commit 8e6f5ef

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

backend/src/templates/agent-list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const agentTemplates: Record<AgentTemplateType | string, AgentTemplate> =
2222
{
2323
[AgentTemplateTypes.base]: {
2424
id: AgentTemplateTypes.base,
25-
...base(models.openrouter_claude_sonnet_4),
25+
...base('openai/gpt-5'),
2626
},
2727
[AgentTemplateTypes.base_lite]: {
2828
id: AgentTemplateTypes.base_lite,

backend/src/templates/base-prompts.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,22 @@ Messages from the system are surrounded by <system>${closeXml('system')} or <sys
8484
- Create an impressive demonstration showcasing web development capabilities
8585
8686
- **Don't summarize your changes** Omit summaries as much as possible. Be extremely concise when explaining the changes you made. There's no need to write a long explanation of what you did. Keep it to 1-2 two sentences max.
87-
- **Ending Your Response:** Your aim should be to completely fulfill the user's request before using ending your response. DO NOT END TURN IF YOU ARE STILL WORKING ON THE USER'S REQUEST. If the user's request requires multiple steps, please complete ALL the steps before stopping, even if you have done a lot of work so far.
88-
- **FINALLY, YOU MUST USE THE END TURN TOOL** When you have fully answered the user _or_ you are explicitly waiting for the user's next typed input, always conclude the message with a standalone \`${getToolCallString('end_turn', {})}\` tool call (surrounded by its required blank lines). This should be at the end of your message, e.g.:
87+
- **end_turn:** Use end_turn only when waiting for the user's next input or when the task is fully complete; never immediately after planning or non-final tools (read_files, code_search, spawn_agents, think_deeply, create_plan, add_subgoal, update_subgoal, or diagnostic run_terminal_command).
88+
89+
90+
91+
92+
- **FINALLY, YOU MUST USE THE END TURN TOOL** When you have fully answered the user _or_ you are explicitly waiting for the user's next typed input, always conclude the message with a standalone ${getToolCallString('end_turn', {})} tool call (surrounded by its required blank lines). This should be at the end of your message, e.g.:
8993
<example>
9094
User: Hi
91-
Assisistant: Hello, what can I do for you today?\\n\\n${getToolCallString('end_turn', {})}
95+
Assisistant: Hello, what can I do for you today?\n\n${getToolCallString('end_turn', {})}
9296
${closeXml('example')}
9397
94-
## Verifying Your Changes at the End of Your Response
9598
96-
### User has a \`codebuff.json\`
9799
100+
- **Finally:** When waiting for the user's next input or fully done, end with a standalone ${getToolCallString('end_turn', {})} (with required blank lines); e.g.:
101+
## Verifying Your Changes at the End of Your Response
102+
### User has a \`codebuff.json\`
98103
If the user has a \`codebuff.json\` with the appropriate \`fileChangeHooks\`, there is no need to run any commands.
99104
100105
If the \`fileChangeHooks\` are not configured, inform the user about the \`fileChangeHooks\` parameter.
@@ -224,9 +229,9 @@ export const baseAgentUserInputPrompt = (model: Model) => {
224229
PLACEHOLDER.KNOWLEDGE_FILES_CONTENTS +
225230
'\n\n<system_instructions>' +
226231
buildArray(
227-
'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. Then, finally you must use the end_turn tool at the end of your response. If you have already completed the user request, write nothing at all and end your response.',
232+
'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.',
228233

229-
"If there are multiple ways the user's request could be interpreted that would lead to very different outcomes, ask at least one clarifying question that will help you understand what they are really asking for, and then use the end_turn tool.",
234+
"Ask clarifying questions only when ambiguity would materially change the implementation; otherwise make a reasonable assumption (state it briefly) and proceed, or ask one targeted, non-blocking question. When clarifying, do not spawn the reviewer or other agents yet. Wait for the user's reply so you don't hide information.",
230235

231236
'Use the spawn_agents tool to spawn subagents to help you complete the user request. You can spawn as many subagents as you want.',
232237

@@ -282,7 +287,8 @@ export const baseAgentUserInputPrompt = (model: Model) => {
282287
(isFlash || isGeminiPro) &&
283288
'You must use the spawn_agents tool to spawn subagents to help you complete the user request. You can spawn as many subagents as you want. It is a good idea to spawn a file explorer agent first to explore the codebase. Finally, you must spawn the reviewer agent to review your code changes.',
284289

285-
'Finally, you must use the end_turn tool at the end of your response when you have completed the user request or want the user to respond to your message.',
290+
"Use end_turn only when waiting for the user's next input or fully done; never immediately after planning or non-final tools (read_files, code_search, spawn_agents, think_deeply, create_plan, add_subgoal, update_subgoal, or a non-final run_terminal_command).",
291+
'Never call end_turn immediately after read_files, code_search, spawn_agents, think_deeply, create_plan, add_subgoal, update_subgoal, or a non-final run_terminal_command; keep working or ask one concise question first.',
286292
).join('\n\n') +
287293
closeXml('system_instructions')
288294
)

0 commit comments

Comments
 (0)