fleet-memory/hindsight-integrations/openclaw/openclaw.plugin.json
Anton Evseev c461013047
fix(openclaw): shell safety, HTTP dual-mode, lazy reinit, per-user banks (#388)
- exec→execFile: bypass shell entirely, preventing injection via
  special characters in chat history
- HTTP dual-mode: client can now talk directly to the Hindsight API
  via HTTP (setBankMission, retain, recall) when apiUrl is configured,
  bypassing the subprocess/CLI entirely for production deployments
- HindsightClientOptions: replace 5 positional constructor args with
  a typed options object for clarity and extensibility
- sanitize(): strip null bytes from strings — Node 22 rejects them
  in execFile() args
- recall timeout: accept optional timeoutMs parameter for both HTTP
  and subprocess modes; subprocess gets a longer 30s default
- In-flight recall dedup: concurrent recalls for the same bank reuse
  one promise instead of firing duplicate requests
- Timeout/abort handling: graceful warn-level logging instead of
  error spam when recall times out
- Error cause chaining: wrap errors with { cause } for better
  debugging stack traces
- lazyReinit: recover from startup health check failure with 30s
  cooldown and concurrency guard
- Per-user banks: derive bank ID from senderId (not channelId) for
  proper memory isolation per user across channels
- buildClientOptions(): centralized helper replaces 7 duplicated
  constructor call sites

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 13:09:02 +01:00

124 lines
4.7 KiB
JSON

{
"id": "hindsight-openclaw",
"name": "Hindsight Memory",
"kind": "memory",
"configSchema": {
"type": "object",
"properties": {
"daemonIdleTimeout": {
"type": "number",
"description": "Seconds before daemon shuts down from inactivity (0 = never)",
"default": 0
},
"embedPort": {
"type": "number",
"description": "Port for hindsight-embed server (auto-assigned if not specified)",
"default": 0
},
"bankMission": {
"type": "string",
"description": "Custom mission/context for the memory bank",
"default": "You are an AI assistant helping users across multiple communication channels (Telegram, Slack, Discord, etc.). Remember user preferences, instructions, and important context from conversations to provide personalized assistance."
},
"embedVersion": {
"type": "string",
"description": "hindsight-embed version to use (e.g. 'latest', '0.4.2', or empty for latest)",
"default": "latest"
},
"llmProvider": {
"type": "string",
"description": "LLM provider for Hindsight memory (e.g. 'openai', 'anthropic', 'gemini', 'groq', 'ollama', 'openai-codex', 'claude-code'). Takes priority over auto-detection but not over HINDSIGHT_API_LLM_PROVIDER env var.",
"enum": ["openai", "anthropic", "gemini", "groq", "ollama", "openai-codex", "claude-code"]
},
"llmModel": {
"type": "string",
"description": "LLM model to use (e.g. 'gpt-4o-mini', 'claude-3-5-haiku-20241022'). Used with llmProvider."
},
"llmApiKeyEnv": {
"type": "string",
"description": "Name of the env var holding the API key (e.g. 'MY_CUSTOM_KEY'). If not set, uses the standard env var for the chosen provider."
},
"embedPackagePath": {
"type": "string",
"description": "Local path to hindsight package for development (e.g. '/path/to/hindsight'). When set, uses 'uv run --directory <path>' instead of 'uvx hindsight-embed@latest'."
},
"apiPort": {
"type": "number",
"description": "Port for the openclaw profile daemon (default: 9077)",
"default": 9077
},
"hindsightApiUrl": {
"type": "string",
"description": "External Hindsight API URL (e.g. 'https://mcp.hindsight.devcraft.team'). When set, skips local daemon and connects directly to this API."
},
"hindsightApiToken": {
"type": "string",
"description": "API token for external Hindsight API authentication. Required if the external API has authentication enabled."
},
"dynamicBankId": {
"type": "boolean",
"description": "Enable per-user memory banks. When true, memories are isolated by user per channel (e.g., slack-U123, telegram-456789). When false, all users share a single 'openclaw' bank.",
"default": true
},
"bankIdPrefix": {
"type": "string",
"description": "Optional prefix for bank IDs (e.g., 'prod' results in 'prod-slack-U123'). Useful for separating environments."
}
},
"additionalProperties": false
},
"uiHints": {
"daemonIdleTimeout": {
"label": "Daemon Idle Timeout",
"placeholder": "0 (never timeout)"
},
"embedPort": {
"label": "Embed Server Port",
"placeholder": "0 (auto-assign)"
},
"bankMission": {
"label": "Bank Mission",
"placeholder": "Custom context for what this agent does..."
},
"embedVersion": {
"label": "Hindsight Embed Version",
"placeholder": "latest (or pin to specific version like 0.4.2)"
},
"llmProvider": {
"label": "LLM Provider",
"placeholder": "e.g. openai, anthropic, gemini, groq"
},
"llmModel": {
"label": "LLM Model",
"placeholder": "e.g. gpt-4o-mini, claude-3-5-haiku-20241022"
},
"llmApiKeyEnv": {
"label": "API Key Env Var",
"placeholder": "e.g. MY_CUSTOM_API_KEY (optional)"
},
"embedPackagePath": {
"label": "Local Package Path (Dev)",
"placeholder": "/path/to/hindsight (for local development)"
},
"apiPort": {
"label": "API Port",
"placeholder": "9077 (default)"
},
"hindsightApiUrl": {
"label": "External Hindsight API URL",
"placeholder": "e.g. https://mcp.hindsight.devcraft.team (leave empty for local daemon)"
},
"hindsightApiToken": {
"label": "External API Token",
"placeholder": "API token if external API requires authentication"
},
"dynamicBankId": {
"label": "Dynamic Bank IDs",
"placeholder": "true (isolate memories per channel)"
},
"bankIdPrefix": {
"label": "Bank ID Prefix",
"placeholder": "e.g., prod, staging (optional)"
}
}
}