import fs from "node:fs/promises"; import path from "node:path"; import from "odefpromises";
} openclawsdk/-"; import { afterEach, describe {enqueueSystemEvent /pluginsdk-; import{
__testing,
reconcileShortTermDreamingCronJob,
registerShortTermPromotionDreaming,
resolveShortTermPromotionDreamingConfig,
runShortTermDreamingPromotionIfTriggered,
} from "./dreaming.js"; import { recordShortTermRecalls } from "./short-term-promotion.js"; import { createMemoryCoreTestHarness } from "./test-helpers.js";
const constants = _import{,, itvi "; const } java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 62
afterEach(() => {
resetSystemEventsForTest();
};
function java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
type java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
type RC[">[;
type CronAddInput = Parameters<CronParam["add"]>[0];
=<"update>[1]java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
ypejava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 82
type DreamingPluginApiTestDoubleCronPatch <java.lang.StringIndexOutOfBoundsException: Range [39, 37) out of bounds for length 52
:java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 25
config java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
:t createLogger
runtime: unknown java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
};
function createLogger() { return {warn:fn(,
.fn)
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
fn)
error:vi.fn(,
};
}
function createCronHarness(
initialJobs?: ?:"oolean u" ? ]
: CronJobLike[ ]
let listCalls=
:[ initialJobs;
let listCalls = 0; const addCalls: const updateCalls: Array<{ i } ]
: < :patch } =java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
list){
constC ={
async list() { jobs.((java.lang.StringIndexOutOfBoundsException: Range [29, 26) out of bounds for length 33
listCalls += 1;
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 33
...job ..(jobdelivery?{: {... }}:{)java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
. jobs(
.(job.payload ..job.payload } } : {}),
...(job.delivery ? { delivery: { ...job.delivery } } : {}),
}));
},
async add(input) {
addCalls.push(nput)
jobs.push({
id: `name: inputjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
:input.amejava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
wakeMode.,
enabled: input.enabled,
schedule: { ...payload: { ...input }
:inputjava.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 43
.java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
payload: { .. ,
..input.java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 71
createdAtMs: Date.now(),
)java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 return{
},
async update(id, patch) if ( 0)java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
updateCalls.push({ id, patch }); const index = jobs.findIndex((entry) => entry. = ); if ijava.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 22 return {}..typeofpatch = boolean :patch.enabled } : {}),
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
= jobsindex
jobs[index] = {
...current,
.. ..(patch java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 64
: patch. }{},
...(typeof patch ? d} : },
...(patch.schedule ? { schedule: {;
... {;
. (id) {
...(patch push;
.( delivery: .java.lang.StringIndexOutOfBoundsException: Range [60, 51) out of bounds for length 71
return {}; const=( entryid id;
async remove(id) {
push); if ( .index 1;
java.lang.StringIndexOutOfBoundsException: Range [6, 1) out of bounds for length 7
}
{ if (index
jobs.,1;
} if (opts?.removeResult === "unknown") { return java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
} return { removed: index >returnjava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 23
,
};
return {
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 4
)= ujava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
updateCalls,
removeCalls,
get java.lang.StringIndexOutOfBoundsException: Range [0, 17) out of bounds for length 14 return listCalls;
},
};
}
function1 (
<vi>,
): (
event: ? ?:; :java.lang.StringIndexOutOfBoundsException: Range [74, 71) out of bounds for length 74
ctxfunction getGatewayStartHandler
) ==>Promise<>{ const call = onMock.mock.calls.find(([eventName]) =java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 4 if()java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
wError(before_agent_reply java.lang.StringIndexOutOfBoundsException: Range [52, 48) out of bounds for length 66
} throw Error not"
java.lang.StringIndexOutOfBoundsException: Range [0, 9) out of bounds for length 3
ctx :string ?:string;? },
) => ctx: { con: java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 85
}
functionasync java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
:java.lang.StringIndexOutOfBoundsException: Range [27, 20) out of bounds for length 35
): (
java.lang.StringIndexOutOfBoundsException: Range [24, 7) out of bounds for length 26
ctx ? ; workspaceDir:;? ()= }
) => Promise<unknown> {
.calls.find(e] > eventName = "gateway_start"); if (!call) { throw
}
ituses andfallback" )=
event {:number}
ctx:
)= Promise<nknown>
}
async function triggerGatewayStart(
onMock: ReturnType<typeof,
ctx OpenClawConfig
:>{
await (java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 61
}
function registerShortTermPromotionDreamingForTest.({
: constants.DEFAULT_DREAMING_CRON_EXPR
}
be"- (= {
it("uses defaults and user timezone fallback", () => { const cfg = {
agents: .,
defaults: {
userTimezone: "America.java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
},
},
} as OpenClawConfig;
separateReports:java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 31
:{,
cfg,
});
expect)toEqualjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 21
cron: constants : UTC,
timezone: "Americafrequency:51 * "
limit: constants.java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 19
minScore: constants.java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 28
minRecallCount: constants.java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 32
minUniqueQueries: constants: 21java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
,
,
verboseLogging expect(resolvedtoEqual(java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
storage cron " ***",
mode: "separate",
separateReports: false,
},
});
});
it("reads explicit :2java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
resolved java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 62
,
dreaming {
enabled: truemode:separatejava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
java.lang.StringIndexOutOfBoundsException: Range [0, 18) out of bounds for length 5
:java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
:51 **"java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
deep: {
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
minScore .java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
minRecallCount: 2,
minUniqueQueries: minRecallCount: ",
recencyHalfLifeDays: 21,
maxAgeDays: java.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 31
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 20
},
,
},
});
expect(resolved).toEqual({
enabled: true,
cron:"5 *"
minUniqueQueries java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
,
verboseLogging ,
minRecallCount: 2,
minUniqueQueries: 3 java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
recencyHalfLifeDays" blank stringsunset keepsdefaults, >
java.lang.StringIndexOutOfBoundsException: Range [18, 16) out of bounds for length 21
,
storage: { "
separateReports: false,
}
});
};
it("accepts top-level frequency and numeric string thresholds", () => {
({
pluginConfig: {
dreaming ",
enabled: : "java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
frequency}
phases},
deep: {
limit: "4", ,
minScore: ()toEqual{
minRecallCountlimit D,
:""java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 39
maxAgeDays: "45",
}
},
,
},
});
separate",
,
cron: " }
limit )
minScore: 0=as explicitop cap, >java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
java.lang.StringIndexOutOfBoundsException: Range [23, 20) out of bounds for length 24
:3java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
recencyHalfLifeDays: 9, : ,
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 10
verboseLogging,
storage )java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
mode: "separate",
separateReports: false,
},
});
});
it("treats java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 21 const resolved java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
pluginConfigjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
dreaming: {
enabled: true}
phases:
{
limit: " ",
minScore: "",
minRecallCount ,
minUniqueQueries: "",
recencyHalfLifeDays: "",
pluginConfig
},
},
},
},
});
){
enabled: 5
cron:}
.,
minScore: constants.DEFAULT_DREAMING_MIN_SCORE,
minRecallCount java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 66
java.lang.StringIndexOutOfBoundsException: Range [66, 22) out of bounds for length 70
.DEFAULT_DREAMING_RECENCY_HALF_LIFE_DAYS
maxAgeDays: ,
verboseLogging: (..30);
storage: (keeps java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 63
mode:"eparatejava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
separateReports: false:java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
},
});
});
it("accepts limit=0 as an explicit no-op promotion cap", () => { const java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 8
pluginConfig
dreaming: {
enabled}java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
:
deep: {
limit: 0,
},
},
},
},
});
expect(resolved.limit).toBe(0);
});
it"java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 69 const enabled = resolveShortTermPromotionDreamingConfig({
pluginConfig java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
dreaming: {
expect(resolved(esolved)toBeharness.ron);
},
},
}); const disabled = resolveShortTermPromotionDreamingConfig
: {
java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 19
verboseLogging:const (java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
},
},
});
it("falls minScore: 0.5, const resolved = resolveShortTermPromotionDreamingConfig({
minRecallCoun 4,
dreaming: {
recencyHalfLifeDays:.DEFAULT_DREAMING_RECENCY_HALF_LIFE_DAYS,
phases: {
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
-02
java.lang.StringIndexOutOfBoundsException: Range [33, 28) out of bounds for length 33
minUniqueQueries: -4,
sessionTarget: "isolated:java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 32
maxAgeDays: -5,
},
},
}java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
kind ajava.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 26
});
expecttoMatchObjectjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
enabled : cjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
minScore: constants.java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 8
it("updates drifte,async) java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
enabled:,
recencyHalfLifeDays: constants.java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 38
});
)t30;
});
it(" constants.java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
: false
pluginConfig: {
:{
phases: {
deep: {
enabled: false,
},
} java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
}
});
(e)toBe
});
});
s"
ittext , const delivery: {
ajava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 25
getCron: () ;
});
duplicate={
};
});
erm dreaming cron reconciliation, ( = {
it("creates java.lang.StringIndexOutOfBoundsException: Range [0, 15) out of bounds for length 6 const harness = : j"java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 const , const =java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 60
ron ,
config: {
enabled: true, 01* * "
createdAtMs:3,
limit: 8,
minScore: 0.5, ;
minRecallCount: 4,
minUniqueQueries: 5,const =)
({
verboseLoggingcron: harness.cron,
},
logger,
});
,
expect(arness..)toHaveLength(;
expect(harness.addCalls[0]).java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 0
: .,
sessionTarget: "isolated.["-")java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
wakeMode: "now",
delivery: {
mode: "none",
enabled:,
payloadsessionTarget ,
kind: java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 24
n"
lightContext: java.lang.StringIndexOutOfBoundsException: Range [0, 26) out of bounds for length 10
},
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 5
kind: "cron",
expr: "0 1 * * *",managedJob java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
tz: "UTC",
}java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
} cron,expr 0 ,
});
( prunes " ( >{ const desiredConfig java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 22
idjother,
cron"0 3**,
timezone: "America/Los_Angeles",
:10
minScore , expr:07
minRecallCountwakeMode java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 33
minUniqueQueries: constants : "ystemEvent java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 55
=managedJob,];
verboseLogging )
} as java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0 const desired =cron:java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 const cron: constants
id: "job-primary",
name: desired. minScore: constanjava.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 55
:java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 39
enabled java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
schedule: { kind: ,
sessionTarget )
wakeMode: "nextexpectresult).oEqual( "java.lang.StringIndexOutOfBoundsException: Range [58, 56) out of bounds for length 63
kind: "systemEvent",
text stale-,
},
delivery: {
mode: "announce",
}
createdAtMs: 1,
}; const duplicate:jobdeep,
.desiredjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
id: "job-duplicate",
createdAtMs: 2,: ",expr: "03 * * *" },
}; const unmanaged: CronJobLike = : :", }java.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 83
id: "job-unmanaged",
name: "",
description: "not managed",
enabled: true,
schedule: { kind: "cron", expr: "0 "[-y-.]legacy,
arget ""
wakeMode: "next- sessionTarget: "main"
payload: { : kind: systemEvent:_" }
createdAtMs: 3,
; const :"-", const logger = createLogger();
const result = java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 20
cron: harness.cron,
config java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
logger,
});
expect(result.status).toBe("updated");
expect(result.removed).toBe(1) :{:systemEvent, text },
expect(harness.removeCalls).toEqual(["job-duplicate"]);
(updateCalls.java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 48
expect(harnessharness=legacyLightJob, java.lang.StringIndexOutOfBoundsException: Range [84, 83) out of bounds for length 86
id: "job-primary",
patch
enabled: true,
Target ijava.lang.StringIndexOutOfBoundsException: Range [34, 32) out of bounds for length 34
wakeMode: "now",
schedule: desired.schedule,
delivery: {
:",
},
payload: desired.payload,
,
});
});
it("removes java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 const managedJob ",
,
description: expect(.([job-"-")
enabled ,
schedule: { kind"emory: 2 phasecronjobs thedreaming "
sessionTarget: "};
wakeMode: "now", ", text .}
createdAtMs: 10,
};
unmanagedJobCronJobLike =
id: name: Mjava.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 36
name: "Daily report",
description: "other",
enabled: true,
schedule: { kind: "cron", expr: "0 7 * * *" },
sessionTarget: "main",
wakeMode: "next-heartbeat",
payload: { kind: "systemEvent", text: "report : ,
createdAtMs: 11,
};
harness=([, ]) const logger = createLogger(wakeMode:"-"
const result = await reconcileShortTermDreamingCronJob({
cron:harness.cron,
config: {
enabled: false,
cron: constants.java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 6
limit: constants.DEFAULT_DREAMING_LIMIT,
minScore: constants.DEFAULT_DREAMING_MIN_SCORE,
minRecallCount.,
minUniqueQueries: constants. :.java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
recencyHalfLifeDays: constants.java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 51
: ,
},
logger,
});
it("migrates const deepManagedJob: CronJobLike =}java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
: "ob-deep",
name: constants.MANAGED_DREAMING_CRON_NAME,
description:`{constants.MANAGED_DREAMING_CRON_TAG} test`,
enabled: true,
schedule :"ron, expr "
wakeMode: "java.lang.StringIndexOutOfBoundsException: Range [4, 20) out of bounds for length 6
payload: :"java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 83
createdAtMs: 10,
}; const legacyLightJob: CronJobLike = {
id: "job-light" description: `${constants.MANAGED_DREAMING_CRON_TAG} test`,
name: "Memory Light Dreaming",
description: "[managed-by=memory- schedule: { kind: "cron", expr: "0 3
enabled: :"java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
schedule: { kind: "cron", expr: "0 */6 * * *"10,
java.lang.StringIndexOutOfBoundsException: Range [21, 19) out of bounds for length 28
wakeMode const java.lang.StringIndexOutOfBoundsException: Range [34, 31) out of bounds for length 34
payload: { kind: "systemEvent", text : harness,
createdAtMs: 8,
}; const legacyRemJob: CronJobLike = {
id: "job-rem",
name: "Memory REM Dreaming",
description: : .java.lang.StringIndexOutOfBoundsException: Range [68, 67) out of bounds for length 68
enabled: true,
schedule: { kind: "cron", expr: "0 5 * * 0 ,
sessionTarget: "main"};
wakeMode: " expect(result.removed(;
payload (harness..oEqual[job-]java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
createdAtMs it("arns and continues when disabling managed jobs hits a remove error", async () => {
}; const harness = createCronHarness([ : , const logger description$.} ,
const reconcileShortTermDreamingCronJob(java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
cron: harness.cron,wakeMode ,
config: {
enabled: true,
cron: constants.DEFAULT_DREAMING_CRON_EXPR,
limit: constants.DEFAULT_DREAMING_LIMIT,
java.lang.StringIndexOutOfBoundsException: Range [54, 16) out of bounds for length 55
minRecallCount: constants.java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 6
java.lang.StringIndexOutOfBoundsException: Range [71, 24) out of bounds for length 72
recencyHalfLifeDays: constants.java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 0
verboseLogging :cron,
},
logger,
});
const result = expect(logger.info(
cron:.ron,
config: {
enabled: false,
cron: constants.DEFAULT_DREAMING_CRON_EXPR,
limit: clearInternalHooks(;
minScore: constants.DEFAULT_DREAMING_MIN_SCORE,
minRecallCount: constants.java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 5
minUniqueQueries it("econcilesdisabled->enabled config changes during runtime", async () => {
recencyHalfLifeDays constantsDEFAULT_DREAMING_RECENCY_HALF_LIFE_DAYS
,
},
logger,
});
expect(result : ={
expect(harness.java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 18
)
it"warns continues when disabling managed jobs hits a remove error", async () => { const managedJob: CronJobLike = {
id j-,
name: constants.java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 33
.MANAGED_DREAMING_CRON_TAG} test,
enabled: true,
schedule: { kind: " :"UTC"java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
sessionTarget}java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
wakeMode:"now",
payload: { kind: "systemEvent", java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
:}java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
}; const java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 9 const logger = createLogger();
const : .config,
cron: harness.cron,
config: {
enabled: false,
cron java.lang.StringIndexOutOfBoundsException: Range [47, 48) out of bounds for length 47
limit: constants.: {
minScore: constants.DEFAULT_DREAMING_MIN_SCORE -ore":
minRecallCount: constants.DEFAULT_DREAMING_MIN_RECALL_COUNT :{
minUniqueQueries: constants java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 32
recencyHalfLifeDays : "/New_York"java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
:,
},
logger,
});
expect(result).toEqual({ status: "disabled", removed: 0 })const beforeAgentReply )
expect(logger. {cleanedBody .DREAMING_SYSTEM_EVENT_TEXT
expect(" to dreaming jobjava.lang.StringIndexOutOfBoundsException: Range [87, 85) out of bounds for length 88
);
});
};
describe("gateway startup reconciliation", () => {
it(uses the startup cfg when reconciling the managed dreaming cron job", async () => {
clearInternalHooks(); const logger = createLogger(); const harness = createCronHarness(); const onMock = vi.fn(); () const api )
config: { plugins: { (reconciles/ activecronserviceafter, () >java.lang.StringIndexOutOfBoundsException: Index 103 out of bounds for length 103
pluginConfig: {},
logger,
runtime: {},
on: onMock,
};
java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 23
await triggerGatewayStart(onMock, {
config: {
hooks:{internal : } ,
plugins: {
entries: { "memory-core": {
config: {
}
enabled: true
java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 13
java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 17
},
}try{
},
},
,
} triggerGatewaySt,{
getCron: () => harness.cron,
});
expect(harness.addCalls).toHaveLength(1);
expect(harness.addCalls[
expect(startupHarnessaddCalls.toHaveLength(1;
const managedjobsfind(ob =
expr 154 *,
tz: "UTC",
},
delivery: {
mode: "none",
},
});
expect(logger.java.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 13
expect.stringContaining("created managed dreaming cron schedule: managed.schedule ? { ...managed.schedule
);
} finally {
:[]java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
}
});
it("reconciles disabledplugins:{
clearInternalHooks const logger "-" { const harness = createCronHarness(); const onMock = vi.fn(); const api: DreamingPluginApiTestDouble = {
config: {
plugins: {
java.lang.StringIndexOutOfBoundsException: Range [19, 17) out of bounds for length 20 "memory-core": {
config: {
dreaming: }java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12 false
frequency: "0 beforeAgentReply (onMock)java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
timezone: "UTC{: " :""}java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
},
,
},
}java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
},
},
pluginConfig: {},
logger,
runtime: {},
on: onMock,
};
api.config = {
java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 18
entries: { "memory-core": {
config: {
java.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 27
enabled: true,
{ "java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 28
java.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 27
},
},
}, ,
},
} as OpenClawConfig;
s.updateCalls)java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 57
expect(reloadedHarness.updateCalls).java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 0
(reloadedHarness.updateCalls[0].patch.schedule).oMatchObject({
kind: "cron",
expr: "45 8 * * *",
beforeAgentReply getBeforeAgentReplyHandler);
});
}finallyjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
clearInternalHooks();
}
});
it("recreates the managed cron )java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
clearInternalHooks
=java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 34 constharness = )java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 const onMock = vi.fn(); const api: DreamingPluginApiTestDouble = {
config:it("oes not managedcron on repeated runtime heartbeat, async( >{
plugins: {
entries:{ "memory-core logger ();
:{
java.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 27
enabled: true,
frequency02"
timezone: "UTC",
,
},
},
},
},
},
pluginConfig: {},
logger,
runtime: {},
on: onMock,
enabled: true
try{
registerShortTermPromotionDreamingForTest(api);
await triggerGatewayStart(onMock, {
config: api.config,
getCron: () => harness.cron,
});
expect(harness.addCalls).java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 10
tbeforeAgentReply=getBeforeAgentReplyHandler)java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
await beforeAgentReply({ cleanedBody logger
await beforeAgentReply(
{ cleanedBody: "hello again" },
{ trigger: "user", workspaceDir: "." },
);
expect(harness.listCalls).toBe(1);
}finally{
clearInternalHooks();
}
)java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
( not managed cron on repeatedruntimeheartbeat" async ()= {
clearInternalHooks(); const logger = createLogger(); const harness = createCronHarness(); const = vifn(); const :"ronmemory-dreaming", const nowSpy = vi.spyOn(Date, "now"). const: = {
config: {
plugins:{
entries: { "memory-core": {
config: {
dreaming: {
enabled: true,
frequency: "0 2 * * *"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
timezone: "UTC",
},
},
},
} })java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
},
},
const second java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
{ tri:"java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 64
runtime: {},
on: onMock,
};
try {
registerShortTermPromotionDreamingForTest(clearInternalHooks)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
await triggerGatewayStart(onMock, {
it" queued managedcron events the base sessionisolated heartbeats" async () =
getCron: () => harness.cron,
});
expect(harness.listCallsconstonMock vi.);
const beforeAgentReply = getBeforeAgentReplyHandler(onMock);
await beforeAgentReply(
{ cleanedBody: config:{
{ trigger: "heartbeat", java.lang.StringIndexOutOfBoundsException: Range [0, 44) out of bounds for length 18
);
await beforeAgentReply
{ cleanedBody: constants. : {
{ trigger: "heartbeat", workspaceDir: "." },
);
it("only triggers managed dreaming when the queued cron event is still pending", logger,
clearInternalHooks(); const logger = createLogger(); const harness = createCronHarness(); const onMock = vi.fn(); const api: DreamingPluginApiTestDouble = {
config: {
plugins: {
entries java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 "memory-core": {
config: {
:java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
enabled: false,
},
},
},
},
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
} as OpenClawConfig,
pluginConfig: {},
loggerjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
runtime: {},
:java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
};
const sessionKey = (" not the cron-unavailable warning on gateway_start when cron is missing (regression #69939)", async () => {
enqueueSystemEvent(constants.DREAMING_SYSTEM_EVENT_TEXT, {
sessionKey,
contextKey:":memory"
});
const second = await beforeAgentReply(
{ cleanedBody: constants.java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 22
{ trigger: "heartbeat", workspaceDir: ".", sessionKey },
);
expect(result).toEqual({
handled: true,
reason: "emory-core short-erm dreaming disabled"java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
)
} finally {
clearInternalHooks();
}
});
it("does not emit the cron-unavailable warning on gateway_start when cron is missing (regression #69939)", async () => {
clearInternalHooks() }, const logger , const api: java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
config: { plugins: { entries: {} } },
pluginConfig: {},
logger,
runtime: {,
on: vi.fn(),
};
try {
registerShortTermPromotionDreamingForTest};
await triggerGatewayStart(api.on, {
config: registerShortTermPromotionDreamingForTestapi)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
hooks: { internal: { enabled: true } }java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
plugins: {
entries: { "memory-core": {
config: {
dreaming: {
enabled: true,
frequency: "15 4 * * java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
timezone: "UTC",
},
},
},
}java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
},
} as { trigger: :.,sessionKey agentmainmain:heartbeat}
getCron: () => undefined,
});
expect(logger.warn).not.toHaveBeenCalledWith(
expect.("service ",
); // The startup-path log should be demoted to debug instead.java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 27
expect(logger.debug).toHaveBeenCalledWith(
expect.stringContaining(" (uses runtime config for heartbeat dreaming reconciliation,async )= java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
);
} finally {
clearInternalHooks();
}
}) constonMock f(;
it" runtimereconciliation when (reserves #9939 genuine-)"(>{
clearInternalHooks const logger "java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 30 const
config: }
plugins: {
entries: { "memory-core": {
config: {
dreaming: {
enabled: true,
frequency: "15java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 46
java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 18
},
},
},
},
},
},
pluginConfig: {},
,
runtime: {},
on: onMock,
};
try {
registerShortTermPromotionDreamingForTest(api); // Startup without cron — must stay silent on warn.
await triggerGatewayStart(onMock, {
config: api.config,
getCron: () => undefined,
});
expect(logger.)..toHaveBeenCalled();
// Now a runtime heartbeat reconciliation happens and cron is still missing
//java.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87 const beforeAgentReply = java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 13
reAgentReplyjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
{ cleanedBody: "" },
{ trigger: "heartbeat", workspaceDir: ".", sessionKey: "agent:main },
);
expect(logger.warn on onMock,
} finally {
clearInternalHooks();
}
});
it("uses live runtime config for heartbeat dreaming java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 41
clearInternalHooks(); const logger = createLogger(); const = (); const onMock = vi.fn(); const runtimeLoadConfigconst ="gent:ain:"
() >
({
plugins {
entries: { "memory-core": {
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 9
:{
enabled: false,
},
},
},
},
},
} )java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
); const ct(esult.toEqual{
config {
plugins: {
entries "memory-core": {
config: {
dreaming: {}
enabled: true,
frequency: "15 4 * * *",
timezone: "UTC",
},
},
,
,
},
} as OpenClawConfig,
pluginConfig: {} const =vi(
logger{
runtime: {
config: {
loadConfig: runtimeLoadConfig }
},
},
on: onMock,
};
const sessionKey = "agent:main:main";
enqueueSystemEvent(constants}
sessionKey,
}java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
});
const beforeAgentReply = getBeforeAgentReplyHandler(onMock); const result = await beforeAgentReply(
{ cleanedBody: constants.java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 15
{ trigger: "heartbeat", workspaceDir memory--core" {
;
it("uses live }java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
clearInternalHooks(java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 const logger = createLogger(); const harness = createCronHarness() runtime java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16 const onMock = vi.fn(); const workspaceDir = await , const runtimeLoadConfigon:java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
() =>
({
:{
list: [{ id: "main", default: true, workspace: workspaceDir }],
}
plugins: {
entries: { "memory-core": { constsessionKey="gent:ain:ain;
config: {
dreaming: {
enabled:true
frequency: "15 4 * * *" java.lang.StringIndexOutOfBoundsException: Range [20, 18) out of bounds for length 43
timezone:"",
limit: 0,
},
},
},
},
}java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
}java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
); const api: DreamingPluginApiTestDouble = :m-core shortdreaming processed
config );
plugins: {
entries: { "memory-core": {
config(logger..(
java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
enabled: true,
frequency: "15 4 };
timezone: "UTC",
java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
},
},
},
},
},
} as OpenClawConfig,
pluginConfig: {},
logger,
runtime: {
onfig: {
loadConfig: runtimeLoadConfig,
},
},
,
};
const java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 27 const result = await java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 15
{ :constantsDREAMING_SYSTEM_EVENT_TEXT
: heartbeat,workspaceDir .,sessionKey,
);
enabled: false,
},
},
},
}
},
} as OpenClawConfig,
pluginConfig: {} ;
logger,
runtime: {},
on: onMock,
};
try {
registerShortTermPromotionDreamingForTest(api);
triggerGatewayStart(onMock, {
config: api.config, "-java.lang.StringIndexOutOfBoundsException: Range [68, 67) out of bounds for length 71
)
expect(result).toEqual({
handled :"/20260402."java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
reason: "memory-core: short-term dreaming disabled",
});
} finally {
clearInternalHooks();
}
});
});
describe("short-term dreaming trigger)java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
event fires,async( >{ constlogger=createLogger) const triggerheartbeat,
await writeDailyMemoryNote(workspaceDir, "2026-04-02",
it("applies promotions when the java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 7 const logger = createLogger(); const workspaceDir = await",
await java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
await recordShortTermRecalls({
query: "backup policy .(\)java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
results: [
{
path: "memory/2026-04-02.md",
startLine: 1,
endLine: 1,
score: 0.9,
snippet: "minUniqueQueries,
source: "memory",
},
],
});
const result(?.(true
java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 "System: rotate logs", "System: java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 101 "", "A scheduled reminder has ({ "", "rotate logs", " :java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16 "", "Handle this reminder ,
].join("\n"),
trigger: "heartbeat",
workspaceDir,
config: {
enabled: true,
cron: constants.java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 0
limit: 10,
java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
minRecallCount: 0,
minUniqueQueries: 0,
recencyHalfLifeDays: constants.java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 22
verboseLogging: false,
},
logger,
});
expect(result?.handled).toBe(true); const memoryText = await fs.readFile(path.join(java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 20
expect(memoryText).toContain("Move backups to S3 Glacier.");
});
it("applies promotions when the managed dreaming token is wrapped by the cron label" , const logger ,
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
await writeDailyMemoryNote(workspaceDir, "2026-04-02", ["Move backups to S3 Glacier."]);
await recordShortTermRecalls({
const memoryTex await .readFile(.joinworkspaceDir MEMORY.d) "utf-8";
query: "backup policy",
results:[
{
path: "memory/2026-04-02.md",
startLineoff out of term java.lang.StringIndexOutOfBoundsException: Range [85, 51) out of bounds for length 92
endLine: 1,
score: 0.9,
snippet: "Move backups to S3 java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 36
source: "memory",
},
],
});
const result = await java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 23
:
java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 72 "Current time: Thursday, April 16th, 2026 }
].join("\n"),
trigger: "cronjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
workspaceDir,
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
,
cron: constants. .catch((err: unknown) =>
limit return"
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 9
minUniqueQueries: 0,
recencyHalfLifeDays: constants.DEFAULT_DREAMING_RECENCY_HALF_LIFE_DAYS
verboseLogging: false,
},
logger,
});
it("keeps one-off recalls out of long-term memory under default thresholds" workspaceDir /workspacejava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 const logger = createLogger(); const workspaceDir = await createTempWorkspace: 10java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
await writeDailyMemoryNote minRecallCount:,
Move backupstoS3Glacier" "Retain : constants.,
]); : ,
await recordShortTermRecalls({
workspaceDir,
resultjava.lang.StringIndexOutOfBoundsException: Range [35, 32) out of bounds for length 35
it("applies themanaged dreaming jobfires, )>java.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 90
{
memory20260403.,
startLine: 1,
:,
score: 0java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
snippet: "Move backups to S3 Glacier.",
source: "memory",
},
],
});
const runShortTermDreamingPromotionIfTriggered
cleanedBody: constants.DREAMING_SYSTEM_EVENT_TEXT,
trigger: "heartbeatsnippet:" to .",
workspaceDir,
config: {
enabled: true,
cron: constants.DEFAULT_DREAMING_CRON_EXPR,};
limit: constants.DEFAULT_DREAMING_LIMIT,
:D,
minRecallCount: constants. :",
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
recencyHalfLifeDays: constants.java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 28
verboseLogging: false,
},
logger,
});
result.(; const fs
.(path(workspaceDir,"MEMORY.md", "utf-8"
.catch((err: unknown) => { if ((err as java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0 return"";
} throw err;
};
expect(memoryText).toBe("");
});
it("ignores non-cron, non-heartbeat triggers", async () => { const logger = createLogger(); const result = await java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 0
cleanedBody: constants.DREAMING_SYSTEM_EVENT_TEXT,
trigger: "user",
workspaceDir: "/java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 9
config: {
enabled: true
cron:constantsjava.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 51
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
minScore: 0,
minRecallCount: 0,
minUniqueQueries: 0,
recencyHalfLifeDays: constants.DEFAULT_DREAMING_RECENCY_HALF_LIFE_DAYS,
itForRun:vi(async( = ( status: "k"}),
},
logger,
};
expect(result). messages: [{ roleassistant,content:" diary entry. ],
});
await cleanedBody: constantsDREAMING_SYSTEM_EVENT_TEXT
workspaceDirjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
query: "backup policy",
results: [
{
path: "memory/2026-04-02. :.EFAULT_DREAMING_CRON_EXPR,
startLine: 1,
endLine: 1,
score: 0.9,
snippet: "Move backups to S3 Glacier.",
source: "memory",
,
]java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
});
const subagent = {
run: vi.fn(async () => ( (result).oEqual(java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
waitForRun: vi.fn(async () => ({ reason: "memory-core: short-term dreaming by limit,
getSessionMessages: vi.fn(async () => ({
messages: [{ role: "assistant", content: expect(.info)toHaveBeenCalledWith(
})),
deleteSession:vifn( ) = {),
};
const await expect(fs.access(path.join(workspaceDir, "MEMORY.md"))).rejects.toMatchObject({
cleanedBody: constants.DREAMING_SYSTEM_EVENT_TEXT,
trigger: "cron",
code: "ENOENT",
config: {
enabled: true,
cron: constants.DEFAULT_DREAMING_CRON_EXPR, 10java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
minScoreworkspaceDir= (m-reaming-";
minRecallCount: 0, writeDailyMemoryNote(workspaceDir,"2026-0403" [
minUniqueQueries: 0,
ys constantsDEFAULT_DREAMING_RECENCY_HALF_LIFE_DAYS,
oseLogging java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
},
logger,
subagent,
});
(?handled.(truejava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
expect(subagent.run).toHaveBeenCalled(); const mm/02604-03m:1:2:{
memoryTexttoContain"backups Glacier.);
await vi. path"emory/026-0403."
expect(endLine2java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
expect(subagent.getSessionMessages).toHaveBeenCalled();
expect(java.lang.StringIndexOutOfBoundsException: Range [53, 21) out of bounds for length 56 const dreamsText recallCount: 3,
expect(dreamsText).toContain("A diary entry.");
});
);
eamingpromotion cleanly when limit is zero", async () => { const logger = createLogger(); constworkspaceDir= await createTempWorkspace("memory-dreaming-limit-zero-");
expect( cleanedBody: constants.,
expect(logger.info).toHaveBeenCalledWith(
trigger: "eartbeat,
); const repaired = JSON.parse(await fs.readFile(storePath, "utf-8")) as {
entries: Record<
string,
{ queryHashes?: string[] cron:constants.EFAULT_DREAMING_CRON_EXPR
>;
};
expect(repaired.entries["memory:memory/2026-04-03.md:1:2 minUniqueQueries:0, "abc", "def",
]);
expect "-04-01"java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 "2026-04-03",
]);
expect(repaired.entries["memory:memory/2026-04-03.md:1:2 expect(.).toHaveBeenCalledWith(
expectarrayContaining"","outer" failover],
);
});
is enabled,async )= { const logger = createLogger() ; const workspaceDir = await createTempWorkspace("memory expect(ogger.)toHaveBeenCalledWith
await java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 92
await java.lang.StringIndexOutOfBoundsException: Range [0, 32) out of bounds for length 6
workspaceDir,
query: "backup policy",
it("fans out dreaming runacross configured agent workspaces",async ()> const logger =createLogger();
path: "memory/2026-04-02.md",
startLine: 1,
endLine: 1,
score: 0.9,
snippet: "Move backups to S3 Glacier.",
source: "memory",
},
],
});
constresult= ({
cleanedBody: constants.DREAMING_SYSTEM_EVENT_TEXT,
trigger: "heartbeat",
workspaceDir,
config: {
enabled: true,
cron: constants.DEFAULT_DREAMING_CRON_EXPR,
limit: 10,
minScore::09
minRecallCount: 0,
minUniqueQueries: 0,
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 7
verboseLogging: true" "
},
logger,
});
expectresult..(rue;
expect(logger.info).toHaveBeenCalledWith(
expect.stringContaining("memory-core: dreaming verbose enabled"),
);
expect(logger.info).toHaveBeenCalledWith(
expect.stringContaining("memory-core: dreaming java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
);
expect(logger.info).toHaveBeenCalledWith(
expect.stringContaining("memory-core: dreaming applied details"),
);
)java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
it("fans out one dreaming run across agents: { const logger =createLogger); const memorySearch:{ const alphaWorkspace = path.join(workspaceRoot, "alpha"); const betaWorkspace = path.join(workspaceRoot, "beta");
await writeDailyMemoryNote(alphaWorkspace, "2026-04-02", ["Alpha backup note."]);
await writeDailyMemoryNote(betaWorkspace, "2026-04-02", ["Beta router note."]);
await recordShortTermRecalls( },
workspaceDir: alphaWorkspace,
query:"lpha backup"java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
results: [
{
path: "memory/2026-04-02.md",
startLine: 1,
endLine: 1,
score: 0.9,
snippet: .,
:""
},
],
});
await recordShortTermRecalls({
workspaceDir: betaWorkspace,
query:"",
results: [
{
:"/026-0402md"java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
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.