fix(active-memory): honor agent allowlist in status

This commit is contained in:
Peter Steinberger
2026-05-08 00:21:44 +01:00
parent b00c9943bd
commit 9e4da8c7b3
3 changed files with 27 additions and 0 deletions

View File

@@ -158,6 +158,7 @@ Docs: https://docs.openclaw.ai
- Providers: preserve non-OK `text/event-stream` response bodies so provider HTTP errors keep their JSON detail instead of collapsing to generic streaming failures. Fixes #78180.
- Gateway/auth: make explicit `trusted-proxy` mode fail closed instead of accepting local password fallback credentials after trusted-proxy identity checks fail. Fixes #78684.
- Active memory: treat Google Chat `spaces/...` conversation ids as scoped targets instead of runnable channel names so recall runs no longer fail bundled-plugin dirName validation. Fixes #78918.
- Active memory: make `/active-memory status` honor the configured agent allowlist instead of reporting on for agents where recall is disabled. Fixes #78986.
- Tools/session status: render the active heartbeat/run model for `session_status({"sessionKey":"current"})` instead of falling back to the persisted session default. Fixes #77493.
- Doctor/secrets: allow safe inherited exec SecretRef `passEnv` names such as `HOME` while still blocking dangerous runtime env hooks. Fixes #78216.
- Chat commands: make `/model default` reset the session model override instead of treating it as a literal model name. Fixes #78182.

View File

@@ -346,6 +346,28 @@ describe("active-memory plugin", () => {
expect(runEmbeddedPiAgent).toHaveBeenCalledTimes(1);
});
it("reports session status off when the current agent is outside the active-memory allowlist (#78986)", async () => {
api.pluginConfig = {
agents: ["sandbox"],
logging: true,
};
plugin.register(api as unknown as OpenClawPluginApi);
const statusResult = await registeredCommands["active-memory"].handler({
channel: "webchat",
isAuthorizedSender: true,
sessionKey: "agent:main:main",
args: "status",
commandBody: "/active-memory status",
config: {},
requestConversationBinding: async () => ({ status: "error", message: "unsupported" }),
detachConversationBinding: async () => ({ removed: false }),
getCurrentConversationBinding: async () => null,
});
expect(statusResult.text).toBe("Active Memory: off for this session.");
});
it("supports an explicit global active-memory config toggle", async () => {
const command = registeredCommands["active-memory"];

View File

@@ -2863,6 +2863,10 @@ export default definePluginEntry({
text: "Active Memory: session toggle unavailable because this command has no session context.",
};
}
const commandAgentId = resolveStatusUpdateAgentId({ sessionKey });
if (!isEnabledForAgent(config, commandAgentId)) {
return { text: "Active Memory: off for this session." };
}
if (action === "status") {
const disabled = await isSessionActiveMemoryDisabled({ api, sessionKey });
return {