Skip to content

Commit 5e66812

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/docker-preserve-runtime-deps
2 parents 6ac86d7 + 241911c commit 5e66812

6 files changed

Lines changed: 46 additions & 10 deletions

File tree

‎extensions/browser/src/browser-tool.test.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,7 +1709,8 @@ describe("browser tool snapshot maxChars", () => {
17091709
expect(imageParams.extraText).toContain(
17101710
JSON.stringify("/tmp/openclaw-media/outbound/share.png"),
17111711
);
1712-
expect(imageParams.extraText).toContain("message tool");
1712+
expect(imageParams.extraText).toContain("sanitized outbound copy");
1713+
expect(imageParams.extraText).not.toContain("message tool");
17131714
expect(imageParams.details?.media).toEqual({ outbound: false });
17141715
expect(toolCommonMocks.stageBrowserScreenshotForSharing).toHaveBeenCalledWith(
17151716
"/tmp/test.png",
@@ -1796,7 +1797,8 @@ describe("browser tool snapshot maxChars", () => {
17961797
expect(joined).toContain("[neutralized] MEDIA:/tmp/secret.png");
17971798
expect(joined).toContain("/tmp/secret.png");
17981799
expect(joined).toContain(JSON.stringify("/tmp/openclaw-media/outbound/share.png"));
1799-
expect(joined).toContain("message tool");
1800+
expect(joined).toContain("sanitized outbound copy");
1801+
expect(joined).not.toContain("message tool");
18001802
// The vision-success path must not surface raw screenshot media via
18011803
// details.media so channel auto-delivery cannot grab the screenshot.
18021804
expect((out?.details as Record<string, unknown>)?.media).toBeUndefined();
@@ -1851,7 +1853,8 @@ describe("browser tool snapshot maxChars", () => {
18511853
expect(imageParams.extraText).toContain(
18521854
JSON.stringify("/tmp/openclaw-media/outbound/share.png"),
18531855
);
1854-
expect(imageParams.extraText).toContain("message tool");
1856+
expect(imageParams.extraText).toContain("sanitized outbound copy");
1857+
expect(imageParams.extraText).not.toContain("message tool");
18551858
expect(imageParams.details?.media).toEqual({ outbound: false });
18561859
});
18571860

‎extensions/browser/src/browser-tool.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ function readTargetUrlParam(params: Record<string, unknown>) {
115115
}
116116

117117
function formatScreenshotShareHint(filePath: string): string {
118-
return `[Screenshot saved to ${JSON.stringify(filePath)}. Use this path with the message tool to share the screenshot explicitly.]`;
118+
return `[Screenshot saved to ${JSON.stringify(filePath)}. A sanitized outbound copy is ready at this path for explicit sharing.]`;
119119
}
120120

121121
const SCREENSHOT_SHARE_UNAVAILABLE =
@@ -799,7 +799,7 @@ export function createBrowserTool(opts?: {
799799
// Screenshot viewing remains useful when optional outbound staging fails.
800800
}
801801
// Screenshots stay in the tool result for agent vision, but channel
802-
// delivery must remain an explicit message-tool action.
802+
// delivery must remain an explicit outbound-delivery action.
803803
const screenshotDetails = {
804804
...(result as Record<string, unknown>),
805805
media: { outbound: false },
@@ -846,7 +846,7 @@ export function createBrowserTool(opts?: {
846846
// a text description as the deliverable output. Exposing the raw
847847
// screenshot as media would cause channel delivery to auto-send
848848
// potentially sensitive page content. The text block carries the
849-
// staged outbound-copy path for an explicit message-tool send.
849+
// staged outbound-copy path for an explicit outbound-delivery send.
850850
vision: {
851851
provider: described.provider,
852852
model: described.model,

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1951,7 +1951,7 @@
19511951
"test:voicecall:closedloop": "node --import tsx scripts/test-voicecall-closedloop.mts",
19521952
"test:watch": "node --import tsx scripts/test-projects.mts --watch",
19531953
"test:windows:ci": "pnpm test:windows:ci:1 && pnpm test:windows:ci:2",
1954-
"test:windows:ci:1": "node --import tsx scripts/test-projects.mts src/state/openclaw-state-ownership.test.ts src/snapshot/local-repository.windows.test.ts src/state/openclaw-database-paths.windows.test.ts src/node-host/invoke-system-run-allowlist.test.ts src/node-host/node-worker-transfer-client.test.ts packages/terminal-core/src/display-string.test.ts src/config/sessions/session-accessor.sqlite-archive.worker.test.ts src/commands/doctor-gateway-auth-token.windows.test.ts src/commands/backup-verify.test.ts src/commands/agents.commands.list.test.ts src/shared/runtime-import.test.ts test/scripts/direct-run-entrypoints.test.ts test/scripts/format-generated-module.test.ts test/scripts/openclaw-cross-os-installer.windows.test.ts test/scripts/openclaw-cross-os-release-workflow.test.ts test/scripts/pnpm-runner.test.ts test/scripts/run-with-env.test.ts test/scripts/ui.test.ts test/scripts/vitest-process-group.test.ts src/agents/tools/media-tool-file-url.windows.test.ts extensions/memory-core/src/memory-extra-file-path.windows.test.ts src/daemon/schtasks.startup-fallback.test.ts src/plugin-sdk/node-host.test.ts test/e2e/qa-lab/runtime/package-openclaw-for-docker.e2e.test.ts extensions/lobster/src/lobster-runner.test.ts",
1954+
"test:windows:ci:1": "node --import tsx scripts/test-projects.mts src/state/openclaw-state-ownership.test.ts src/snapshot/local-repository.windows.test.ts src/state/openclaw-database-paths.windows.test.ts src/node-host/invoke-system-run-allowlist.test.ts src/node-host/node-worker-transfer-client.test.ts packages/terminal-core/src/display-string.test.ts src/config/sessions/session-accessor.sqlite-archive.worker.test.ts src/commands/doctor-gateway-auth-token.windows.test.ts src/infra/state-migrations.audit-logs.windows.test.ts src/commands/backup-verify.test.ts src/commands/agents.commands.list.test.ts src/shared/runtime-import.test.ts test/scripts/direct-run-entrypoints.test.ts test/scripts/format-generated-module.test.ts test/scripts/openclaw-cross-os-installer.windows.test.ts test/scripts/openclaw-cross-os-release-workflow.test.ts test/scripts/pnpm-runner.test.ts test/scripts/run-with-env.test.ts test/scripts/ui.test.ts test/scripts/vitest-process-group.test.ts src/agents/tools/media-tool-file-url.windows.test.ts extensions/memory-core/src/memory-extra-file-path.windows.test.ts src/daemon/schtasks.startup-fallback.test.ts src/plugin-sdk/node-host.test.ts test/e2e/qa-lab/runtime/package-openclaw-for-docker.e2e.test.ts extensions/lobster/src/lobster-runner.test.ts",
19551955
"test:windows:ci:2": "node --import tsx scripts/test-projects.mts src/infra/sqlite-snapshot.test.ts src/infra/ports.test.ts src/infra/advertised-lan-host.windows.test.ts src/infra/update-managed-service-handoff-command.test.ts src/infra/update-managed-service-handoff-lifecycle.test.ts src/infra/executable-path.test.ts src/infra/fs-safe-remove.test.ts src/infra/state-migrations.legacy-session-store.test.ts src/infra/windows-install-roots.test.ts src/infra/ssh-client.windows.test.ts src/infra/exec-allowlist-pattern.test.ts src/infra/process-env.test.ts src/agents/sessions/windows-git-bash-path.test.ts test/scripts/npm-runner.test.ts test/scripts/ts-topology.test.ts src/test-utils/openclaw-test-state.test.ts src/utils.test.ts src/media/local-media-path.windows.test.ts src/media/web-media.file-url.windows.test.ts src/process/exec.windows.test.ts src/process/exec.windows.integration.test.ts src/process/windows-command.test.ts src/process/terminal-pty.test.ts src/tui/tui.resolve-codex-bin.test.ts src/media-understanding/attachments.file-url.windows.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/mcp-cli.path-case.windows.test.ts src/auto-reply/usage-bar/template.windows.test.ts src/auto-reply/reply.triggers.trigger-handling.stages-inbound-media-into-sandbox-workspace.test.ts src/agents/provider-local-service.env-case.test.ts src/agents/bash-tools.exec.script-preflight.test.ts src/agents/agent-tools.read.windows.test.ts src/agents/agent-tools.read.host-operations.test.ts src/agents/sandbox/fs-paths.test.ts src/agents/sessions/tools/render-utils.test.ts src/agents/sessions/tools/path-utils.test.ts extensions/msteams/src/media-helpers.test.ts extensions/msteams/src/messenger.test.ts extensions/mxc/test/mxc-backend.test.ts extensions/mxc/test/sandbox-policy-loader.test.ts",
19561956
"test:windows:schtasks:integration": "node --import tsx scripts/run-with-env.mts CI_WINDOWS_SCHTASKS_INTEGRATION=1 OPENCLAW_E2E_VERBOSE=1 OPENCLAW_VITEST_MAX_WORKERS=1 -- node scripts/run-vitest.mjs src/daemon/schtasks.integration.e2e.test.ts",
19571957
"tool-display:check": "node --import tsx scripts/tool-display.ts --check",

‎src/infra/state-migrations.audit-logs.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ async function secureAuditArchiveFile(params: {
9999
warnings: string[];
100100
}): Promise<boolean> {
101101
try {
102-
const opened = await params.root.open(params.relativePath);
102+
const opened = await params.root.openWritable(params.relativePath, {
103+
writeMode: "update",
104+
});
103105
try {
104106
await opened.handle.chmod(0o600);
105107
await opened.handle.sync();
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { afterEach, describe, expect, it } from "vitest";
2+
import { resetPluginStateStoreForTests } from "../plugin-state/plugin-state-store.js";
3+
import {
4+
configAuditRecord,
5+
systemAuditEvent,
6+
withAuditMigrationFixture,
7+
} from "./state-migrations.audit.test-support.js";
8+
9+
describe.skipIf(process.platform !== "win32")("legacy audit migration on Windows", () => {
10+
afterEach(resetPluginStateStoreForTests);
11+
12+
it("secures and imports both legacy audit logs without read-only fsync failures", async () => {
13+
await withAuditMigrationFixture(async (audit) => {
14+
try {
15+
await audit.writeJsonLines(audit.config.source, [configAuditRecord("windows-fsync")]);
16+
await audit.writeJsonLines(audit.system.source, [systemAuditEvent("Windows migration")]);
17+
18+
const result = await audit.migrate();
19+
20+
expect(result.warnings).toEqual([]);
21+
expect(audit.detect().hasLegacy).toBe(false);
22+
} finally {
23+
resetPluginStateStoreForTests();
24+
}
25+
});
26+
});
27+
});

‎src/infra/state-migrations.audit-recovery.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,9 @@ async function writeAuditRecoveryProgress(params: {
235235
mkdir: false,
236236
mode: 0o600,
237237
});
238-
const opened = await params.root.open(progressRelativePath);
238+
const opened = await params.root.openWritable(progressRelativePath, {
239+
writeMode: "update",
240+
});
239241
try {
240242
await opened.handle.chmod(0o600);
241243
await opened.handle.sync();
@@ -353,7 +355,9 @@ async function stageAuditRecoveryRestore(params: {
353355
},
354356
});
355357
await params.root.create(stagingRelativePath, journalRaw, { mode: 0o600 });
356-
const staged = await params.root.open(stagingRelativePath);
358+
const staged = await params.root.openWritable(stagingRelativePath, {
359+
writeMode: "update",
360+
});
357361
try {
358362
await staged.handle.chmod(0o600);
359363
await staged.handle.sync();

0 commit comments

Comments
 (0)