Files
openclaw/src/plugin-sdk/reply-runtime.contract.test.ts
T
Dallin Romney 83d53044a4 fix(channels): route commentary through one progress owner (#121009)
* fix(slack): keep commentary progress on draft lane

* fix(channels): route commentary through one progress owner

Keep non-verbose commentary in Slack and Discord draft lanes while preserving one durable commentary payload when verbose progress makes those drafts yield. Freeze that owner decision for the turn so session changes apply on the next turn.

Co-authored-by: Dallin Romney <dallinromney@gmail.com>

Punchcard-Session: amber-workshop-workshop-36

* fix(channels): refresh queued commentary owner

Recompute the frozen draft-versus-durable commentary owner for every queued follow-up turn and carry that decision into final payload projection.

Punchcard-Session: amber-workshop-workshop-36

* fix(channels): clarify commentary owner opt-in

* fix(channels): preserve queued draft preambles

* fix(channels): require explicit queued progress ownership

* refactor(channels): record commentary progress owner

* fix(telegram): tolerate unscoped queued updates

* test(discord): use canonical draft fixture after rebase

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-08-14 22:15:53 +08:00

45 lines
1.5 KiB
TypeScript

import { describe, expectTypeOf, it } from "vitest";
import type { GetReplyOptions } from "./reply-runtime.js";
type ProgressResult = boolean | void;
type ProgressCallback = GetReplyOptions[
| "onToolResult"
| "onToolStart"
| "onItemEvent"
| "onPlanUpdate"
| "onApprovalEvent"
| "onCommandOutput"
| "onPatchSummary"];
type ProgressBoundaryCallback = GetReplyOptions[
| "onReasoningEnd"
| "onAssistantMessageStart"
| "onBlockReplyQueued"
| "onCompactionStart"
| "onCompactionEnd"];
describe("reply runtime public progress contracts", () => {
it("exports acceptance-aware progress callback results", () => {
expectTypeOf<Exclude<ProgressCallback, undefined>>().returns.toEqualTypeOf<
Promise<ProgressResult> | ProgressResult
>();
expectTypeOf<Exclude<GetReplyOptions["onPartialReply"], undefined>>().returns.toEqualTypeOf<
Promise<ProgressResult> | ProgressResult
>();
expectTypeOf<Exclude<GetReplyOptions["onReasoningStream"], undefined>>().returns.toEqualTypeOf<
Promise<ProgressResult> | ProgressResult
>();
expectTypeOf<Exclude<ProgressBoundaryCallback, undefined>>().returns.toEqualTypeOf<
Promise<ProgressResult> | ProgressResult
>();
});
it("exports the snapshotted commentary delivery gate", () => {
expectTypeOf<GetReplyOptions["commentaryPayloadsEnabled"]>().toEqualTypeOf<
boolean | undefined
>();
expectTypeOf<
Exclude<GetReplyOptions["shouldDeliverCommentaryPayloads"], undefined>
>().returns.toEqualTypeOf<boolean>();
});
});