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
description: 'The evaluation context and conversation history',
16
+
},
17
+
},
18
+
outputMode: 'structured_output',
19
+
outputSchema: {
20
+
type: 'object',
21
+
properties: {
22
+
reasoning: {
23
+
type: 'string',
24
+
description: 'Detailed reasoning for the decision',
25
+
},
26
+
decision: {
27
+
type: 'string',
28
+
enum: ['continue','complete','halt'],
29
+
description:
30
+
'Whether to continue, complete, or halt the implementation',
31
+
},
32
+
next_prompt: {
33
+
type: 'string',
34
+
description:
35
+
'The next prompt to send to Codebuff (required if decision is continue)',
36
+
},
37
+
},
38
+
required: ['decision','reasoning'],
39
+
},
40
+
systemPrompt: `You are an expert software engineer tasked with implementing a specification using Codebuff, an AI coding assistant. Your goal is to prompt Codebuff to implement the spec correctly.
41
+
42
+
You cannot and should not make changes yourself. You have no access to tools. You are merely prompting a coding assistant to make changes on your behalf in order to implement the spec.`,
43
+
instructionsPrompt: `Analyze the conversation history and determine whether to:
44
+
1. 'continue' - Generate a follow-up prompt for Codebuff the coding agent
45
+
2. 'complete' - The implementation is done and satisfies the spec
46
+
3. 'halt' - The implementation is off track and unlikely to be completed
47
+
48
+
If deciding to continue, include a clear, focused prompt for Codebuff in next_prompt. Don't ask to see files or specific code, instead you should mostly describe the changes you want to make (based on the spec). It's fine to ask questions if you need to in order best implement the spec. But keep in mind you only have a few turns to implement the spec.
49
+
50
+
Explain your reasoning in detail.
51
+
52
+
You must use the set_output tool to output your reasoning, decision and next_prompt.`,
53
+
}
54
+
55
+
/**
56
+
* Get the next evaluation prompt using the Codebuff SDK
57
+
*/
58
+
exportasyncfunctiongetNextEvalPrompt({
59
+
client,
60
+
spec,
61
+
conversationHistory,
62
+
attemptsRemaining,
63
+
}: {
64
+
client: CodebuffClient
65
+
spec: string
66
+
conversationHistory: string
67
+
attemptsRemaining: number
68
+
}): Promise<z.infer<typeofAgentDecisionSchema>>{
69
+
constprompt=`You are in a conversation with Codebuff, an AI coding assistant.
content: `You are an expert software engineer tasked with implementing a specification using CodeBuff, an AI coding assistant. Your goal is to prompt CodeBuff to implement the spec correctly. You are in a conversation with this coding agent.
121
-
122
-
Current spec to implement:
123
-
<spec>${evalCommit.spec}</spec>
124
-
125
-
Your conversation with Codebuff so far:
126
-
<conversation>${renderedTrace}</conversation>
127
-
128
-
Note that files can only be changed with tools. If no tools are called, no files were changed.
129
-
130
-
You must decide whether to:
131
-
1. 'continue' - Generate a follow-up prompt for Codebuff
132
-
2. 'complete' - The implementation is done and satisfies the spec
133
-
3. 'halt' - The implementation is off track and unlikely to be completed within ${MAX_ATTEMPTS-attempts} more attempts
134
-
135
-
If deciding to continue, include a clear, focused prompt for Codebuff in next_prompt.
0 commit comments