Merge branch 'pr-1479' into integration/validation-batch
This commit is contained in:
@@ -27,6 +27,11 @@
|
|||||||
"default": 37777,
|
"default": 37777,
|
||||||
"description": "Port for Claude-Mem worker service"
|
"description": "Port for Claude-Mem worker service"
|
||||||
},
|
},
|
||||||
|
"workerHost": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "127.0.0.1",
|
||||||
|
"description": "Hostname for Claude-Mem worker service. Set to host.docker.internal when the gateway runs in Docker and the worker runs on the host."
|
||||||
|
},
|
||||||
"project": {
|
"project": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "openclaw",
|
"default": "openclaw",
|
||||||
|
|||||||
@@ -183,6 +183,7 @@ interface ClaudeMemPluginConfig {
|
|||||||
syncMemoryFileExclude?: string[];
|
syncMemoryFileExclude?: string[];
|
||||||
project?: string;
|
project?: string;
|
||||||
workerPort?: number;
|
workerPort?: number;
|
||||||
|
workerHost?: string;
|
||||||
observationFeed?: {
|
observationFeed?: {
|
||||||
enabled?: boolean;
|
enabled?: boolean;
|
||||||
channel?: string;
|
channel?: string;
|
||||||
@@ -198,6 +199,7 @@ interface ClaudeMemPluginConfig {
|
|||||||
|
|
||||||
const MAX_SSE_BUFFER_SIZE = 1024 * 1024; // 1MB
|
const MAX_SSE_BUFFER_SIZE = 1024 * 1024; // 1MB
|
||||||
const DEFAULT_WORKER_PORT = 37777;
|
const DEFAULT_WORKER_PORT = 37777;
|
||||||
|
const DEFAULT_WORKER_HOST = "127.0.0.1";
|
||||||
|
|
||||||
// Emoji pool for deterministic auto-assignment to unknown agents.
|
// Emoji pool for deterministic auto-assignment to unknown agents.
|
||||||
// Uses a hash of the agentId to pick a consistent emoji — no persistent state needed.
|
// Uses a hash of the agentId to pick a consistent emoji — no persistent state needed.
|
||||||
@@ -256,8 +258,10 @@ function buildGetSourceLabel(
|
|||||||
// Worker HTTP Client
|
// Worker HTTP Client
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
|
let _workerHost = DEFAULT_WORKER_HOST;
|
||||||
|
|
||||||
function workerBaseUrl(port: number): string {
|
function workerBaseUrl(port: number): string {
|
||||||
return `http://127.0.0.1:${port}`;
|
return `http://${_workerHost}:${port}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function workerPost(
|
async function workerPost(
|
||||||
@@ -533,6 +537,7 @@ async function connectToSSEStream(
|
|||||||
export default function claudeMemPlugin(api: OpenClawPluginApi): void {
|
export default function claudeMemPlugin(api: OpenClawPluginApi): void {
|
||||||
const userConfig = (api.pluginConfig || {}) as ClaudeMemPluginConfig;
|
const userConfig = (api.pluginConfig || {}) as ClaudeMemPluginConfig;
|
||||||
const workerPort = userConfig.workerPort || DEFAULT_WORKER_PORT;
|
const workerPort = userConfig.workerPort || DEFAULT_WORKER_PORT;
|
||||||
|
_workerHost = userConfig.workerHost || DEFAULT_WORKER_HOST;
|
||||||
const baseProjectName = userConfig.project || "openclaw";
|
const baseProjectName = userConfig.project || "openclaw";
|
||||||
const getSourceLabel = buildGetSourceLabel(userConfig.observationFeed?.emojis);
|
const getSourceLabel = buildGetSourceLabel(userConfig.observationFeed?.emojis);
|
||||||
|
|
||||||
@@ -1047,5 +1052,5 @@ export default function claudeMemPlugin(api: OpenClawPluginApi): void {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
api.logger.info(`[claude-mem] OpenClaw plugin loaded — v1.0.0 (worker: 127.0.0.1:${workerPort})`);
|
api.logger.info(`[claude-mem] OpenClaw plugin loaded — v1.0.0 (worker: ${_workerHost}:${workerPort})`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user