Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/JAVA/Openclaw/src/config/   (KI Agentensystem Version 22©)  Datei vom 26.3.2026 mit Größe 1 kB image not shown  

Quelle  context-visibility.test.ts

  Sprache: JAVA
 

import { describe, expect, it } from "vitest";
import type { OpenClawConfig } from "./config.js";
import {
  resolveChannelContextVisibilityMode,
  resolveDefaultContextVisibility,
} from "./context-visibility.js";

describe("resolveDefaultContextVisibility", () => {
  it("reads channels.defaults.contextVisibility", () => {
    expect(
      resolveDefaultContextVisibility({
        channels: {
          defaults: {
            contextVisibility: "allowlist_quote",
          },
        },
      }),
    ).toBe("allowlist_quote");
  });
});

describe("resolveChannelContextVisibilityMode", () => {
  it("prefers explicitly provided mode", () => {
    expect(
      resolveChannelContextVisibilityMode({
        cfg: {},
        channel: "slack",
        configuredContextVisibility: "allowlist",
      }),
    ).toBe("allowlist");
  });

  it("falls back to account mode then channel mode then defaults", () => {
    const cfg = {
      channels: {
        defaults: {
          contextVisibility: "allowlist_quote",
        },
        slack: {
          contextVisibility: "allowlist",
          accounts: {
            work: {
              contextVisibility: "all",
            },
          },
        },
      },
    } satisfies OpenClawConfig;
    expect(
      resolveChannelContextVisibilityMode({
        cfg,
        channel: "slack",
        accountId: "work",
      }),
    ).toBe("all");
    expect(
      resolveChannelContextVisibilityMode({
        cfg,
        channel: "slack",
        accountId: "missing",
      }),
    ).toBe("allowlist");
    expect(
      resolveChannelContextVisibilityMode({
        cfg: {
          channels: {
            defaults: { contextVisibility: "allowlist_quote" },
          },
        } satisfies OpenClawConfig,
        channel: "signal",
      }),
    ).toBe("allowlist_quote");
  });

  it("defaults to all when unset", () => {
    expect(
      resolveChannelContextVisibilityMode({
        cfg: {},
        channel: "telegram",
      }),
    ).toBe("all");
  });
});

Messung V0.5 in Prozent
C=100 H=100 G=100

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-06-10) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.