Commit Graph
2 Commits
Author SHA1 Message Date
Bohan Jiangandmultica-agent 624648cc14 fix(daemon): offer a Git Bash variant of the Windows reply cookbook (MUL-7554) (#8634)
The Windows brief only knew PowerShell: the per-turn reply cookbook and
the Comment Formatting cleanup line assumed every Windows agent pastes
into PowerShell. The daemon knows the host OS, not the shell behind the
agent's command tool. Claude Code runs Git Bash for its Bash tool, and a
user who turns off its PowerShell tool (CLAUDE_CODE_USE_POWERSHELL_TOOL=0,
GitHub #8627) gets a cookbook whose 'if ($LASTEXITCODE ...)' line is a
bash syntax error that fires AFTER the post succeeded, so the agent sees
a failure and may re-post.

Render one variant per shell on Windows (PowerShell with the
$LASTEXITCODE gate, Git Bash with '&&') and tell the agent to pick the
one its command tool runs. The shell-execution test now selects the
block by shell and adds a windows/git-bash case that runs the bash
variant under sh.

Co-authored-by: multica-agent <[email protected]>
2026-09-21 16:46:52 +08:00
b62cce56da MUL-7359 perf(runtime): avoid echoing final comment bodies (#8390)
* perf(runtime): avoid echoing final comment bodies

* refactor(daemon): keep the file-first guardrail as the Comment Formatting lede

The receipt-mode rule opened the section, pushing the file-first guardrail
(MUL-2904 / #4182 / MUL-4252) out of the lede. The guardrail is the section's
correctness red line — a shell-mangled body is a wrong comment — while the
receipt mode only decides how much of an already-correct comment is echoed
back. Move the rule after the guardrail in both OS variants; it is now a
single const so the two branches cannot drift.

Co-authored-by: multica-agent <[email protected]>

* docs(skills): drop the duplicated final-comment-receipt section

issues.md states its own charter as "Product contracts the runtime brief does
not fully encode", and SKILL.md gives the brief ownership of "when to
comment". The brief's ## Comment Formatting now carries this rule in full, so
the copy here duplicates a brief-owned instruction against the single-owner
convention (MUL-6984 #7971, MUL-5825 #6517).

It was also unreachable by the documented routing: the section was added to
the file's own table of contents, but SKILL.md's Routing row for issues.md was
not updated, so no task would route here for this topic.

Co-authored-by: multica-agent <[email protected]>

* fix(daemon): gate final-comment cleanup on the post succeeding

Agents hand the reply cookbook to one shell call. With cleanup as its own
statement, a failed post is followed by a cleanup that SUCCEEDS, so the call
exits 0 and ./reply.md is deleted. Under `--output table` a failed and a
successful post both write nothing to stdout, which leaves the exit status as
the only machine-checkable signal — masking it lets an agent end its turn
believing an unposted final result was delivered, and drops the body it would
need to retry with. The brief already told agents to check the posting
command's exit status; the rendered snippet made that impossible.

POSIX chains with `&&`. PowerShell 5.1 has no `&&` (it landed in 7), so the
Windows variant propagates $LASTEXITCODE instead. Both keep ./reply.md on
disk when the post fails.

The guard EXECUTES the rendered snippet against a stub CLI: this is a
shell-composition property, and the handler-level test can only prove the
command returns an error, not that the pasted block preserves it. Verified to
fail on the previous two-statement form. The pwsh case runs wherever
PowerShell is installed, including Linux runners, and skips otherwise.

Co-authored-by: multica-agent <[email protected]>

---------

Co-authored-by: J <[email protected]>
Co-authored-by: multica-agent <[email protected]>
2026-09-14 19:11:46 +08:00