feat(agents): group activity tool bursts (#1571)

Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w <52a228d6edf316ec6812ac3c9fc0d696ab59fc7954d77e7be31eedcddf91335b@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub14vtk7pvazqrq9639qu7e560wnqtl0d53ca4gjuvq6jzf3k2el23qqlwa7f <ab176f059d100602ea25073d9a69ee9817f7b691c76a897180d48498d959faa2@sprout-oss.stage.blox.sqprod.co>
This commit is contained in:
Taylor Ho
2026-07-07 08:34:21 -07:00
committed by GitHub
parent c97263901f
commit 426f044844
8 changed files with 704 additions and 60 deletions

View File

@@ -1179,3 +1179,56 @@ test("observer feed renders system-prompt before prompt-context in display order
"system-prompt item must have turnId=null",
);
});
test("steer ingress bundles its prompt context into the steer prompt segment, not a standalone row", () => {
// The stray "Prompt context · 1 section" row was leaking from the goose
// session/steer path: it upserted metadata without an acpSource, so display
// grouping never consumed it into a prompt bundle. It must now ride behind
// the steer message bubble's checks-icon dialog like session/prompt context.
const events = [
{
seq: 1,
timestamp: "2026-07-01T10:00:00.000Z",
kind: "acp_write",
agentIndex: 0,
channelId: "ch-1",
sessionId: "sess-1",
turnId: "turn-1",
payload: {
jsonrpc: "2.0",
id: 5,
method: "_goose/unstable/session/steer",
params: {
sessionId: "sess-1",
prompt: [
{
type: "text",
text: `[Buzz event: @mention]\nEvent ID: ${"e".repeat(64)}\nFrom: x (hex: ${"f".repeat(64)})\nContent: steer me`,
},
{ type: "text", text: "[Thread context]\nPrior messages here." },
],
},
},
},
];
const rawItems = buildTranscript(events);
const steerMessage = rawItems.find((item) => item.type === "message");
const steerContext = rawItems.find((item) => item.type === "metadata");
assert.equal(steerMessage?.acpSource, "session/steer:user");
assert.equal(steerContext?.acpSource, "session/steer:context");
const [block] = buildTranscriptDisplayBlocks(rawItems);
assert.equal(block.kind, "turn");
const promptSegment = block.segments.find(
(segment) => segment.kind === "prompt",
);
assert.ok(promptSegment, "expected steer message to render a prompt bundle");
assert.equal(promptSegment.context?.id, steerContext.id);
assert.ok(
!block.segments.some(
(segment) => segment.kind === "item" && segment.item.type === "metadata",
),
"steer context must not leak as a standalone metadata row",
);
});