mirror of https://github.com/openclaw/openclaw.git
style: format sandbox and helper files
This commit is contained in:
parent
5e0e46f405
commit
62e13bbf21
|
|
@ -46,7 +46,9 @@ function toExecLikeRequest(request: ApprovalRequest): ExecApprovalRequest {
|
|||
};
|
||||
}
|
||||
|
||||
function extractSlackSessionKind(sessionKey?: string | null): "direct" | "channel" | "group" | null {
|
||||
function extractSlackSessionKind(
|
||||
sessionKey?: string | null,
|
||||
): "direct" | "channel" | "group" | null {
|
||||
if (!sessionKey) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { collectDockerFlagValues, findDockerArgsCall } from "./test-args.js";
|
||||
import { SANDBOX_MOUNT_FORMAT_VERSION } from "./workspace-mounts.js";
|
||||
import type { SandboxConfig } from "./types.js";
|
||||
import { SANDBOX_MOUNT_FORMAT_VERSION } from "./workspace-mounts.js";
|
||||
|
||||
let BROWSER_BRIDGES: Map<string, unknown>;
|
||||
let ensureSandboxBrowser: typeof import("./browser.js").ensureSandboxBrowser;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
import { computeSandboxBrowserConfigHash, computeSandboxConfigHash } from "./config-hash.js";
|
||||
import { SANDBOX_MOUNT_FORMAT_VERSION } from "./workspace-mounts.js";
|
||||
import type { SandboxDockerConfig } from "./types.js";
|
||||
import { SANDBOX_MOUNT_FORMAT_VERSION } from "./workspace-mounts.js";
|
||||
|
||||
function createDockerConfig(overrides?: Partial<SandboxDockerConfig>): SandboxDockerConfig {
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ import { Readable } from "node:stream";
|
|||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { computeSandboxConfigHash } from "./config-hash.js";
|
||||
import { collectDockerFlagValues } from "./test-args.js";
|
||||
import { SANDBOX_MOUNT_FORMAT_VERSION } from "./workspace-mounts.js";
|
||||
import type { SandboxConfig } from "./types.js";
|
||||
import { SANDBOX_MOUNT_FORMAT_VERSION } from "./workspace-mounts.js";
|
||||
|
||||
type SpawnCall = {
|
||||
command: string;
|
||||
|
|
@ -336,6 +336,8 @@ describe("ensureSandboxContainer config-hash recreation", () => {
|
|||
(call) => call.command === "docker" && call.args[0] === "create",
|
||||
);
|
||||
expect(createCall).toBeDefined();
|
||||
expect(createCall?.args).toContain(`openclaw.mountFormatVersion=${SANDBOX_MOUNT_FORMAT_VERSION}`);
|
||||
expect(createCall?.args).toContain(
|
||||
`openclaw.mountFormatVersion=${SANDBOX_MOUNT_FORMAT_VERSION}`,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -58,9 +58,6 @@ describe("appendWorkspaceMountArgs", () => {
|
|||
});
|
||||
|
||||
const mounts = args.filter((arg) => arg.startsWith("/tmp/"));
|
||||
expect(mounts).toEqual([
|
||||
"/tmp/workspace:/workspace:ro,z",
|
||||
"/tmp/agent-workspace:/agent:ro,z",
|
||||
]);
|
||||
expect(mounts).toEqual(["/tmp/workspace:/workspace:ro,z", "/tmp/agent-workspace:/agent:ro,z"]);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -324,9 +324,7 @@ export function resolveMemorySlotDecision(params: {
|
|||
// memory slot must stay enabled so its other slot role can still load.
|
||||
const isMultiKind = Array.isArray(params.kind) && params.kind.length > 1;
|
||||
if (params.slot === null) {
|
||||
return isMultiKind
|
||||
? { enabled: true }
|
||||
: { enabled: false, reason: "memory slot disabled" };
|
||||
return isMultiKind ? { enabled: true } : { enabled: false, reason: "memory slot disabled" };
|
||||
}
|
||||
if (typeof params.slot === "string") {
|
||||
if (params.slot === params.id) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue