Skip to content

Commit 6aed18d

Browse files
committed
Add thinker-with-files-gemini, which is cheaper since has no context except prompt + passed in files
1 parent 91516e6 commit 6aed18d

File tree

3 files changed

+69
-5
lines changed

3 files changed

+69
-5
lines changed

agents/base2/base2.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export function createBase2(
8787
isFree && 'code-reviewer-lite',
8888
isDefault && 'code-reviewer',
8989
isMax && 'code-reviewer-multi-prompt',
90-
isFree && 'thinker-gemini',
90+
isFree && 'thinker-with-files-gemini',
9191
'thinker-gpt',
9292
'context-pruner',
9393
),
@@ -143,7 +143,7 @@ Use the spawn_agents tool to spawn specialized agents to help you complete the u
143143
${buildArray(
144144
'- Spawn context-gathering agents (file pickers and web/docs researchers) before making edits. Use the code_search, list_directory, and glob tools directly for searching and exploring the codebase.',
145145
isFree && 'Do not spawn the thinker-gpt agent, unless the user asks. Not everyone has connected their ChatGPT subscription to Codebuff to allow for it.',
146-
isFree && 'You must spawn the thinker-gemini agent to think through and plan the reponse to most requests, unless the request is trivial. This agent is extremely useful as it is very smart!',
146+
isFree && 'You must spawn the thinker-with-files-gemini agent to think through and plan the reponse to most requests, unless the request is trivial. This agent is extremely useful as it is very smart! You must pass the relevant filePaths when spawning it, since it does not have access to the conversation history.',
147147
isDefault &&
148148
'- Spawn the editor agent to implement the changes after you have gathered all the context you need.',
149149
(isDefault || isMax) &&
@@ -206,7 +206,7 @@ ${buildArray(
206206
[ You read a few other relevant files using the read_files tool ]${!noAskUser
207207
? `\n\n[ You ask the user for important clarifications on their request or alternate implementation strategies using the ask_user tool ]`
208208
: ''
209-
}${isFree ? `\n\n[ You spawn the thinker-gemini agent to plan the best response ]` : ''}
209+
}${isFree ? `\n\n[ You spawn the thinker-with-files-gemini agent with the relevant filePaths to plan the best response ]` : ''}
210210
${isDefault
211211
? `[ You implement the changes using the editor agent ]`
212212
: isFast || isFree
@@ -334,7 +334,7 @@ ${buildArray(
334334
(isDefault || isMax) &&
335335
`- For any task requiring 3+ steps, use the write_todos tool to write out your step-by-step implementation plan. Include ALL of the applicable tasks in the list.${isFast ? '' : ' You should include a step to review the changes after you have implemented the changes.'}:${hasNoValidation ? '' : ' You should include at least one step to validate/test your changes: be specific about whether to typecheck, run tests, run lints, etc.'} You may be able to do reviewing and validation in parallel in the same step. Skip write_todos for simple tasks like quick edits or answering questions.`,
336336
isFree &&
337-
`- For most requests, spawn the thinker-gemini agent to think through and plan the best response. This agent is extremely useful as it is very smart. You must take advantage of it and spawn it about once per user request. Gather all the necessary context *before* spawning the thinker-gemini agent.`,
337+
`- For most requests, spawn the thinker-with-files-gemini agent to think through and plan the best response. This agent is extremely useful as it is very smart. You must take advantage of it and spawn it about once per user request. Gather all the necessary context *before* spawning it, and pass the relevant filePaths since it does not have access to the conversation history.`,
338338
(isDefault || isMax) &&
339339
`- For quick problems, briefly explain your reasoning to the user. If you need to think longer, write your thoughts within the <think> tags. Finally, for complex problems, spawn the thinker agent to help find the best solution. (gpt-5-agent is a last resort for complex problems)`,
340340
isDefault &&
@@ -380,7 +380,7 @@ function buildImplementationStepPrompt({
380380
`Keep working until the user's request is completely satisfied${!hasNoValidation ? ' and validated' : ''}, or until you require more information from the user.`,
381381
'You must use the skill tool to load any potentially relevant skills.',
382382
isFree &&
383-
`You must spawn the thinker-gemini agent once per user request to plan the best response.`,
383+
`You must spawn the thinker-with-files-gemini agent once per user request to plan the best response. Pass the relevant filePaths since it does not have access to the conversation history.`,
384384
isMax &&
385385
`You must spawn the 'editor-multi-prompt' agent to implement code changes rather than using the str_replace or write_file tools, since it will generate the best code changes.`,
386386
(isDefault || isMax) &&
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import { publisher } from '../constants'
2+
3+
import type { SecretAgentDefinition } from '../types/secret-agent-definition'
4+
5+
const definition: SecretAgentDefinition = {
6+
id: 'thinker-with-files-gemini',
7+
publisher,
8+
model: 'google/gemini-3.1-pro-preview',
9+
displayName: 'Theo the Theorizer with Files (Gemini)',
10+
reasoningOptions: {
11+
effort: 'low',
12+
},
13+
spawnerPrompt:
14+
'Does deep thinking given the prompt and provided files using Gemini. Use this to help you solve a specific problem. This agent has no context on the conversation history so it cannot see files you have read or previous discussion. Instead, you must provide all the relevant context via the prompt or filePaths for this agent to work well.',
15+
inputSchema: {
16+
prompt: {
17+
type: 'string',
18+
description: 'The problem you are trying to solve',
19+
},
20+
params: {
21+
type: 'object',
22+
properties: {
23+
filePaths: {
24+
type: 'array',
25+
items: {
26+
type: 'string',
27+
description: 'The path to a file',
28+
},
29+
description:
30+
'A list of relevant file paths to read before thinking. Try to provide ALL the files that could be relevant to your request.',
31+
},
32+
},
33+
required: ['filePaths'],
34+
},
35+
},
36+
outputMode: 'last_message',
37+
outputSchema: undefined,
38+
includeMessageHistory: false,
39+
inheritParentSystemPrompt: false,
40+
spawnableAgents: [],
41+
toolNames: [],
42+
43+
instructionsPrompt: `You are the thinker-with-files-gemini agent. Think about the user request and when satisfied, write out a very concise response that captures the most important points. DO NOT be verbose -- say the absolute minimum needed to answer the user's question correctly.
44+
45+
The parent agent will see your response. DO NOT call any tools. No need to spawn the thinker agent, because you are already the thinker agent. Just do the thinking work now.`,
46+
47+
handleSteps: function* ({ params }) {
48+
const filePaths = params?.filePaths as string[] | undefined
49+
50+
if (filePaths && filePaths.length > 0) {
51+
yield {
52+
toolName: 'read_files',
53+
input: { paths: filePaths },
54+
}
55+
}
56+
57+
yield 'STEP'
58+
},
59+
}
60+
61+
export default definition

common/src/constants/free-agents.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ export const FREE_MODE_AGENT_MODELS: Record<string, Set<string>> = {
3737

3838
// Code reviewer for free mode
3939
'code-reviewer-lite': new Set(['minimax/minimax-m2.5']),
40+
41+
// Thinker for free mode
42+
'thinker-with-files-gemini': new Set(['google/gemini-3.1-pro-preview']),
4043
}
4144

4245
/**

0 commit comments

Comments
 (0)