Skip to content

Commit 88bf0a1

Browse files
committed
fix: improve task reporting tool description
1 parent 4e0acdc commit 88bf0a1

File tree

2 files changed

+28
-29
lines changed

2 files changed

+28
-29
lines changed

cli/exp_mcp.go

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -188,18 +188,13 @@ func (*RootCmd) mcpConfigureClaudeCode() *serpent.Command {
188188
reportTaskPrompt = defaultReportTaskPrompt
189189
}
190190

191-
// If a user overrides the coder prompt, we don't want to append
192-
// the report task prompt, as it then becomes the responsibility
193-
// of the user.
194-
actualCoderPrompt := defaultCoderPrompt
191+
// The Coder Prompt just allows users to extend our
195192
if coderPrompt != "" {
196-
actualCoderPrompt = coderPrompt
197-
} else if reportTaskPrompt != "" {
198-
actualCoderPrompt += "\n\n" + reportTaskPrompt
193+
reportTaskPrompt += "\n\n" + coderPrompt
199194
}
200195

201196
// We also write the system prompt to the CLAUDE.md file.
202-
if err := injectClaudeMD(fs, actualCoderPrompt, systemPrompt, claudeMDPath); err != nil {
197+
if err := injectClaudeMD(fs, reportTaskPrompt, systemPrompt, claudeMDPath); err != nil {
203198
return xerrors.Errorf("failed to modify CLAUDE.md: %w", err)
204199
}
205200
cliui.Infof(inv.Stderr, "Wrote CLAUDE.md to %s", claudeMDPath)
@@ -648,25 +643,9 @@ func configureClaude(fs afero.Fs, cfg ClaudeConfig) error {
648643
}
649644

650645
var (
651-
defaultCoderPrompt = `You are a helpful Coding assistant. Aim to autonomously investigate
652-
and solve issues the user gives you and test your work, whenever possible.
653-
Avoid shortcuts like mocking tests. When you get stuck, you can ask the user
654-
but opt for autonomy.`
655-
656-
defaultReportTaskPrompt = `YOU MUST REPORT ALL TASKS TO CODER.
657-
When reporting tasks, you MUST follow these EXACT instructions:
658-
- IMMEDIATELY report status after receiving ANY user message.
659-
- Be granular. If you are investigating with multiple steps, report each step to coder.
660-
661-
Task state MUST be one of the following:
662-
- Use "state": "working" when actively processing WITHOUT needing additional user input.
663-
- Use "state": "complete" only when finished with a task.
664-
- Use "state": "failure" when you need ANY user input, lack sufficient details, or encounter blockers.
665-
666-
Task summaries MUST:
667-
- Include specifics about what you're doing.
668-
- Include clear and actionable steps for the user.
669-
- Be less than 160 characters in length.`
646+
defaultCoderPrompt = ``
647+
648+
defaultReportTaskPrompt = `Respect the requirements of the "coder_report"task" tool. It is pertinent to provide a fantastic user-experience.`
670649

671650
// Define the guard strings
672651
coderPromptStartGuard = "<coder-prompt>"

codersdk/toolsdk/toolsdk.go

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,28 @@ type ReportTaskArgs struct {
180180

181181
var ReportTask = Tool[ReportTaskArgs, codersdk.Response]{
182182
Tool: aisdk.Tool{
183-
Name: "coder_report_task",
184-
Description: "Report progress on a user task in Coder.",
183+
Name: "coder_report_task",
184+
Description: `Report progress on your work.
185+
186+
The user observes your work through a Task UI. To keep them updated
187+
on your progress, or if you need help - use this tool.
188+
189+
Good Tasks
190+
- "Cloning the repository <repository-url>"
191+
- "Working on <feature-name>"
192+
- "Figuring our why <issue> is happening"
193+
194+
Bad Tasks
195+
- "I'm working on it"
196+
- "I'm trying to fix it"
197+
- "I'm trying to implement <feature-name>"
198+
199+
Use the "state" field to indicate your progress. Periodically report
200+
progress to keep the user updated. It is not possible to send too many updates!
201+
202+
After you complete your work, ALWAYS send a "complete" or "failure" state. Only report
203+
these states if you are finished, not if you are working on it.
204+
`,
185205
Schema: aisdk.Schema{
186206
Properties: map[string]any{
187207
"summary": map[string]any{

0 commit comments

Comments
 (0)