diff --git a/extensions/msteams/src/messenger.test.ts b/extensions/msteams/src/messenger.test.ts index 977af0c9666..91f7aede491 100644 --- a/extensions/msteams/src/messenger.test.ts +++ b/extensions/msteams/src/messenger.test.ts @@ -1,4 +1,4 @@ -import { mkdtemp, rm, writeFile } from "node:fs/promises"; +import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises"; import os from "node:os"; import path from "node:path"; import { SILENT_REPLY_TOKEN, type PluginRuntime } from "openclaw/plugin-sdk"; @@ -178,8 +178,12 @@ describe("msteams messenger", () => { }); it("preserves parsed mentions when appending OneDrive fallback file links", async () => { - const tmpDir = await mkdtemp(path.join(os.tmpdir(), "msteams-mention-")); - const localFile = path.join(tmpDir, "note.txt"); + const previousStateDir = process.env.OPENCLAW_STATE_DIR; + const tmpStateDir = await mkdtemp(path.join(os.tmpdir(), "msteams-mention-state-")); + process.env.OPENCLAW_STATE_DIR = tmpStateDir; + const workspaceDir = path.join(tmpStateDir, "workspace"); + await mkdir(workspaceDir, { recursive: true }); + const localFile = path.join(workspaceDir, "note.txt"); await writeFile(localFile, "hello"); try { @@ -232,7 +236,12 @@ describe("msteams messenger", () => { }, ]); } finally { - await rm(tmpDir, { recursive: true, force: true }); + if (previousStateDir === undefined) { + delete process.env.OPENCLAW_STATE_DIR; + } else { + process.env.OPENCLAW_STATE_DIR = previousStateDir; + } + await rm(tmpStateDir, { recursive: true, force: true }); } }); diff --git a/src/channels/status-reactions.ts b/src/channels/status-reactions.ts index 266f4199e31..b31f19d74e6 100644 --- a/src/channels/status-reactions.ts +++ b/src/channels/status-reactions.ts @@ -50,14 +50,14 @@ export type StatusReactionController = { export const DEFAULT_EMOJIS: Required = { queued: "👀", - thinking: "🤔", - tool: "🔥", - coding: "👨‍💻", - web: "⚡", - done: "👍", - error: "😱", - stallSoft: "🥱", - stallHard: "😨", + thinking: "🧠", + tool: "🛠️", + coding: "💻", + web: "🌐", + done: "✅", + error: "❌", + stallSoft: "⏳", + stallHard: "⚠️", }; export const DEFAULT_TIMING: Required = { diff --git a/src/media-understanding/runner.auto-audio.test.ts b/src/media-understanding/runner.auto-audio.test.ts index c21841dc38a..16e021b571e 100644 --- a/src/media-understanding/runner.auto-audio.test.ts +++ b/src/media-understanding/runner.auto-audio.test.ts @@ -24,7 +24,9 @@ async function withAudioFixture( await fs.writeFile(tmpPath, Buffer.from("RIFF")); const ctx: MsgContext = { MediaPath: tmpPath, MediaType: "audio/wav" }; const media = normalizeMediaAttachments(ctx); - const cache = createMediaAttachmentCache(media); + const cache = createMediaAttachmentCache(media, { + localPathRoots: [os.tmpdir()], + }); try { await run({ ctx, media, cache }); diff --git a/src/media-understanding/runner.deepgram.test.ts b/src/media-understanding/runner.deepgram.test.ts index ac7082adbf4..3782956632c 100644 --- a/src/media-understanding/runner.deepgram.test.ts +++ b/src/media-understanding/runner.deepgram.test.ts @@ -17,7 +17,9 @@ describe("runCapability deepgram provider options", () => { await fs.writeFile(tmpPath, Buffer.from("RIFF")); const ctx: MsgContext = { MediaPath: tmpPath, MediaType: "audio/wav" }; const media = normalizeMediaAttachments(ctx); - const cache = createMediaAttachmentCache(media); + const cache = createMediaAttachmentCache(media, { + localPathRoots: [os.tmpdir()], + }); let seenQuery: Record | undefined; let seenBaseUrl: string | undefined; diff --git a/src/web/media.test.ts b/src/web/media.test.ts index ea50ecd1c73..a2395d6817c 100644 --- a/src/web/media.test.ts +++ b/src/web/media.test.ts @@ -6,6 +6,7 @@ import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from "vitest import { resolveStateDir } from "../config/paths.js"; import { sendVoiceMessageDiscord } from "../discord/send.js"; import * as ssrf from "../infra/net/ssrf.js"; +import { resolvePreferredOpenClawTmpDir } from "../infra/tmp-openclaw-dir.js"; import { optimizeImageToPng } from "../media/image-ops.js"; import { captureEnv } from "../test-utils/env.js"; import { @@ -50,7 +51,9 @@ async function createLargeTestJpeg(): Promise<{ buffer: Buffer; file: string }> } beforeAll(async () => { - fixtureRoot = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-media-test-")); + fixtureRoot = await fs.mkdtemp( + path.join(resolvePreferredOpenClawTmpDir(), "openclaw-media-test-"), + ); largeJpegBuffer = await sharp({ create: { width: 400, @@ -334,7 +337,9 @@ describe("local media root guard", () => { }); it("allows local paths under an explicit root", async () => { - const result = await loadWebMedia(tinyPngFile, 1024 * 1024, { localRoots: [os.tmpdir()] }); + const result = await loadWebMedia(tinyPngFile, 1024 * 1024, { + localRoots: [resolvePreferredOpenClawTmpDir()], + }); expect(result.kind).toBe("image"); });