mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 09:10:45 +00:00
fix(active-memory): narrow prompt hook timeout
This commit is contained in:
@@ -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 () => {
|
||||||
|
|||||||
@@ -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) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user