mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-24 09:09:34 +00:00
fix(acp): default parent commentary in progress mode
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user