mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-09 04:03:59 +00:00
fix(qa-channel): handle metadata-free final replies
Fix qa-channel final reply preview delivery when a harness or plugin path calls deliver without dispatcher metadata. Verified with remote Testbox proof plus hosted PR checks.
This commit is contained in:
@@ -118,6 +118,26 @@ describe("handleQaInbound", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("treats deliveries without dispatcher metadata as final replies", async () => {
|
||||
const runtime = createPluginRuntimeMock();
|
||||
setQaChannelRuntime(runtime);
|
||||
|
||||
await handleQaInbound(createQaInboundParams());
|
||||
|
||||
const assembled = firstRunAssembledParams(runtime);
|
||||
await assembled.replyOptions?.onPartialReply?.({ text: "preview" });
|
||||
const deliverWithoutInfo = assembled.delivery.deliver as (payload: {
|
||||
text: string;
|
||||
}) => Promise<unknown>;
|
||||
await deliverWithoutInfo({ text: "final answer" });
|
||||
|
||||
expect(sendQaBusMessage).toHaveBeenCalledOnce();
|
||||
expect(editQaBusMessage).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ messageId: "preview-1", text: "final answer" }),
|
||||
);
|
||||
expect(deleteQaBusMessage).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("keeps block deliveries separate and retains tool calls discovered after a preview", async () => {
|
||||
const runtime = createPluginRuntimeMock();
|
||||
setQaChannelRuntime(runtime);
|
||||
|
||||
@@ -372,7 +372,7 @@ export async function handleQaInbound(params: {
|
||||
if (!text.trim()) {
|
||||
return;
|
||||
}
|
||||
await preview.deliver(text, info.kind);
|
||||
await preview.deliver(text, info?.kind ?? "final");
|
||||
},
|
||||
onError: (error) => {
|
||||
void preview.clear().catch((clearError: unknown) => {
|
||||
|
||||
Reference in New Issue
Block a user