Compare commits

...

1 Commits

Author SHA1 Message Date
J
182e2da956 fix(daemon): forbid mid-run progress comments in runtime brief
A run could post running progress/plan narration as issue comments, and a
review run surfaced its in-progress narration as the result instead of a
conclusion (MUL-3605).

Add one rule to the Output section's issue-task branch, in both the
legacy and slim briefs: post exactly one comment per run — the final
result, before the turn exits — and keep plans/progress in the agent's
own reasoning. The pre-existing "Final results MUST be delivered … a task
that finishes without a result comment is invisible" line already makes
the comment mandatory, and "state the outcome, not the process" already
rules out progress dumps, so no second rule is added.

Chat / quick-create / autopilot keep their own delivery channels. Adds a
regression test across both brief paths.

Co-authored-by: multica-agent <github@multica.ai>
2026-06-24 17:16:18 +08:00
3 changed files with 48 additions and 0 deletions

View File

@@ -826,6 +826,7 @@ func buildMetaSkillContent(provider string, ctx TaskContextForEnv) string {
} else {
b.WriteString("⚠️ **Final results MUST be delivered via `multica issue comment add`.** The user does NOT see your terminal output, assistant chat text, or run logs — only comments on the issue. A task that finishes without a result comment is invisible to the user, even if the work itself was correct.\n\n")
}
b.WriteString("**Post exactly ONE comment per run — your final result, before this turn exits.** Do NOT post progress updates, plans, or \"here's what I'm about to do next\" as comments while you work; keep all planning and progress in your own reasoning.\n\n")
b.WriteString("Keep comments concise and natural — state the outcome, not the process.\n")
b.WriteString("Good: \"Fixed the login redirect. PR: https://...\"\n")
b.WriteString("Bad: \"1. Read the issue 2. Found the bug in auth.go 3. Created branch 4. ...\"\n")

View File

@@ -439,6 +439,7 @@ func writeOutput(b *strings.Builder, kind taskKind, ctx TaskContextForEnv) {
} else {
b.WriteString("⚠️ **Final results MUST be delivered via `multica issue comment add`.** The user does NOT see your terminal output, assistant chat text, or run logs — only comments on the issue. A task that finishes without a result comment is invisible to the user, even if the work itself was correct.\n\n")
}
b.WriteString("**Post exactly ONE comment per run — your final result, before this turn exits.** Do NOT post progress updates, plans, or \"here's what I'm about to do next\" as comments while you work; keep all planning and progress in your own reasoning.\n\n")
b.WriteString("Keep comments concise and natural — state the outcome, not the process (good: \"Fixed the login redirect. PR: https://...\"; bad: numbered process logs).\n")
}
}

View File

@@ -369,6 +369,52 @@ func TestChatOutputDoesNotRequireIssueComment(t *testing.T) {
}
}
// The Output section for issue tasks must forbid mid-run progress
// comments and require the single final result comment. Guards the
// MUL-3605 regression where a review agent surfaced its progress
// narration as the result instead of posting a conclusion. (The
// pre-existing "Final results MUST be delivered … invisible without it"
// and "state the outcome, not the process" lines already carry the
// mandatory-comment and no-process-dump halves.) Chat / quick-create /
// autopilot kinds keep their own delivery channels and must NOT inherit
// this rule. Runs both the legacy and slim paths.
func TestOutputForbidsMidRunProgressComments(t *testing.T) {
wantPhrases := []string{
"Post exactly ONE comment per run",
"Do NOT post progress updates",
}
issueCtxs := map[string]TaskContextForEnv{
"assignment": {IssueID: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"},
"comment": {IssueID: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", TriggerCommentID: "tc-1"},
}
run := func(t *testing.T, label string) {
for name, ctx := range issueCtxs {
out := buildMetaSkillContent("claude", ctx)
for _, want := range wantPhrases {
if !strings.Contains(out, want) {
t.Errorf("%s/%s brief missing output rule %q\n---\n%s", label, name, want, out)
}
}
}
// Chat keeps its own delivery channel; it must not inherit the
// issue-task "post a final comment" rules.
chat := buildMetaSkillContent("claude", TaskContextForEnv{ChatSessionID: "chat-1"})
for _, banned := range wantPhrases {
if strings.Contains(chat, banned) {
t.Errorf("%s chat brief must not inherit issue output rule %q", label, banned)
}
}
}
// Not parallel: the slim subtest toggles a process-wide feature flag.
t.Run("legacy", func(t *testing.T) { run(t, "legacy") })
t.Run("slim", func(t *testing.T) {
withSlimBrief(t)
run(t, "slim")
})
}
// The sub-issue creation rule must reach top-level parents that have no
// `parent_issue_id` of their own — that is where the `todo` vs `backlog`
// decision matters most. The section must not gate on this issue being