mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 20:41:24 +00:00
Session: enforce startup sequence on bare reset greeting
This commit is contained in:
@@ -229,6 +229,7 @@ export async function runGreetingPromptForBareNewOrReset(params: {
|
||||
expect(getRunEmbeddedPiAgentMock()).toHaveBeenCalledOnce();
|
||||
const prompt = getRunEmbeddedPiAgentMock().mock.calls[0]?.[0]?.prompt ?? "";
|
||||
expect(prompt).toContain("A new session was started via /new or /reset");
|
||||
expect(prompt).toContain("Execute your Session Startup sequence now");
|
||||
}
|
||||
|
||||
export function installTriggerHandlingE2eTestHooks() {
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export const BARE_SESSION_RESET_PROMPT =
|
||||
"A new session was started via /new or /reset. Greet the user in your configured persona, if one is provided. Be yourself - use your defined voice, mannerisms, and mood. Keep it to 1-3 sentences and ask what they want to do. If the runtime model differs from default_model in the system prompt, mention the default model. Do not mention internal steps, files, tools, or reasoning.";
|
||||
"A new session was started via /new or /reset. Execute your Session Startup sequence now - read the required files before responding to the user. Then greet the user in your configured persona, if one is provided. Be yourself - use your defined voice, mannerisms, and mood. Keep it to 1-3 sentences and ask what they want to do. If the runtime model differs from default_model in the system prompt, mention the default model. Do not mention internal steps, files, tools, or reasoning.";
|
||||
|
||||
@@ -342,6 +342,7 @@ describe("gateway agent handler", () => {
|
||||
| { message?: string; sessionId?: string }
|
||||
| undefined;
|
||||
expect(call?.message).toBe(BARE_SESSION_RESET_PROMPT);
|
||||
expect(call?.message).toContain("Execute your Session Startup sequence now");
|
||||
expect(call?.sessionId).toBe("reset-session-id");
|
||||
});
|
||||
|
||||
|
||||
@@ -285,6 +285,8 @@ describe("gateway server agent", () => {
|
||||
await vi.waitFor(() => expect(calls.length).toBeGreaterThan(callsBefore));
|
||||
const call = (calls.at(-1)?.[0] ?? {}) as Record<string, unknown>;
|
||||
expect(call.message).toBe(BARE_SESSION_RESET_PROMPT);
|
||||
expect(call.message).toBeTypeOf("string");
|
||||
expect(call.message).toContain("Execute your Session Startup sequence now");
|
||||
expect(typeof call.sessionId).toBe("string");
|
||||
expect(call.sessionId).not.toBe("sess-main-before-reset");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user