feat(desktop): gate ACP tool summaries behind a preview experiment

Two-layer prod-safe gate for the acpToolSummaries experiment, default OFF:

UI gate: buildCompactToolSummary now takes summaryTitleEnabled (default
off) and only consults the agent-provided friendly phrase when the
experiment is on. ToolItem and BotActivityBar/getActivityHeadline read
useFeatureEnabled('acpToolSummaries') and thread the flag through.
Failure-precedence behavior is unchanged: failed rows always paint the
failure label regardless of the gate.

Runtime/cost gate: the frontend mirrors preview-experiment overrides to
experiments.json via the new set_desktop_experiments command (AppShell
mirrors on boot and on every toggle); spawn_agent_child sets
BUZZ_AGENT_NO_TOOL_SUMMARY=1 when the experiment is off so disabled
agents never spend the async LLM summary call. All spawn paths (start,
create, app-startup restore) funnel through spawn_agent_child, and
missing/unknown mirror state resolves to off — restore-time respawns
before the webview loads stay on the safe side. Experiment-on leaves
the env untouched, so a user-provided kill switch still wins.

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
This commit is contained in:
npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w
2026-07-07 00:28:45 -07:00
parent 8720b5d1ef
commit d4b625037e
19 changed files with 392 additions and 14 deletions

View File

@@ -49,6 +49,22 @@ test("getActivityHeadline formats tool titles and assistant text", () => {
assert.equal(getActivityHeadline(makeMessage({ text: " " })), "Responding");
});
test("getActivityHeadline gates the friendly summaryTitle on the experiment", () => {
const tool = makeTool({ summaryTitle: "sending a status update" });
// Off (default): raw tool label, friendly phrase never consulted.
assert.equal(getActivityHeadline(tool), "Send Message · abc");
assert.equal(
getActivityHeadline(tool, { summaryTitleEnabled: false }),
"Send Message · abc",
);
// On: friendly phrase wins the headline.
assert.equal(
getActivityHeadline(tool, { summaryTitleEnabled: true }),
"sending a status update · abc",
);
});
test("isMeaningfulItem ignores lifecycle noise and raw JSON-RPC metadata", () => {
assert.equal(
isMeaningfulItem({