fix(active-memory): narrow prompt hook timeout

This commit is contained in:
Vincent Koc
2026-04-28 18:55:44 -07:00
parent 79159f11f6
commit df9d26eb43
2 changed files with 13 additions and 3 deletions

View File

@@ -185,9 +185,19 @@ describe("active-memory plugin", () => {
it("registers a before_prompt_build hook", () => { it("registers a before_prompt_build hook", () => {
expect(api.on).toHaveBeenCalledWith("before_prompt_build", expect.any(Function), { expect(api.on).toHaveBeenCalledWith("before_prompt_build", expect.any(Function), {
timeoutMs: 150_000, timeoutMs: 45_000,
}); });
expect(hookOptions.before_prompt_build?.timeoutMs).toBe(150_000); expect(hookOptions.before_prompt_build?.timeoutMs).toBe(45_000);
});
it("registers before_prompt_build with the configured recall timeout plus setup grace", () => {
api.pluginConfig = {
agents: ["main"],
timeoutMs: 90_000,
};
plugin.register(api as unknown as OpenClawPluginApi);
expect(hookOptions.before_prompt_build?.timeoutMs).toBe(120_000);
}); });
it("runs recall without recording shared auth-profile failures", async () => { it("runs recall without recording shared auth-profile failures", async () => {

View File

@@ -2431,7 +2431,7 @@ export default definePluginEntry({
}, },
}); });
const beforePromptBuildTimeoutMs = 120_000 + setupGraceTimeoutMs; const beforePromptBuildTimeoutMs = config.timeoutMs + setupGraceTimeoutMs;
api.on( api.on(
"before_prompt_build", "before_prompt_build",
async (event, ctx) => { async (event, ctx) => {