mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-28 04:10:41 +00:00
Merged via squash.
Prepared head SHA: aee998a2c1
Co-authored-by: chengzhichao-xydt <264300353+chengzhichao-xydt@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
This commit is contained in:
committed by
GitHub
parent
3fe4c19305
commit
53727c72f4
@@ -525,8 +525,13 @@ describe("gateway agent handler", () => {
|
||||
{ reqId: "4" },
|
||||
);
|
||||
|
||||
const call = await expectResetCall(BARE_SESSION_RESET_PROMPT);
|
||||
await vi.waitFor(() => expect(mocks.agentCommand).toHaveBeenCalled());
|
||||
expect(mocks.sessionsResetHandler).toHaveBeenCalledTimes(1);
|
||||
const call = readLastAgentCommandCall();
|
||||
// Message is now dynamically built with current date — check key substrings
|
||||
expect(call?.message).toContain("Execute your Session Startup sequence now");
|
||||
expect(call?.message).toContain("Current time:");
|
||||
expect(call?.message).not.toBe(BARE_SESSION_RESET_PROMPT);
|
||||
expect(call?.sessionId).toBe("reset-session-id");
|
||||
});
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { randomUUID } from "node:crypto";
|
||||
import { listAgentIds } from "../../agents/agent-scope.js";
|
||||
import type { AgentInternalEvent } from "../../agents/internal-events.js";
|
||||
import { BARE_SESSION_RESET_PROMPT } from "../../auto-reply/reply/session-reset-prompt.js";
|
||||
import { buildBareSessionResetPrompt } from "../../auto-reply/reply/session-reset-prompt.js";
|
||||
import { agentCommandFromIngress } from "../../commands/agent.js";
|
||||
import { loadConfig } from "../../config/config.js";
|
||||
import {
|
||||
@@ -351,7 +351,9 @@ export const agentHandlers: GatewayRequestHandlers = {
|
||||
} else {
|
||||
// Keep bare /new and /reset behavior aligned with chat.send:
|
||||
// reset first, then run a fresh-session greeting prompt in-place.
|
||||
message = BARE_SESSION_RESET_PROMPT;
|
||||
// Date is embedded in the prompt so agents read the correct daily
|
||||
// memory files; skip further timestamp injection to avoid duplication.
|
||||
message = buildBareSessionResetPrompt(cfg);
|
||||
skipTimestampInjection = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user