From 4fe8b54e9bbb714aff9c6a5fefbca71d3f67077b Mon Sep 17 00:00:00 2001 From: Naiyuan Qing <145280634+NevilleQingNY@users.noreply.github.com> Date: Mon, 22 Jun 2026 15:51:03 +0800 Subject: [PATCH] MUL-3446: keep chat output in chat (#4387) * MUL-3446: keep chat output in chat Co-authored-by: multica-agent * MUL-3446: simplify chat output guidance Co-authored-by: multica-agent --------- Co-authored-by: multica-agent --- .../internal/daemon/execenv/runtime_config.go | 2 ++ .../daemon/execenv/runtime_config_test.go | 26 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/server/internal/daemon/execenv/runtime_config.go b/server/internal/daemon/execenv/runtime_config.go index 284dd6d44..b2595bf83 100644 --- a/server/internal/daemon/execenv/runtime_config.go +++ b/server/internal/daemon/execenv/runtime_config.go @@ -781,6 +781,8 @@ func buildMetaSkillContent(provider string, ctx TaskContextForEnv) string { 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 : ` 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") + case ctx.ChatSessionID != "": + b.WriteString("This is a chat session. Your reply is delivered directly to the chat window the user is reading.\n") default: if ctx.IsSquadLeader { b.WriteString("⚠️ **Final results MUST be delivered via `multica issue comment add`** — unless your outcome is `no_action`. When you evaluate a trigger and decide no action is needed, calling `multica squad activity <issue-id> no_action --reason \"...\"` alone is sufficient; you MUST exit without posting any comment. DO NOT post a comment that announces no_action, acknowledges another agent, or says you are exiting silently — such comments are noise. For all other outcomes (`action`, `failed`), a comment is still mandatory.\n\n") diff --git a/server/internal/daemon/execenv/runtime_config_test.go b/server/internal/daemon/execenv/runtime_config_test.go index cbf58ad44..8f3207aa6 100644 --- a/server/internal/daemon/execenv/runtime_config_test.go +++ b/server/internal/daemon/execenv/runtime_config_test.go @@ -337,6 +337,32 @@ func TestInstructionPrecedenceOnlyAppliesToAssignmentWorkflow(t *testing.T) { } } +func TestChatOutputDoesNotRequireIssueComment(t *testing.T) { + t.Parallel() + + out := buildMetaSkillContent("claude", TaskContextForEnv{ChatSessionID: "chat-1"}) + + for _, want := range []string{ + "This is a chat session", + "Your reply is delivered directly to the chat window the user is reading", + } { + if !strings.Contains(out, want) { + t.Errorf("chat brief missing chat output guidance %q\n---\n%s", want, out) + } + } + + for _, banned := range []string{ + "Final results MUST be delivered via `multica issue comment add`", + "The user does NOT see your terminal output", + "do not call `multica issue comment add`", + "unless the user explicitly asks", + } { + if strings.Contains(out, banned) { + t.Errorf("chat brief must not inherit issue-comment output warning %q\n---\n%s", banned, out) + } + } +} + // 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