Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

fix(daemon): tighten quick-create prompt to drop meta-instructions and apologetic Context (#2137)

Bohan Jiang2f979ac6f037
diff --git a/server/internal/daemon/prompt.go b/server/internal/daemon/prompt.go
index 3d732f997c..a199b17a38 100644
--- a/server/internal/daemon/prompt.go
+++ b/server/internal/daemon/prompt.go
@@ -50,16 +50,11 @@ func buildQuickCreatePrompt(task Task) string {
b.WriteString("- **title**: required. A concise but semantically rich summary. If the input references external resources (PRs, issues, URLs), use your judgment on whether fetching the resource would produce a meaningfully better title — e.g. \"review PR #123\" → \"Review PR #123: Refactor auth module to OAuth2\". Strip filler words but preserve key semantic information.\n\n")
// description — the core optimization
- b.WriteString("- **description**: The description will be the primary context for the executing agent. Your goal is **high fidelity** — the executing agent should understand the user's intent as well as if they had read the original input themselves.\n\n")
- b.WriteString(" **Structure the description as follows:**\n\n")
- b.WriteString(" 1. **User request** — Faithfully restate what the user wants done, in their own terms. Preserve the user's phrasing, tone, and scope. Do NOT paraphrase into generic language (e.g. don't turn \"把这个按钮改成红色\" into \"UI improvement needed\"). Do NOT add implementation plans, acceptance criteria, design decisions, or constraints the user did not express.\n\n")
- b.WriteString(" 2. **Context** (only if the input contains URLs, references, or image attachments) — Fetch referenced resources (PRs, issues, docs) and summarize the relevant factual content. Keep summaries to verifiable facts only (e.g. \"PR #45 changes the auth middleware to use JWT\" not \"this suggests we should also update the tests\"). Preserve any image URLs or markdown image references inline.\n\n")
- b.WriteString(" Omit the Context section entirely if there are no external references to enrich.\n\n")
- b.WriteString(" **Hard rules for description:**\n")
- b.WriteString(" - NEVER invent requirements, implementation details, acceptance criteria, or scope that the user did not express.\n")
- b.WriteString(" - NEVER reduce the user's multi-sentence input to a single vague sentence. If the user wrote three sentences, the description should carry at least that much information.\n")
- b.WriteString(" - Preserve specific names, identifiers, file paths, code snippets, and technical terms from the input verbatim.\n")
- b.WriteString(" - Never echo the title in the description.\n\n")
+ b.WriteString("- **description**: The description is the executing agent's primary context. Aim for high fidelity — they should grasp the user's intent as if they had read the raw input themselves. Use a two-section structure:\n\n")
+ b.WriteString(" 1. **User request** — Faithfully restate what the user wants in their own words. Preserve specific names, identifiers, file paths, code snippets, and technical terms verbatim. Strip non-spec material before writing it (this is removal, not paraphrasing): verbal routing wrappers about creating the issue (e.g. \"create an issue\", \"分配给 X\") and pure conversational fillers (e.g. \"对吧?\"). When in doubt, keep it.\n\n")
+ b.WriteString(" CC exception: `multica issue create` has no `--subscriber` flag, and the platform auto-subscribes members whose `[@Name](mention://member/<uuid>)` link appears in the description. When the user wrote \"cc @Y\", strip the verbal \"cc\" wrapper from the User request body and append a final `CC: <mention link(s)>` line to the description so the cc routing still fires.\n\n")
+ b.WriteString(" 2. **Context** — include ONLY when the input cited external resources AND you successfully fetched them AND they produced verifiable facts worth recording. Summarize facts only (e.g. \"PR #45 changes auth to JWT\"), not interpretation or unsolicited reference implementations. If you have nothing factual to add, omit the section entirely — never use it as an apology log for resources you could not fetch.\n\n")
+ b.WriteString(" Hard rules: never invent requirements, implementation details, or acceptance criteria the user did not express; never reduce multi-sentence input to a single vague sentence; never echo the title.\n\n")
// priority
b.WriteString("- **priority**: one of `urgent`, `high`, `medium`, `low`, or omit. Map P0/P1 → urgent/high; \"asap\" → urgent. If unspecified, omit.\n\n")
diff --git a/server/internal/daemon/prompt_test.go b/server/internal/daemon/prompt_test.go
new file mode 100644
index 0000000000..82101eaf36
--- /dev/null
+++ b/server/internal/daemon/prompt_test.go
@@ -0,0 +1,42 @@
+package daemon
+
+import (
+ "strings"
+ "testing"
+)
+
+// TestBuildQuickCreatePromptRules locks in the rules that govern how the
+// quick-create agent is allowed to translate raw user input into the issue
+// description body. Each substring corresponds to a concrete failure mode
+// observed in production output:
+// - meta-instructions ("create an issue", "cc @X") leaking into the body
+// - the Context section being misused as an apology log when no external
+// references were actually fetched
+// - hard-line rules being silently dropped on prompt rewrites
+func TestBuildQuickCreatePromptRules(t *testing.T) {
+ out := buildQuickCreatePrompt(Task{QuickCreatePrompt: "fix the login button color"})
+
+ mustContain := []string{
+ // high-fidelity invariant
+ "Faithfully restate what the user wants",
+ "Preserve specific names, identifiers, file paths",
+ // strip non-spec material: verbal routing wrappers + conversational fillers
+ "verbal routing wrappers about creating the issue",
+ "pure conversational fillers",
+ // cc routing must survive: mention link stays in description so the
+ // auto-subscribe path fires (multica issue create has no --subscriber flag)
+ "CC exception",
+ "auto-subscribes members",
+ // context section is conditional and must not be an apology log
+ "include ONLY when the input cited external resources",
+ "never use it as an apology log",
+ // hard rules
+ "never invent requirements",
+ "never reduce multi-sentence input",
+ }
+ for _, s := range mustContain {
+ if !strings.Contains(out, s) {
+ t.Errorf("buildQuickCreatePrompt output missing required rule: %q", s)
+ }
+ }
+}