mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-25 12:43:04 +00:00
test: assert materialized session ids are uuid
This commit is contained in:
@@ -30,6 +30,7 @@ const emptyPluginMetadataSnapshot = vi.hoisted(() => ({
|
||||
configFingerprint: "session-status-test-empty-plugin-metadata",
|
||||
plugins: [],
|
||||
}));
|
||||
const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
|
||||
|
||||
const createMockConfig = () => ({
|
||||
session: { mainKey: "main", scope: "per-sender" },
|
||||
@@ -892,8 +893,7 @@ describe("session_status tool", () => {
|
||||
modelOverride: "claude-sonnet-4-6",
|
||||
liveModelSwitchPending: true,
|
||||
});
|
||||
expect(saved.sessionId).toBeTypeOf("string");
|
||||
expect(saved.sessionId.trim().length).toBeGreaterThan(0);
|
||||
expect(saved.sessionId).toMatch(UUID_RE);
|
||||
});
|
||||
|
||||
it("materializes a valid persisted session entry when the default implicit current fallback mutates model state", async () => {
|
||||
@@ -918,8 +918,7 @@ describe("session_status tool", () => {
|
||||
modelOverride: "claude-sonnet-4-6",
|
||||
liveModelSwitchPending: true,
|
||||
});
|
||||
expect(saved.sessionId).toBeTypeOf("string");
|
||||
expect(saved.sessionId.trim().length).toBeGreaterThan(0);
|
||||
expect(saved.sessionId).toMatch(UUID_RE);
|
||||
});
|
||||
|
||||
it("does not synthesize a current fallback for unknown non-literal session keys", async () => {
|
||||
|
||||
Reference in New Issue
Block a user