export const CONFIG_RESOLUTION_FIELDS = [
  { key: "baseUrl", configMode: "truthy", envVar: "MEMOS_BASE_URL", envMode: "truthy", fallbackSource: "default", uiDefaultValue: "https://memos.memtensor.cn/api/openmem/v1" },
  { key: "apiKey", configMode: "truthy", envVar: "MEMOS_API_KEY", envMode: "truthy", fallbackSource: "empty", inheritedFrom: "env", inheritedFallback: "" },
  { key: "userId", configMode: "truthy", envVar: "MEMOS_USER_ID", envMode: "truthy", fallbackSource: "default", uiDefaultValue: "openclaw-user", inheritedFrom: "env", inheritedFallback: "openclaw-user" },
  { key: "useDirectSessionUserId", configMode: "nullish", envVar: "MEMOS_USE_DIRECT_SESSION_USER_ID", envMode: "defined", fallbackSource: "default", uiDefaultValue: false },
  { key: "conversationId", configMode: "truthy", envVar: "MEMOS_CONVERSATION_ID", envMode: "truthy", fallbackSource: "empty", inheritedFrom: "env", inheritedFallback: "" },
  { key: "conversationIdPrefix", configMode: "nullish", envVar: "MEMOS_CONVERSATION_PREFIX", envMode: "defined", fallbackSource: "empty", inheritedFrom: "env", inheritedFallback: "" },
  { key: "conversationIdSuffix", configMode: "nullish", envVar: "MEMOS_CONVERSATION_SUFFIX", envMode: "defined", fallbackSource: "empty", inheritedFrom: "env", inheritedFallback: "" },
  { key: "conversationSuffixMode", configMode: "nullish", envVar: "MEMOS_CONVERSATION_SUFFIX_MODE", envMode: "truthy", fallbackSource: "default", uiDefaultValue: "none" },
  { key: "resetOnNew", configMode: "nullish", envVar: "MEMOS_CONVERSATION_RESET_ON_NEW", envMode: "defined", fallbackSource: "default", uiDefaultValue: true },
  { key: "queryPrefix", configMode: "nullish", envMode: "none", fallbackSource: "empty", inheritedValue: "" },
  { key: "maxQueryChars", configMode: "nullish", envMode: "none", fallbackSource: "default", uiDefaultValue: 0 },
  { key: "recallEnabled", configMode: "nullish", envMode: "none", fallbackSource: "default", uiDefaultValue: true },
  { key: "recallGlobal", configMode: "nullish", envVar: "MEMOS_RECALL_GLOBAL", envMode: "defined", fallbackSource: "default", uiDefaultValue: true },
  { key: "maxItemChars", configMode: "nullish", envMode: "none", fallbackSource: "default", uiDefaultValue: 8000 },
  { key: "memoryLimitNumber", configMode: "nullish", envMode: "none", fallbackSource: "default", uiDefaultValue: 9 },
  { key: "preferenceLimitNumber", configMode: "nullish", envMode: "none", fallbackSource: "default", uiDefaultValue: 6 },
  { key: "includePreference", configMode: "nullish", envMode: "none", fallbackSource: "default", uiDefaultValue: true },
  { key: "includeToolMemory", configMode: "nullish", envMode: "none", fallbackSource: "default", uiDefaultValue: false },
  { key: "toolMemoryLimitNumber", configMode: "nullish", envMode: "none", fallbackSource: "default", uiDefaultValue: 6 },
  { key: "relativity", configMode: "nullish", envVar: "MEMOS_RELATIVITY", envMode: "defined", fallbackSource: "default", uiDefaultValue: 0.45 },
  { key: "filter", configMode: "nullish", envMode: "none", fallbackSource: "empty", inheritedValue: undefined },
  { key: "knowledgebaseIds", configMode: "nullish", envMode: "none", fallbackSource: "default", uiDefaultValue: [] },
  { key: "addEnabled", configMode: "nullish", envMode: "none", fallbackSource: "default", uiDefaultValue: true },
  { key: "captureStrategy", configMode: "nullish", envVar: "MEMOS_CAPTURE_STRATEGY", envMode: "truthy", fallbackSource: "default", uiDefaultValue: "last_turn" },
  { key: "maxMessageChars", configMode: "nullish", envVar: "MEMOS_MAX_MESSAGE_CHARS", envMode: "defined", fallbackSource: "default", uiDefaultValue: 20000, inheritedFrom: "env", inheritedFallback: 20000 },
  { key: "includeAssistant", configMode: "nullish", envVar: "MEMOS_INCLUDE_ASSISTANT", envMode: "defined", fallbackSource: "default", uiDefaultValue: true },
  { key: "tags", configMode: "nullish", envMode: "none", fallbackSource: "default", uiDefaultValue: ["openclaw"] },
  { key: "info", configMode: "nullish", envMode: "none", fallbackSource: "default", uiDefaultValue: {} },
  { key: "asyncMode", configMode: "nullish", envVar: "MEMOS_ASYNC_MODE", envMode: "defined", fallbackSource: "default", uiDefaultValue: true },
  { key: "agentId", configMode: "nullish", envMode: "none", fallbackSource: "empty", inheritedValue: undefined },
  { key: "multiAgentMode", configMode: "nullish", envVar: "MEMOS_MULTI_AGENT_MODE", envMode: "defined", fallbackSource: "default", uiDefaultValue: false },
  { key: "allowedAgents", configMode: "nullish", envVar: "MEMOS_ALLOWED_AGENTS", envMode: "defined", fallbackSource: "default", uiDefaultValue: [] },
  { key: "agentOverrides", configKey: "agentOverrides", resolvedKey: "_agentOverrides", configMode: "nullish", envVar: "MEMOS_AGENT_OVERRIDES", envMode: "defined", fallbackSource: "default", uiDefaultValue: {} },
  { key: "appId", configMode: "nullish", envMode: "none", fallbackSource: "empty", inheritedValue: undefined },
  { key: "allowPublic", configMode: "nullish", envMode: "none", fallbackSource: "default", uiDefaultValue: false },
  { key: "allowKnowledgebaseIds", configMode: "nullish", envMode: "none", fallbackSource: "default", uiDefaultValue: [] },
  { key: "recallFilterEnabled", configMode: "nullish", envVar: "MEMOS_RECALL_FILTER_ENABLED", envMode: "defined", fallbackSource: "default", uiDefaultValue: false },
  { key: "recallFilterBaseUrl", configMode: "nullish", envVar: "MEMOS_RECALL_FILTER_BASE_URL", envMode: "defined", fallbackSource: "empty" },
  { key: "recallFilterApiKey", configMode: "nullish", envVar: "MEMOS_RECALL_FILTER_API_KEY", envMode: "defined", fallbackSource: "empty" },
  { key: "recallFilterModel", configMode: "nullish", envVar: "MEMOS_RECALL_FILTER_MODEL", envMode: "defined", fallbackSource: "empty" },
  { key: "recallFilterTimeoutMs", configMode: "nullish", envVar: "MEMOS_RECALL_FILTER_TIMEOUT_MS", envMode: "defined", fallbackSource: "default", uiDefaultValue: 6000 },
  { key: "recallFilterRetries", configMode: "nullish", envVar: "MEMOS_RECALL_FILTER_RETRIES", envMode: "defined", fallbackSource: "default", uiDefaultValue: 0 },
  { key: "recallFilterCandidateLimit", configMode: "nullish", envVar: "MEMOS_RECALL_FILTER_CANDIDATE_LIMIT", envMode: "defined", fallbackSource: "default", uiDefaultValue: 30 },
  { key: "recallFilterMaxItemChars", configMode: "nullish", envVar: "MEMOS_RECALL_FILTER_MAX_ITEM_CHARS", envMode: "defined", fallbackSource: "default", uiDefaultValue: 500 },
  { key: "recallFilterFailOpen", configMode: "nullish", envVar: "MEMOS_RECALL_FILTER_FAIL_OPEN", envMode: "defined", fallbackSource: "default", uiDefaultValue: true },
  { key: "timeoutMs", configMode: "nullish", envMode: "none", fallbackSource: "default", uiDefaultValue: 5000 },
  { key: "retries", configMode: "nullish", envMode: "none", fallbackSource: "default", uiDefaultValue: 1 },
  { key: "throttleMs", configMode: "nullish", envVar: "MEMOS_THROTTLE_MS", envMode: "defined", fallbackSource: "default", uiDefaultValue: 0 },
];
