fix(gateway): classify dream diary actions

This commit is contained in:
Peter Steinberger
2026-04-08 22:30:56 +01:00
parent 6b73a74d53
commit 85e222717f
5 changed files with 15 additions and 3 deletions

View File

@@ -8,6 +8,7 @@ let isCacheTtlEligibleProvider: typeof import("./cache-ttl.js").isCacheTtlEligib
describe("kilocode cache-ttl eligibility", () => {
beforeEach(async () => {
vi.doUnmock("../../plugins/provider-runtime.js");
vi.doUnmock("../../plugins/provider-runtime.runtime.js");
vi.resetModules();
const { resetProviderRuntimeHookCacheForTest } =
await import("../../plugins/provider-runtime.js");

View File

@@ -136,6 +136,8 @@ const METHOD_SCOPE_GROUPS: Record<OperatorScope, readonly string[]> = {
"sessions.compaction.branch",
"push.test",
"node.pending.enqueue",
"doctor.memory.backfillDreamDiary",
"doctor.memory.resetDreamDiary",
],
[ADMIN_SCOPE]: [
"channels.logout",

View File

@@ -5,6 +5,8 @@ const BASE_METHODS = [
"health",
"doctor.memory.status",
"doctor.memory.dreamDiary",
"doctor.memory.backfillDreamDiary",
"doctor.memory.resetDreamDiary",
"logs.tail",
"channels.status",
"channels.logout",

View File

@@ -749,7 +749,6 @@ describe("doctor.memory.dreamDiary", () => {
expect.objectContaining({
agentId: "main",
found: true,
path: "DREAMS.md",
content: "lowercase diary\n",
updatedAtMs: expect.any(Number),
}),

View File

@@ -4,7 +4,7 @@ import tsdownConfig from "../../tsdown.config.ts";
type TsdownConfigEntry = {
deps?: {
neverBundle?: string[];
neverBundle?: string[] | ((id: string) => boolean);
};
entry?: Record<string, string> | string[];
outDir?: string;
@@ -78,7 +78,15 @@ describe("tsdown config", () => {
it("externalizes staged bundled plugin runtime dependencies", () => {
const configs = asConfigArray(tsdownConfig);
const unifiedGraph = configs.find((config) => entryKeys(config).includes("index"));
const neverBundle = unifiedGraph?.deps?.neverBundle;
expect(unifiedGraph?.deps?.neverBundle).toEqual(expect.arrayContaining(["silk-wasm", "ws"]));
if (typeof neverBundle === "function") {
expect(neverBundle("silk-wasm")).toBe(true);
expect(neverBundle("ws")).toBe(true);
expect(neverBundle("ws/lib/websocket.js")).toBe(true);
expect(neverBundle("not-a-runtime-dependency")).toBe(false);
} else {
expect(neverBundle).toEqual(expect.arrayContaining(["silk-wasm", "ws"]));
}
});
});