mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-17 06:14:27 +02:00
test: tighten acpx memory assertions
This commit is contained in:
@@ -119,13 +119,10 @@ describe("patched claude-agent-acp completion", () => {
|
||||
expect(resolved).toBe(false);
|
||||
|
||||
query.push(makeIdleMessage());
|
||||
await expect(promptPromise).resolves.toMatchObject({
|
||||
stopReason: "end_turn",
|
||||
usage: {
|
||||
inputTokens: 1,
|
||||
outputTokens: 1,
|
||||
},
|
||||
});
|
||||
const result = await promptPromise;
|
||||
expect(result.stopReason).toBe("end_turn");
|
||||
expect(result.usage?.inputTokens).toBe(1);
|
||||
expect(result.usage?.outputTokens).toBe(1);
|
||||
});
|
||||
|
||||
it("does not resolve a prompt after a task-notification result goes idle", async () => {
|
||||
@@ -182,12 +179,9 @@ describe("patched claude-agent-acp completion", () => {
|
||||
expect(resolved).toBe(false);
|
||||
|
||||
query.push(makeIdleMessage());
|
||||
await expect(promptPromise).resolves.toMatchObject({
|
||||
stopReason: "end_turn",
|
||||
usage: {
|
||||
inputTokens: 2,
|
||||
outputTokens: 2,
|
||||
},
|
||||
});
|
||||
const result = await promptPromise;
|
||||
expect(result.stopReason).toBe("end_turn");
|
||||
expect(result.usage?.inputTokens).toBe(2);
|
||||
expect(result.usage?.outputTokens).toBe(2);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -255,7 +255,7 @@ describe("runCodexAppServerSideQuestion", () => {
|
||||
const forkCall = client.request.mock.calls[0];
|
||||
expect(forkCall?.[0]).toBe("thread/fork");
|
||||
const forkParams = forkCall?.[1] as Record<string, unknown> | undefined;
|
||||
expect(Object.keys(forkParams ?? {}).sort()).toEqual([
|
||||
expect(Object.keys(forkParams ?? {}).toSorted()).toEqual([
|
||||
"approvalPolicy",
|
||||
"approvalsReviewer",
|
||||
"config",
|
||||
|
||||
@@ -449,11 +449,9 @@ describe("memory index", () => {
|
||||
managersForCleanup.add(second);
|
||||
|
||||
const cachedBeforeProbe = second.getCachedEmbeddingAvailability?.();
|
||||
expect(cachedBeforeProbe).toMatchObject({
|
||||
ok: true,
|
||||
checked: true,
|
||||
cached: true,
|
||||
});
|
||||
expect(cachedBeforeProbe?.ok).toBe(true);
|
||||
expect(cachedBeforeProbe?.checked).toBe(true);
|
||||
expect(cachedBeforeProbe?.cached).toBe(true);
|
||||
expect(cachedBeforeProbe?.checkedAtMs).toBeTypeOf("number");
|
||||
expect(cachedBeforeProbe?.cacheExpiresAtMs).toBeTypeOf("number");
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user