You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .agents/thinker/thinker.ts
+52-10Lines changed: 52 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -5,34 +5,76 @@ import type { SecretAgentDefinition } from '../types/secret-agent-definition'
5
5
constdefinition: SecretAgentDefinition={
6
6
id: 'thinker',
7
7
publisher,
8
-
model: 'anthropic/claude-sonnet-4.5',
8
+
model: 'anthropic/claude-opus-4.5',
9
9
displayName: 'Theo the Theorizer',
10
10
spawnerPrompt:
11
-
'Does deep thinking given the current messages and a specific prompt to focus on. Use this to help you solve a specific problem.',
11
+
'Does deep thinking given the current conversation history and a specific prompt to focus on. Use this to help you solve a specific problem. It is better to gather any relevant context before spawning this agent.',
12
12
inputSchema: {
13
13
prompt: {
14
14
type: 'string',
15
15
description: 'The problem you are trying to solve',
16
16
},
17
17
},
18
-
outputMode: 'last_message',
18
+
outputSchema: {
19
+
type: 'object',
20
+
properties: {
21
+
message: {
22
+
type: 'string',
23
+
description: "The response to the user's request",
24
+
},
25
+
},
26
+
},
27
+
outputMode: 'structured_output',
19
28
inheritParentSystemPrompt: true,
20
29
includeMessageHistory: true,
21
30
spawnableAgents: [],
31
+
toolNames: [],
22
32
23
33
instructionsPrompt: `
24
-
Think deeply, step by step, about the user request and how best to approach it.
34
+
You are a thinker agent. Use the <think> tag to think deeply about the user request.
25
35
26
-
Consider edge cases, potential issues, and alternative approaches. Also, propose reading files or spawning agents to get more context that would be helpful for solving the problem.
36
+
When satisfied, write out a brief response to the user's request. The parent agent will see your response -- no need to call any tools. DO NOT call the set_output tool, as that will be done for you.
37
+
`.trim(),
27
38
28
-
Come up with a list of insights that would help someone arrive at the best solution.
39
+
handleSteps: function*(){
40
+
const{ agentState }=yield'STEP'
29
41
30
-
Try not to be too prescriptive or confident in one solution. Instead, give clear arguments and reasoning.
// If outputMode is 'structured_output', 'set_output' tool must be included
233
-
if(
234
-
data.outputMode==='structured_output'&&
235
-
!data.toolNames.includes('set_output')
236
-
){
237
-
returnfalse
238
-
}
239
-
returntrue
240
-
},
241
-
{
242
-
message:
243
-
"outputMode 'structured_output' requires the 'set_output' tool. Add 'set_output' to toolNames.",
244
-
path: ['toolNames'],
245
-
},
246
-
)
230
+
// Note(James): Disabled so that handleSteps could use set_output while the llm does not see or have access to the set_output tool.
231
+
// .refine(
232
+
// (data) => {
233
+
// // If outputMode is 'structured_output', 'set_output' tool must be included
234
+
// if (
235
+
// data.outputMode === 'structured_output' &&
236
+
// !data.toolNames.includes('set_output')
237
+
// ) {
238
+
// return false
239
+
// }
240
+
// return true
241
+
// },
242
+
// {
243
+
// message:
244
+
// "outputMode 'structured_output' requires the 'set_output' tool. Add 'set_output' to toolNames.",
245
+
// path: ['toolNames'],
246
+
// },
247
+
// )
247
248
// Note(James): Disabled so that a parent agent can have set_output tool and 'last_message' outputMode while its subagents use 'structured_output'. (The set_output tool must be included in parent to preserver prompt caching.)
0 commit comments