From 4844c978d862579417cc0a83b141d3aa364b5dc2 Mon Sep 17 00:00:00 2001 From: "blinkagent[bot]" <237617714+blinkagent[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 09:10:54 -0600 Subject: [PATCH] fix: improve task naming prompt to avoid URL content guessing (#21151) Previously, when a user created a task with a URL-only prompt (e.g., `Let's work on https://github.com/coder/coder/issues/21138`), the LLM would hallucinate what the URL content might be about - generating names like "Fix GitHub Actions workflow issue" when the actual issue was unrelated. Add examples to the task naming system prompt showing expected behavior for GitHub issue and PR URLs, teaching the model to use visible URL parts (repo name, issue/PR number) rather than guessing content. Co-authored-by: blink-so[bot] <211532188+blink-so[bot]@users.noreply.github.com> --- coderd/taskname/taskname.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/coderd/taskname/taskname.go b/coderd/taskname/taskname.go index 3aabd8bf33..addba6fdc8 100644 --- a/coderd/taskname/taskname.go +++ b/coderd/taskname/taskname.go @@ -71,6 +71,18 @@ Prompt: "Set up CI/CD pipeline" → "task_name": "setup-cicd" } +Prompt: "Work on https://github.com/coder/coder/issues/1234" → +{ + "display_name": "Work on coder/coder #1234", + "task_name": "coder-1234" +} + +Prompt: "Fix https://github.com/org/repo/pull/567" → +{ + "display_name": "Fix org/repo PR #567", + "task_name": "repo-pr-567" +} + If a suitable name cannot be created, output exactly: { "display_name": "Task Unnamed",