fix(acp): default parent commentary in progress mode

This commit is contained in:
Ayaan Zaidi
2026-06-04 13:42:25 +00:00
parent 88f78190ee
commit 8fdfb2d7e3
2 changed files with 26 additions and 9 deletions

View File

@@ -546,29 +546,44 @@ describe("startAcpSpawnParentStreamRelay", () => {
relay.dispose();
});
it("does not default commentary on for generic progress-mode channels", () => {
it.each([
{
label: "generic",
channelId: "forum",
deliveryContext: progressCommentaryDeliveryContext,
},
{
label: "Telegram",
channelId: "telegram",
deliveryContext: {
...progressCommentaryDeliveryContext,
channel: "telegram",
},
},
])("defaults commentary on for $label parent progress mode", ({ channelId, deliveryContext }) => {
const runId = `run-${channelId}-commentary-default`;
const relay = startAcpSpawnParentStreamRelay({
runId: "run-generic-commentary-default",
runId,
parentSessionKey: "agent:main:main",
childSessionKey: "agent:codex:acp:child-generic-commentary-default",
childSessionKey: `agent:codex:acp:child-${channelId}-commentary-default`,
agentId: "codex",
cfg: {
channels: {
forum: {
[channelId]: {
streaming: {
mode: "progress",
},
},
},
},
deliveryContext: progressCommentaryDeliveryContext,
deliveryContext,
streamFlushMs: 10,
noOutputNoticeMs: 120_000,
emitStartNotice: false,
});
emitAgentEvent({
runId: "run-generic-commentary-default",
runId,
stream: "assistant",
data: {
delta: "checking thread context; then post a tight progress reply here.",
@@ -577,7 +592,10 @@ describe("startAcpSpawnParentStreamRelay", () => {
});
vi.advanceTimersByTime(15);
expect(collectedTexts()).toEqual([]);
expectTextWithFragment(
collectedTexts(),
"codex: checking thread context; then post a tight progress reply here.",
);
relay.dispose();
});

View File

@@ -198,10 +198,9 @@ function resolveParentProgressCommentary(params: {
cfg: OpenClawConfig | undefined;
deliveryContext: DeliveryContext | undefined;
}): boolean {
const channelId = normalizeOptionalString(params.deliveryContext?.channel);
return resolveChannelStreamingProgressCommentary(
resolveParentProgressStreamingEntry(params),
channelId === "discord",
true,
);
}