Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
fix: make quick-create output prefix agnostic (#2604)
Valentin Mihovda7b33561e7d
diff --git a/server/internal/daemon/execenv/execenv_test.go b/server/internal/daemon/execenv/execenv_test.goindex a00aeed09d..a66bf26165 100644--- a/server/internal/daemon/execenv/execenv_test.go+++ b/server/internal/daemon/execenv/execenv_test.go@@ -1212,6 +1212,39 @@ func TestInjectRuntimeConfigCodexWindowsUsesContentFile(t *testing.T) {}}+func TestInjectRuntimeConfigQuickCreateOutputPrefixAgnostic(t *testing.T) {+ t.Parallel()+ dir := t.TempDir()++ ctx := TaskContextForEnv{QuickCreatePrompt: "create a task"}+ if _, err := InjectRuntimeConfig(dir, "codex", ctx); err != nil {+ t.Fatalf("InjectRuntimeConfig failed: %v", err)+ }+ data, err := os.ReadFile(filepath.Join(dir, "AGENTS.md"))+ if err != nil {+ t.Fatalf("read AGENTS.md: %v", err)+ }+ s := string(data)++ for _, want := range []string{+ "quick-create task",+ "Created <identifier-or-id>: <title>",+ "identifier` from JSON output",+ "Do not assume any workspace issue prefix",+ } {+ if !strings.Contains(s, want) {+ t.Errorf("quick-create runtime config missing %q\n---\n%s", want, s)+ }+ }+ for _, absent := range []string{+ "Created MUL-<n>",+ } {+ if strings.Contains(s, absent) {+ t.Errorf("quick-create runtime config should not contain %q\n---\n%s", absent, s)+ }+ }+}+func TestInjectRuntimeConfigAutopilotRunOnlyNoIssueWorkflow(t *testing.T) {t.Parallel()dir := t.TempDir()diff --git a/server/internal/daemon/execenv/runtime_config.go b/server/internal/daemon/execenv/runtime_config.goindex 5365e392c4..6bc684ecdb 100644--- a/server/internal/daemon/execenv/runtime_config.go+++ b/server/internal/daemon/execenv/runtime_config.go@@ -363,7 +363,7 @@ func buildMetaSkillContent(provider string, ctx TaskContextForEnv) string {case ctx.QuickCreatePrompt != "":b.WriteString("This is a quick-create task. There is NO existing issue to comment on. Your final stdout is captured automatically and the platform writes the user's success/failure inbox notification based on whether `multica issue create` succeeded.\n\n")b.WriteString("- Do NOT call `multica issue comment add` — the issue you just created has no conversation context for this run.\n")- b.WriteString("- Print exactly one final line: `Created MUL-<n>: <title>` after a successful `multica issue create`.\n")+ b.WriteString("- Print exactly one final line: `Created <identifier-or-id>: <title>` after a successful `multica issue create`. Use the created issue's `identifier` from JSON output when available; otherwise use its `id`. Do not assume any workspace issue prefix such as `MUL-`; workspaces can use custom prefixes.\n")b.WriteString("- On CLI failure, exit with the CLI error as the only output. The platform translates that into a `quick_create_failed` inbox item carrying the original prompt for the user.\n")default:if ctx.IsSquadLeader {diff --git a/server/internal/daemon/prompt.go b/server/internal/daemon/prompt.goindex 512e1755be..29f03b6fa8 100644--- a/server/internal/daemon/prompt.go+++ b/server/internal/daemon/prompt.go@@ -110,10 +110,11 @@ func buildQuickCreatePrompt(task Task) string {// output formatb.WriteString("Output format:\n")- b.WriteString("- Run exactly one `multica issue create` invocation. Do not retry for any reason — even on non-zero exit. The issue may already exist; another attempt would create a duplicate.\n")- b.WriteString("- After success, print exactly one line: `Created MUL-<n>: <title>` and exit. No commentary, no follow-up tool calls.\n")+ b.WriteString("- Run exactly one `multica issue create --output json` invocation. Do not retry for any reason — even on non-zero exit. The issue may already exist; another attempt would create a duplicate.\n")+ b.WriteString("- Parse the JSON response to read the created issue's `identifier` (preferred) or `id` (fallback). Do not scrape human output and do not assume any workspace issue prefix such as `MUL-`; workspaces can use custom prefixes.\n")+ b.WriteString("- After success, print exactly one line: `Created <identifier-or-id>: <title>` and exit. No commentary, no follow-up tool calls.\n")b.WriteString("- Do NOT call `multica issue get` or `multica issue comment add` — there is no issue to query or comment on.\n")- b.WriteString("- On CLI error, exit with the error as the only output. The platform writes a failure notification automatically.\n")+ b.WriteString("- On CLI error or JSON parse error, exit with the error as the only output. The platform writes a failure notification automatically.\n")return b.String()}diff --git a/server/internal/daemon/prompt_test.go b/server/internal/daemon/prompt_test.goindex b58d709c63..12ae85486d 100644--- a/server/internal/daemon/prompt_test.go+++ b/server/internal/daemon/prompt_test.go@@ -30,6 +30,16 @@ func TestBuildQuickCreatePromptRules(t *testing.T) {// 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",+ // output/reporting must be workspace-prefix agnostic. Workspaces can+ // use custom issue prefixes, so a successful issue creation should+ // not look failed merely because the identifier does not match one+ // fixed prefix.+ "multica issue create --output json",+ "JSON response",+ "identifier",+ "Do not scrape human output",+ "do not assume any workspace issue prefix",+ "Created <identifier-or-id>: <title>",// hard rules"never invent requirements","never reduce multi-sentence input",