diff --git a/src/agents/context-window-guard.test.ts b/src/agents/context-window-guard.test.ts index ab908ba9a53d..87c025e8d70a 100644 --- a/src/agents/context-window-guard.test.ts +++ b/src/agents/context-window-guard.test.ts @@ -2,7 +2,6 @@ import { describe, expect, it } from "vitest"; import type { OpenClawConfig } from "../config/config.js"; import { - CONTEXT_WINDOW_HARD_MIN_TOKENS, evaluateContextWindowGuard, formatContextWindowBlockMessage, formatContextWindowWarningMessage, @@ -312,10 +311,6 @@ describe("context-window-guard", () => { expect(guard.shouldBlock).toBe(false); }); - it("exports the public hard-min floor as expected", () => { - expect(CONTEXT_WINDOW_HARD_MIN_TOKENS).toBe(4_000); - }); - it("derives percentage-based guard thresholds above the safe floors", () => { const largeGuard = evaluateContextWindowGuard({ info: { tokens: 1_000_000, source: "model" }, diff --git a/src/agents/embedded-agent-runner/tool-result-truncation.test.ts b/src/agents/embedded-agent-runner/tool-result-truncation.test.ts index 4334faf6eb6a..1fc6acf1c773 100644 --- a/src/agents/embedded-agent-runner/tool-result-truncation.test.ts +++ b/src/agents/embedded-agent-runner/tool-result-truncation.test.ts @@ -511,11 +511,6 @@ describe("calculateMaxToolResultChars", () => { expect(DEFAULT_MAX_LIVE_TOOL_RESULT_CHARS).toBe(16_000); }); - it("auto-scales above the low-context cap for very large windows", () => { - const result = calculateMaxToolResultChars(2_000_000); // 2M token window - expect(result).toBeGreaterThan(DEFAULT_MAX_LIVE_TOOL_RESULT_CHARS); - }); - it("uses a larger auto cap for 128K contexts", () => { const result = calculateMaxToolResultChars(128_000); expect(result).toBe(32_000); diff --git a/src/logging/levels.test.ts b/src/logging/levels.test.ts index 5b0ab610a9e2..d2e6707688c5 100644 --- a/src/logging/levels.test.ts +++ b/src/logging/levels.test.ts @@ -1,6 +1,5 @@ // Log level tests cover allowed levels and level ordering. -import { expectDefined } from "@openclaw/normalization-core"; import { describe, expect, it } from "vitest"; import { levelToMinLevel } from "./levels.js"; @@ -17,19 +16,4 @@ describe("levelToMinLevel", () => { it("maps silent to Infinity to suppress all logs", () => { expect(levelToMinLevel("silent")).toBe(Number.POSITIVE_INFINITY); }); - - it("fatal has a higher value than trace (not inverted)", () => { - expect(levelToMinLevel("fatal")).toBeGreaterThan(levelToMinLevel("trace")); - }); - - it("each level is strictly more restrictive than the one below it", () => { - const ordered = ["trace", "debug", "info", "warn", "error", "fatal"] as const; - for (let i = 1; i < ordered.length; i++) { - expect( - levelToMinLevel(expectDefined(ordered[i], "ordered[i] test invariant")), - ).toBeGreaterThan( - levelToMinLevel(expectDefined(ordered[i - 1], "ordered[i - 1] test invariant")), - ); - } - }); }); diff --git a/test/scripts/bench-model.test.ts b/test/scripts/bench-model.test.ts index f0e4cfe3b14f..c75f700bd883 100644 --- a/test/scripts/bench-model.test.ts +++ b/test/scripts/bench-model.test.ts @@ -27,8 +27,6 @@ describe("scripts/bench-model", () => { }); it("rejects unknown args before checking provider credentials", () => { - expect(() => testing.parseArgs(["--wat"])).toThrow("Unknown argument: --wat"); - const result = runBenchModel(["--wat"]); expect(result.status).toBe(1); diff --git a/test/scripts/summarize-cpuprofile.test.ts b/test/scripts/summarize-cpuprofile.test.ts index fc6885cd7634..eda4aa1b5952 100644 --- a/test/scripts/summarize-cpuprofile.test.ts +++ b/test/scripts/summarize-cpuprofile.test.ts @@ -23,8 +23,6 @@ describe("scripts/perf/summarize-cpuprofile.mjs", () => { }); it("prints help without treating it as a profile path", () => { - expect(shouldPrintHelp(["--help"])).toBe(true); - expect(shouldPrintHelp(["--limit", "-h", "a.cpuprofile"])).toBe(false); expect(shouldPrintHelp(["--limit", "--", "--help"])).toBe(false); expect(shouldPrintHelp(["--limit=1e3", "--help"])).toBe(false); expect(shouldPrintHelp(["--", "--help"])).toBe(false); @@ -46,7 +44,6 @@ describe("scripts/perf/summarize-cpuprofile.mjs", () => { it("rejects malformed limit flags instead of falling back", () => { for (const args of [ ["--limit", "3frames", "a.cpuprofile"], - ["--limit", "-h", "a.cpuprofile"], ["--limit", "--", "--help"], ["--limit", "0", "a.cpuprofile"], ["--limit=1e3", "a.cpuprofile"], @@ -70,8 +67,6 @@ describe("scripts/perf/summarize-cpuprofile.mjs", () => { }); it("rejects unknown options instead of treating them as profile paths", () => { - expect(() => parseArgs(["--wat"])).toThrow("Unknown option: --wat"); - const result = spawnSync(process.execPath, ["scripts/perf/summarize-cpuprofile.mjs", "--wat"], { cwd: process.cwd(), encoding: "utf8", diff --git a/test/scripts/test-shell-completion.test.ts b/test/scripts/test-shell-completion.test.ts index d441d24f454d..f772f51e8e17 100644 --- a/test/scripts/test-shell-completion.test.ts +++ b/test/scripts/test-shell-completion.test.ts @@ -15,13 +15,7 @@ afterEach(async () => { }); describe("test-shell-completion script", () => { - it("parses explicit shell overrides", () => { - expect(shellCompletionTesting.parseArgs(["--shell", "bash", "--check-only"])).toEqual({ - checkOnly: true, - force: false, - help: false, - shell: "bash", - }); + it("parses an attached shell override", () => { expect(shellCompletionTesting.parseArgs(["--shell=fish"])).toEqual({ checkOnly: false, force: false, @@ -30,8 +24,7 @@ describe("test-shell-completion script", () => { }); }); - it("rejects unknown or malformed arguments before touching shell state", () => { - expect(() => shellCompletionTesting.parseArgs(["--wat"])).toThrow("Unknown argument: --wat"); + it("rejects malformed arguments before touching shell state", () => { expect(() => shellCompletionTesting.parseArgs(["--shell"])).toThrow("--shell requires a value"); expect(() => shellCompletionTesting.parseArgs(["--shell", "--check-only"])).toThrow( "--shell requires a value",