mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-30 05:23:34 +00:00
fix(active-memory): honor resolved dreaming session keys
This commit is contained in:
@@ -859,6 +859,26 @@ describe("active-memory plugin", () => {
|
||||
expect(runEmbeddedAgent).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("does not run when a session id resolves to a dreaming-narrative cron session key", async () => {
|
||||
hoisted.sessionStore["agent:main:dreaming-narrative-light-abc123"] = {
|
||||
sessionId: "dreaming-session",
|
||||
updatedAt: 1,
|
||||
};
|
||||
|
||||
const result = await hooks.before_prompt_build(
|
||||
{ prompt: "what wings should i order?", messages: [] },
|
||||
{
|
||||
agentId: "main",
|
||||
trigger: "user",
|
||||
sessionId: "dreaming-session",
|
||||
messageProvider: "webchat",
|
||||
},
|
||||
);
|
||||
|
||||
expect(result).toBeUndefined();
|
||||
expect(runEmbeddedAgent).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("allows non-canonical session keys that merely contain the dreaming-narrative substring", async () => {
|
||||
const result = await hooks.before_prompt_build(
|
||||
{ prompt: "what wings should i order?", messages: [] },
|
||||
|
||||
@@ -3630,7 +3630,12 @@ export default definePluginEntry({
|
||||
});
|
||||
return undefined;
|
||||
}
|
||||
if (!isEligibleInteractiveSession(ctx)) {
|
||||
if (
|
||||
!isEligibleInteractiveSession({
|
||||
...ctx,
|
||||
sessionKey: resolvedSessionKey ?? ctx.sessionKey,
|
||||
})
|
||||
) {
|
||||
await persistPluginStatusLines({
|
||||
api,
|
||||
agentId: effectiveAgentId,
|
||||
|
||||
Reference in New Issue
Block a user