fix: allow anonymousTelemetryId in openclaw.json config (#4826)
Co-authored-by: parteeksachdeva-123 <parteek.sachdeva@aerchain.io>
This commit is contained in:
@@ -147,6 +147,7 @@ export const DEFAULT_CUSTOM_CATEGORIES: Record<string, string> = {
|
||||
const ALLOWED_KEYS = [
|
||||
"mode",
|
||||
"apiKey",
|
||||
"anonymousTelemetryId",
|
||||
"baseUrl",
|
||||
"userId",
|
||||
"userEmail",
|
||||
@@ -215,6 +216,10 @@ export const mem0ConfigSchema = {
|
||||
return {
|
||||
mode,
|
||||
apiKey: resolvedApiKey,
|
||||
anonymousTelemetryId:
|
||||
typeof cfg.anonymousTelemetryId === "string"
|
||||
? cfg.anonymousTelemetryId
|
||||
: undefined,
|
||||
baseUrl: resolvedBaseUrl,
|
||||
userId:
|
||||
typeof cfg.userId === "string" && cfg.userId
|
||||
|
||||
@@ -134,6 +134,10 @@
|
||||
"topK": {
|
||||
"type": "number"
|
||||
},
|
||||
"anonymousTelemetryId": {
|
||||
"type": "string",
|
||||
"description": "Persistent anonymous telemetry identifier"
|
||||
},
|
||||
"oss": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
@@ -88,6 +88,11 @@ describe("mem0ConfigSchema.parse() — defaults", () => {
|
||||
const cfg = mem0ConfigSchema.parse({ apiKey: "test-key" });
|
||||
expect(cfg.skills).toBeUndefined();
|
||||
});
|
||||
|
||||
it("allows anonymousTelemetryId", () => {
|
||||
const cfg = mem0ConfigSchema.parse({ apiKey: "test-key", anonymousTelemetryId: "123" });
|
||||
expect(cfg.anonymousTelemetryId).toBe("123");
|
||||
});
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -8,6 +8,7 @@ export type Mem0Config = {
|
||||
mode: Mem0Mode;
|
||||
// Platform-specific
|
||||
apiKey?: string;
|
||||
anonymousTelemetryId?: string;
|
||||
baseUrl?: string;
|
||||
customInstructions: string;
|
||||
customCategories: Record<string, string>;
|
||||
|
||||
Reference in New Issue
Block a user