mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 16:04:33 +00:00
fix(tui): strip inbound metadata blocks from user messages (clean rewrite) (#22345)
* fix(tui): strip inbound metadata blocks from user text * chore: clean up metadata-strip format and changelog credit * chore: format tui metadata-strip tests * test: align metadata-strip regression expectations * refactor: reuse canonical inbound metadata stripper * test: allow tmp media fixture paths in media-understanding tests * refactor: reuse canonical inbound metadata stripper * format: fix changelog blank line after headings * test: fix unrelated check typing regressions * test: align memory async mock embedding signatures * test: avoid tsgo mock typing pitfall * test: restore async search mock typings in merge tree * test: trigger ci rerun without behavior change * chore: dedupe todays changelog entries * fix: dedupe sqlite mock keys in qmd manager test * Update qmd-manager.test.ts * test: align chat metadata sanitization expectation
This commit is contained in:
@@ -7,8 +7,8 @@ import { getMemorySearchManager, type MemoryIndexManager } from "./index.js";
|
||||
import { createOpenAIEmbeddingProviderMock } from "./test-embeddings-mock.js";
|
||||
import { createMemoryManagerOrThrow } from "./test-manager.js";
|
||||
|
||||
const embedBatch = vi.fn(async (_input: string[]) => [] as number[][]);
|
||||
const embedQuery = vi.fn(async (_input: string) => [0.2, 0.2, 0.2] as number[]);
|
||||
const embedBatch = vi.fn(async (_input: string[]): Promise<number[][]> => []);
|
||||
const embedQuery = vi.fn(async (_input: string): Promise<number[]> => [0.2, 0.2, 0.2]);
|
||||
|
||||
vi.mock("./embeddings.js", () => ({
|
||||
createEmbeddingProvider: async (_options: unknown) =>
|
||||
@@ -61,7 +61,6 @@ describe("memory search async sync", () => {
|
||||
|
||||
it("does not await sync when searching", async () => {
|
||||
const cfg = buildConfig();
|
||||
|
||||
manager = await createMemoryManagerOrThrow(cfg);
|
||||
|
||||
const pending = new Promise<void>(() => {});
|
||||
@@ -78,9 +77,9 @@ describe("memory search async sync", () => {
|
||||
|
||||
it("waits for in-flight search sync during close", async () => {
|
||||
const cfg = buildConfig();
|
||||
let releaseSync!: (value?: void) => void;
|
||||
let releaseSync = () => {};
|
||||
const syncGate = new Promise<void>((resolve) => {
|
||||
releaseSync = resolve;
|
||||
releaseSync = () => resolve();
|
||||
});
|
||||
embedBatch.mockImplementation(async (input: string[]) => {
|
||||
await syncGate;
|
||||
|
||||
Reference in New Issue
Block a user