Skip to content

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

Go

fix(daemon): move the in_progress start write into workflow step 3 (MUL-6417 follow-up 2) (#7295)

Bohan Jiang3268d011722d
diff --git a/apps/docs/content/docs/assigning-issues.mdx b/apps/docs/content/docs/assigning-issues.mdx
index 064bdd5c81..770f579371 100644
--- a/apps/docs/content/docs/assigning-issues.mdx
+++ b/apps/docs/content/docs/assigning-issues.mdx
@@ -37,7 +37,7 @@ While executing, the agent can:
What it can actually do is still limited by the agent's configuration, the runtime environment, and your permission to run it.
-During the run, the agent manages the issue's status by judging what its work changes: starting on the issue's own ask moves it to `in_progress` right away, delivery moves it to `in_review`, work continuing beyond the turn keeps it `in_progress`, and research or discussion leaves the status untouched — these actions appear under the agent's identity in the timeline. Task lifecycle and issue status are separate: a task completing does not by itself change the issue status.
+During the run, the agent manages the issue's status by judging what its work changes: starting on the issue's own ask moves it to `in_progress` right away, delivery moves it to `in_review`, work continuing beyond the turn keeps it `in_progress`, and consultation or discussion leaves the status untouched — these actions appear under the agent's identity in the timeline. Task lifecycle and issue status are separate: a task completing does not by itself change the issue status.
When the assignee is a [squad](/squads), the same rule applies: Multica enqueues the leader, and dispatching members is not delivery — a dispatch turn leaves the parent issue `in_progress`, and the leader only moves it to `in_review` once the overall goal is met.
diff --git a/apps/docs/content/docs/assigning-issues.zh.mdx b/apps/docs/content/docs/assigning-issues.zh.mdx
index 7c26f30c34..16eb5d587f 100644
--- a/apps/docs/content/docs/assigning-issues.zh.mdx
+++ b/apps/docs/content/docs/assigning-issues.zh.mdx
@@ -37,7 +37,7 @@ Multica 会为智能体创建一条[执行任务](/tasks)。在线运行时领
具体能力仍受智能体配置、运行时环境和你的调用权限限制。
-执行过程中,智能体根据工作对 issue 的实际影响管理状态:开始做 issue 本身要求的工作时立刻推到 `in_progress`,交付即推到 `in_review`,工作跨轮继续则保持 `in_progress`,仅调研或讨论则不动状态——这些动作以智能体的身份出现在时间线中。task 的生命周期和 issue 状态是分开的:task 完成本身不会改变 issue 状态。
+执行过程中,智能体根据工作对 issue 的实际影响管理状态:开始做 issue 本身要求的工作时立刻推到 `in_progress`,交付即推到 `in_review`,工作跨轮继续则保持 `in_progress`,仅答疑或讨论则不动状态——这些动作以智能体的身份出现在时间线中。task 的生命周期和 issue 状态是分开的:task 完成本身不会改变 issue 状态。
负责人是[小队](/squads)时,同样的规则适用:Multica 入队的是队长,派活不等于交付——派活轮结束时父 issue 处于 `in_progress`,整体目标达成后队长才推到 `in_review`。
diff --git a/apps/docs/content/docs/issues.mdx b/apps/docs/content/docs/issues.mdx
index f73292c344..1e94463848 100644
--- a/apps/docs/content/docs/issues.mdx
+++ b/apps/docs/content/docs/issues.mdx
@@ -54,7 +54,7 @@ Every workspace starts with seven built-in statuses. They are also the seven **c
There is no fixed flow between statuses — members and agents can change them directly.
-Agents write the status the issue is in as their work changes it: starting work on what the issue asks for moves it to `in_progress` right away, so the board shows the work while it runs; delivering moves it to `in_review`; work that continues beyond the turn keeps it `in_progress`; research, answers, or discussion leave the status untouched throughout. These updates are written explicitly by the agent through the Multica CLI during the run — the server does not flip issue status when a task starts or completes (apart from the two system exceptions below). `done` is usually a human confirmation, or an integration such as a PR with close intent that merges.
+Agents write the status the issue is in as their work changes it: starting work on what the issue asks for — in whatever form, research, design, or a review the issue itself requests — moves it to `in_progress` right away, so the board shows the work while it runs; delivering moves it to `in_review`; work that continues beyond the turn keeps it `in_progress`; a turn that produces nothing of the issue's own deliverable — answering questions, consulting on work owned elsewhere — leaves the status untouched throughout. These updates are written explicitly by the agent through the Multica CLI during the run — the server does not flip issue status when a task starts or completes (apart from the two system exceptions below). `done` is usually a human confirmation, or an integration such as a PR with close intent that merges.
<Callout type="info">
Two changes are made by the system:
diff --git a/apps/docs/content/docs/issues.zh.mdx b/apps/docs/content/docs/issues.zh.mdx
index db4530ba21..836e52c769 100644
--- a/apps/docs/content/docs/issues.zh.mdx
+++ b/apps/docs/content/docs/issues.zh.mdx
@@ -54,7 +54,7 @@ Issue 是 Multica 中安排工作的基本单位:一项功能、一个 bug、
状态之间没有固定流转,成员和智能体都可以直接修改。
-智能体随着工作对 issue 的实际影响写入状态:开始做 issue 本身要求的工作时立刻推到 `in_progress`,让看板在工作进行中就能反映出来;交付后推到 `in_review`;工作跨轮继续则保持 `in_progress`;仅调研、答疑或讨论则全程不改状态。这些状态变更由智能体在运行中通过 Multica CLI 显式写入——task 开始或完成时,服务端不会自动改 issue 状态(下面两个系统例外除外)。`done` 通常留给人工确认,或由集成完成(例如带关闭意图的 PR 合并)。
+智能体随着工作对 issue 的实际影响写入状态:开始产出 issue 本身要求的东西时立刻推到 `in_progress`——不论形式是代码、调研、设计,还是 issue 本身要求的 review——让看板在工作进行中就能反映出来;交付后推到 `in_review`;工作跨轮继续则保持 `in_progress`;没有产出本 issue 交付物的轮次(答疑、给别处的工作做咨询)则全程不改状态。这些状态变更由智能体在运行中通过 Multica CLI 显式写入——task 开始或完成时,服务端不会自动改 issue 状态(下面两个系统例外除外)。`done` 通常留给人工确认,或由集成完成(例如带关闭意图的 PR 合并)。
<Callout type="info">
两个变化由系统执行:
diff --git a/server/internal/daemon/execenv/runtime_config_sections.go b/server/internal/daemon/execenv/runtime_config_sections.go
index d0ffa88a90..cf60a59573 100644
--- a/server/internal/daemon/execenv/runtime_config_sections.go
+++ b/server/internal/daemon/execenv/runtime_config_sections.go
@@ -556,10 +556,33 @@ func writeWorkflowAutopilot(b *strings.Builder, ctx TaskContextForEnv) {
// an hour — judged only at turn end, the board showed todo the whole time
// (Bohan's post-merge report on MUL-6417). This is the old rule's timing
// with the fact anchor's conditionality: an ancillary turn still writes
-// nothing at either moment, so the research case and the concurrency
-// convergence are unchanged. The activity indicator still shows the run
-// itself, but columns, filters, and sorting read status — the indicator
-// alone proved not to be the board surface people actually watch.
+// nothing at either moment, so the concurrency convergence is unchanged.
+// The activity indicator still shows the run itself, but columns, filters,
+// and sorting read status — the indicator alone proved not to be the board
+// surface people actually watch.
+//
+// The start write lives INSIDE step 3, not in the status block below —
+// placement is load-bearing, not style. The first attempt stated it as a
+// bullet under the status heading, and a run on MUL-6460 that verifiably had
+// that brief walked steps 1→2→3 and never wrote a status: at the moment the
+// condition triggers the model is executing the numbered list, and a rule
+// outside the list does not fire (the pre-MUL-6417 opening write was
+// reliable precisely because it was an explicit step). Same incident killed
+// the "asked to research stays todo" example from the no-write bullet: that
+// run's work WAS research toward its own issue's ask, so the example
+// pattern-matched the exact case it was never meant to cover. Ancillary is
+// now defined by output alone — the turn produced none of the issue's own
+// deliverable. No activity-word list survives in EITHER direction: Elon's
+// review on #7295 caught "review" still sitting in a skip-list (the same
+// incident queued to replay on a review-the-PR issue), and J's review
+// caught the positive form-list that replaced it ("code, research, a
+// design, ...") — a whitelist reads as exhaustive, so a triage or
+// reproduce-the-bug turn would not find itself in it. What remains is the
+// criterion plus one never-decides sentence, placed inside step 3 because
+// that is the position that fires. The exit-side check is anchored inside
+// step 5 for the same reason, and the step-3 skip is scoped to the
+// in_progress CATEGORY so a custom status like Planning already counts as
+// recorded once MUL-6460 puts the catalog in front of agents.
//
// The invariants MUL-6300 pinned survive as consequences instead of gates: a
// conversational turn changes nothing about the issue's state, so it writes
@@ -598,24 +621,23 @@ func writeWorkflowIssue(b *strings.Builder, ctx TaskContextForEnv) {
b.WriteString("1. Read the issue (`multica issue get`) to understand the context — its JSON already carries the issue's `metadata` bag (empty `{}` is normal), so no separate metadata read is needed. What to look for: `## Issue Metadata`.\n")
b.WriteString("2. Catch up on the comment history — this is mandatory, not optional — in two bounded reads, never one bulk pull: scan every thread cheaply (`--roots-only --summary --compact`), then expand only the threads that matter (`--thread <id> --tail 30 --compact`). Earlier comments often carry context the issue body lacks. Skipping this step is the most common cause of agents acting on stale or incomplete instructions — so always run the scan, even when the trigger looks self-contained. When a comment triggered this run, the per-turn user message names the thread to expand first; the scan is how you decide whether any OTHER thread is also relevant.\n")
- b.WriteString("3. Complete the task within your Agent Identity boundaries (`## Instruction Precedence` lists the actions Agent Identity can forbid). If your role is delegation-only, perform the allowed delegation work and stop once that outcome is delivered. Before self-assigning, check the target issue's comment history for an existing claim and any `## Active sibling runs` block; when assignment or status only records ownership/progress for work already underway, pass `--no-start` on every such command (the default start behavior is for handing off fresh work).\n")
+ b.WriteString("3. If any part of what this turn will produce is what the issue itself asks for, set `in_progress` FIRST (skip when the issue is already in an `in_progress`-category status, or when your Agent Identity forbids status writes): the board should show the issue being worked while you work, not only after. The kind of activity — research, design, planning, review — never decides this; only whether the output is part of THIS issue's ask. Then complete the task within your Agent Identity boundaries (`## Instruction Precedence` lists the actions Agent Identity can forbid). If your role is delegation-only, perform the allowed delegation work and stop once that outcome is delivered. Before self-assigning, check the target issue's comment history for an existing claim and any `## Active sibling runs` block; when assignment or status only records ownership/progress for work already underway, pass `--no-start` on every such command (the default start behavior is for handing off fresh work).\n")
if ctx.IsSquadLeader {
b.WriteString("4. **Post your final results as a comment** (unless your outcome is `no_action` — in that case, calling `multica squad activity <issue-id> no_action --reason \"...\"` alone is sufficient; you MUST exit without posting any comment. DO NOT post a comment announcing no_action or saying you are exiting silently): post it with `multica issue comment add` using the platform-correct non-inline mode from ## Comment Formatting (never inline `--content`). When the per-turn user message carries a triggering comment, reply in its thread with the `--parent` value it gives you for THIS turn (never one from an earlier turn); when it lists several threads, post one reply per thread. With no triggering comment, post a new top-level comment. Your results are only visible to the user if posted via this CLI call; text in your terminal or run logs is NOT delivered.\n")
} else {
b.WriteString("4. **Post your final results as a comment — this step is mandatory**: post it with `multica issue comment add` using the platform-correct non-inline mode from ## Comment Formatting (never inline `--content`). When the per-turn user message carries a triggering comment, reply in its thread with the `--parent` value it gives you for THIS turn (never one from an earlier turn); when it lists several threads, post one reply per thread. With no triggering comment, post a new top-level comment. `## Output` states why this call is the only delivery channel.\n")
}
- b.WriteString("5. Before exiting, pin or clear a metadata key via `multica issue metadata set`/`delete` only if it clears the bar in `## Issue Metadata`. Most runs write nothing here — that is the expected outcome, not a gap. When in doubt, do not write.\n\n")
+ b.WriteString("5. Before exiting, confirm the status still matches where things actually stand, then pin or clear a metadata key via `multica issue metadata set`/`delete` only if it clears the bar in `## Issue Metadata`. Most runs write no metadata — that is the expected outcome, not a gap. When in doubt, do not write.\n\n")
b.WriteString("**Issue status — write the state the issue is in, whenever it changes** (skip any status call your Agent Identity forbids)\n\n")
- b.WriteString("Status reflects the state the ISSUE is in, not your run's lifecycle — and it can change when your work STARTS, not only when it ends. Write a status only when the new value differs from the current one, whoever the assignee is:\n\n")
- b.WriteString("- The moment you know this turn advances what the issue itself asks for — usually right after reading it — set `in_progress`: the board should show the issue being worked while you work, not only after.\n")
+ b.WriteString("Status reflects the state the ISSUE is in, not your run's lifecycle — keep it true at every point in the turn, not only at checkpoints: write the new value the moment your work changes it, mid-turn included. Write only when the new value differs from the current one, whoever the assignee is:\n\n")
b.WriteString("- You delivered what the issue itself asks for and it awaits acceptance → `in_review`. Delivering an issue assigned to you — including a sub-issue in a chain or stage — always lands here; stage barriers and parent notifications depend on that signal. `done` stays human.\n")
b.WriteString("- The issue's work continues beyond this turn — you dispatched sub-issues, or delivered one part with more underway → `in_progress`.\n")
b.WriteString("- You cannot proceed without something you are missing → `blocked`, and post a comment explaining the blocker unless your Agent Identity forbids issue comments.\n")
if ctx.IsSquadLeader {
b.WriteString("- Squad leader: dispatching members is not delivery — a dispatch turn leaves the parent `in_progress`, and it moves to `in_review` only on the later turn (a member update or stage-barrier re-trigger) where you confirm the overall goal is met.\n")
}
- b.WriteString("- Your turn only researches, answers, reviews, or discusses — the issue's own state never moves → write nothing, at the start or the end. A `todo` issue you were asked to research stays `todo`; questions, discussion, and acknowledgements never touch status. This no-write default is what keeps concurrent runs from flapping the board.\n\n")
+ b.WriteString("- Your turn produced none of the issue's own deliverable — you answered a question or consulted on work owned elsewhere → write nothing, at any point; questions, discussion, and acknowledgements never touch status. This no-write default is what keeps concurrent runs from flapping the board.\n\n")
}
// writeSubIssueCreation emits the Sub-issue Creation section.
diff --git a/server/internal/daemon/execenv/runtime_config_test.go b/server/internal/daemon/execenv/runtime_config_test.go
index 382da1cc11..eae740dbff 100644
--- a/server/internal/daemon/execenv/runtime_config_test.go
+++ b/server/internal/daemon/execenv/runtime_config_test.go
@@ -172,8 +172,14 @@ func TestStatusRuleIsFactJudgmentAtBothMoments(t *testing.T) {
// The anchor: issue state, not run lifecycle, written when it changes.
"**Issue status — write the state the issue is in, whenever it changes**",
"Status reflects the state the ISSUE is in, not your run's lifecycle",
- // The start moment: a work turn shows on the board while it runs.
- "The moment you know this turn advances what the issue itself asks for",
+ // The start moment: INSIDE step 3, at the read→work boundary. A run
+ // on MUL-6460 proved a detached status-block bullet does not fire —
+ // the model is walking the numbered list when the condition triggers.
+ "3. If any part of what this turn will produce is what the issue itself asks for",
+ // Category-scoped skip so a custom in_progress-category status (e.g.
+ // Planning, MUL-6460) already counts as "recorded" once agents can
+ // see the catalog.
+ "already in an `in_progress`-category status",
"the board should show the issue being worked while you work, not only after",
// No assignee gate: the judgment applies to whoever is running.
"whoever the assignee is",
@@ -183,11 +189,11 @@ func TestStatusRuleIsFactJudgmentAtBothMoments(t *testing.T) {
// research: stage barriers and parent notifications key off the
// delivery write.
"stage barriers and parent notifications depend on that signal",
- // Invariant 1: conversation does not move the board...
+ // Invariant 1: conversation does not move the board. Ancillary is
+ // defined by OUTPUT (no part of the issue's own deliverable), not by
+ // activity words like "research" that also describe real work.
"questions, discussion, and acknowledgements never touch status",
- // ...and a research-only ask leaves a todo issue in todo — the case
- // the old unconditional arc got wrong twice (MUL-6417).
- "A `todo` issue you were asked to research stays `todo`",
+ "Your turn produced none of the issue's own deliverable",
// Invariant 2: concurrent agents converge instead of flapping.
"This no-write default is what keeps concurrent runs from flapping the board",
} {
@@ -209,12 +215,46 @@ func TestStatusRuleIsFactJudgmentAtBothMoments(t *testing.T) {
"Before step 3, run `multica issue status",
"judge once, at the end of the turn",
"do not open with a status write",
+ // The example that misled the MUL-6460 run: research that IS the
+ // issue's ask pattern-matched an example meant for consult pull-ins.
+ "asked to research stays",
+ // Activity-word lists must not come back in EITHER direction — the
+ // negative lists are the failure class behind the research and
+ // review cases, and the positive form-list ("in whatever form:
+ // code, research, ...") is the same shape read as exhaustive
+ // (J's review on #7295).
+ "A turn that only answers, reviews, or consults",
+ "you only answered a question, reviewed, or discussed",
+ "in whatever form: code, research",
} {
if strings.Contains(out, banned) {
t.Errorf("brief still carries retired status gate %q (MUL-6417)\n---\n%s", banned, out)
}
}
+ // Position is load-bearing, not style (J's review on #7295): a
+ // presence-pin cannot tell WHERE a sentence lives, and both field
+ // incidents came from correct sentences sitting in positions that do
+ // not fire. The two anchors must live INSIDE their numbered steps.
+ var step3, step5 string
+ for _, line := range strings.Split(out, "\n") {
+ if strings.HasPrefix(line, "3. ") {
+ step3 = line
+ }
+ if strings.HasPrefix(line, "5. ") {
+ step5 = line
+ }
+ }
+ if !strings.Contains(step3, "set `in_progress` FIRST") {
+ t.Errorf("the start write must be anchored inside step 3\n---\n%s", step3)
+ }
+ if !strings.Contains(step3, "never decides") {
+ t.Errorf("the never-decides guard must live inside step 3, the position that fires\n---\n%s", step3)
+ }
+ if !strings.Contains(step5, "confirm the status still matches") {
+ t.Errorf("the exit-side status check must be anchored inside step 5\n---\n%s", step5)
+ }
+
// The squad-leader bullet must not leak into the ordinary path.
if strings.Contains(out, "dispatching members is not delivery") {
t.Errorf("ordinary-agent brief must not carry the squad-leader status bullet:\n%s", out)
@@ -387,7 +427,7 @@ func TestIssueWorkflowHonorsAgentIdentity(t *testing.T) {
// MUL-5442 (carried through MUL-6417): the forbids-clause is stated
// once on the status-rule header instead of once per status bullet.
"skip any status call your Agent Identity forbids",
- "Complete the task within your Agent Identity boundaries",
+ "complete the task within your Agent Identity boundaries",
// Step 3 keeps only what the enumeration cannot express: a
// delegation-only role stops once the delegation is delivered.
"If your role is delegation-only, perform the allowed delegation work and stop once that outcome is delivered",
diff --git a/server/internal/service/builtin_skills/multica-working-on-issues/SKILL.md b/server/internal/service/builtin_skills/multica-working-on-issues/SKILL.md
index c1d3a385fe..67ff9672b5 100644
--- a/server/internal/service/builtin_skills/multica-working-on-issues/SKILL.md
+++ b/server/internal/service/builtin_skills/multica-working-on-issues/SKILL.md
@@ -192,17 +192,21 @@ on it. These are the contracts, not advice:
`StartTask` / `CompleteTask` side effects. The runtime brief asks agents to
write the state the issue is in whenever their work changes it — not from
the trigger type or the run's lifecycle, and not gated on being the
- assignee. A turn that advances the issue's own ask sets `in_progress` as
- soon as that is known, so the board shows the work while it runs; at the
- end of the turn the work's state is recorded: delivered the issue's own
- ask → `in_review`; work continues beyond the turn (dispatched sub-issues,
- partial delivery) → `in_progress`; stuck → `blocked`. A turn that only
- researched, answered, reviewed, or discussed writes nothing at either
- moment — a `todo` issue researched on request stays `todo`, and questions,
- discussion, or acknowledgements never move the status. Squad leaders:
- dispatching members is not delivery — a dispatch turn leaves the parent
- `in_progress`, and it moves to `in_review` only when a later re-trigger
- confirms the overall goal is met.
+ assignee. Writes happen whenever the state changes, mid-turn included: a
+ turn that advances the issue's own ask sets `in_progress` as soon as that
+ is known, so the board shows the work while it runs; a blocker is recorded
+ when it is hit; and the turn must not exit with a stale value — delivered
+ the issue's own ask → `in_review`; work continues beyond the turn
+ (dispatched sub-issues, partial delivery) → `in_progress`; stuck →
+ `blocked`. A turn that produces none of the issue's own deliverable —
+ answering a question, consulting on work owned elsewhere — writes nothing
+ at any point. The kind of activity never decides this: research, design,
+ planning, and review all count as the work exactly when they are what the
+ issue asks for (a review-the-PR issue is being worked the moment reviewing
+ starts). Questions, discussion, or acknowledgements never move the status.
+ Squad leaders: dispatching members is not delivery — a dispatch turn
+ leaves the parent `in_progress`, and it moves to `in_review` only when a
+ later re-trigger confirms the overall goal is met.
- **`in_review`** is an accepted issue status. Some workflows use it while a PR
is open and awaiting review; moving to it is an explicit mutation.
- **`done`** on a child issue posts a system comment on its parent. If a PR
diff --git a/server/internal/service/builtin_skills/multica-working-on-issues/references/working-on-issues-source-map.md b/server/internal/service/builtin_skills/multica-working-on-issues/references/working-on-issues-source-map.md
index 6cdda5e69b..619f91acd8 100644
--- a/server/internal/service/builtin_skills/multica-working-on-issues/references/working-on-issues-source-map.md
+++ b/server/internal/service/builtin_skills/multica-working-on-issues/references/working-on-issues-source-map.md
@@ -130,7 +130,7 @@ and is hidden from the PR list.
| Child → `done` notifies + wakes the parent, gated by the stage barrier | `server/internal/handler/issue_child_done.go:66` (`notifyParentOfChildDone`; doc comment at `:15`; barrier gate at `:115`) | func def `:51` |
| Status change (incl. → `cancelled`) does NOT cancel in-flight tasks; only issue deletion does (MUL-4465) | no-cancel note in `server/internal/handler/issue.go:2652-2658` (`UpdateIssue`) and `:3170-3171` (`BatchUpdateIssues`); deletion still cancels at `:2863` (`DeleteIssue`) / `:3239` (`BatchDeleteIssues`) via `CancelTasksForIssue` (`server/internal/service/task.go:1229`) | new citation |
| `StartTask` / `CompleteTask` do not write issue status (agent CLI owns progress) | `server/internal/service/task.go` (`StartTask` / `CompleteTask` comments) | new citation |
-| Runtime brief: status written when the work changes it — starting the issue's own ask → `in_progress` immediately; at turn end delivery → `in_review`, continuing → `in_progress`, stuck → `blocked`; research/conversation → no write at either moment; no assignee gate; squad leader dispatch is not delivery (MUL-6417) | `server/internal/daemon/execenv/runtime_config_sections.go` (`writeWorkflowIssue`) | new citation |
+| Runtime brief: status written whenever the work changes it, mid-turn included — starting the issue's own ask → `in_progress` immediately (workflow step 3); delivery → `in_review`, continuing → `in_progress`, stuck → `blocked`; a turn producing none of the issue's own deliverable → no write at any point; the activity kind never decides (research/design/planning/review count as work when they are the ask); no assignee gate; squad leader dispatch is not delivery (MUL-6417) | `server/internal/daemon/execenv/runtime_config_sections.go` (`writeWorkflowIssue`) | new citation |
| Failed task may roll `in_progress` → `todo` when no active task remains | `server/internal/service/task.go` (`HandleFailedTasks`) | new citation |
Creation with `--status todo` (or any non-backlog status) on an agent-assigned