mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:50:43 +00:00
fix(tests): restore progress draft changed gate
This commit is contained in:
@@ -49,6 +49,8 @@ Docs: https://docs.openclaw.ai
|
||||
|
||||
### Fixes
|
||||
|
||||
- Diagnostics: handle missing session-tail files in cron recovery context without tripping extension test typecheck. Thanks @vincentkoc.
|
||||
- QA/Slack: update the Slack dispatch preview fallback test SDK mock for structured progress draft helpers, so the rich progress draft regression suite covers the new imports instead of failing before assertions run. Thanks @vincentkoc.
|
||||
- Plugins/loader: keep bundled plugin package `test-api.js` aliases behind private QA mode, so source transforms do not expose test-only public surfaces during normal plugin loading. Thanks @vincentkoc.
|
||||
- Gateway/startup: start cron and record the post-ready memory trace even when deferred maintenance timers fail after readiness, so a non-fatal timer setup issue does not silently leave scheduled jobs idle. Thanks @vincentkoc.
|
||||
- Exec approvals: unwrap BSD/macOS `env -P <path>` carrier commands before approval-command and strict inline-eval checks, so `/approve` shell execution and inline interpreter payloads are still blocked behind that env form.
|
||||
|
||||
@@ -231,6 +231,21 @@ vi.mock("openclaw/plugin-sdk/channel-reply-pipeline", () => ({
|
||||
}));
|
||||
|
||||
vi.mock("openclaw/plugin-sdk/channel-streaming", () => ({
|
||||
buildChannelProgressDraftLine: (params: {
|
||||
progressText?: string;
|
||||
summary?: string;
|
||||
title?: string;
|
||||
name?: string;
|
||||
}) => {
|
||||
const text = params.progressText ?? params.summary ?? params.title ?? params.name;
|
||||
return text
|
||||
? {
|
||||
kind: "item",
|
||||
text,
|
||||
label: params.title ?? params.name ?? "Update",
|
||||
}
|
||||
: undefined;
|
||||
},
|
||||
createChannelProgressDraftGate: (params: { onStart: () => void | Promise<void> }) => {
|
||||
let started = false;
|
||||
let workEvents = 0;
|
||||
@@ -257,12 +272,14 @@ vi.mock("openclaw/plugin-sdk/channel-streaming", () => ({
|
||||
},
|
||||
formatChannelProgressDraftText: (params: {
|
||||
entry?: { streaming?: { progress?: { label?: string | false; maxLines?: number } } };
|
||||
lines: string[];
|
||||
lines: Array<string | { text: string }>;
|
||||
formatLine?: (line: string) => string;
|
||||
}) => {
|
||||
const label = params.entry?.streaming?.progress?.label;
|
||||
const formatLine = params.formatLine ?? ((line: string) => line);
|
||||
return [
|
||||
label === false ? undefined : (label ?? "Thinking"),
|
||||
...params.lines.map((line) => `• ${line}`),
|
||||
...params.lines.map((line) => `• ${formatLine(typeof line === "string" ? line : line.text)}`),
|
||||
]
|
||||
.filter((line): line is string => Boolean(line))
|
||||
.join("\n");
|
||||
@@ -276,6 +293,9 @@ vi.mock("openclaw/plugin-sdk/channel-streaming", () => ({
|
||||
resolveChannelProgressDraftMaxLines: (entry?: {
|
||||
streaming?: { progress?: { maxLines?: number } };
|
||||
}) => entry?.streaming?.progress?.maxLines ?? 8,
|
||||
resolveChannelProgressDraftRender: (entry?: {
|
||||
streaming?: { progress?: { render?: "text" | "rich" } };
|
||||
}) => entry?.streaming?.progress?.render ?? "text",
|
||||
resolveChannelStreamingBlockEnabled: () => mockedBlockStreamingEnabled,
|
||||
resolveChannelStreamingNativeTransport: () => mockedNativeStreaming,
|
||||
resolveChannelStreamingPreviewToolProgress: (entry?: {
|
||||
|
||||
@@ -91,4 +91,8 @@ describe("diagnostic session context", () => {
|
||||
|
||||
expect(readLastAssistantFromSessionFile(filePath)).toBe("newer");
|
||||
});
|
||||
|
||||
it("ignores missing transcript tail files", () => {
|
||||
expect(readLastAssistantFromSessionFile(path.join(tempDir!, "missing.jsonl"))).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user