You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
memos-local-openclaw still falls back to ~/.openclaw in several runtime paths, which breaks instance isolation when OpenClaw is started with --profile.
This can cause the plugin to read or write config, viewer data, migration sources, and fallback model settings from the default instance instead of the active profile instance.
这会导致插件从默认实例而不是当前 profile 实例读取或写入配置、viewer 数据、migration 数据源,以及 fallback model 配置。
Changes | 改动
add profile-aware OpenClaw path helpers
make viewer config read/write use the active instance state dir
make viewer migration scan use the active instance state dir
make OpenClaw fallback model config load from the active instance state dir
pass stateDir through the summarizer call chain
keep default behavior unchanged when no explicit profile state dir is provided
增加 profile-aware 的 OpenClaw 路径辅助函数
让 viewer 的配置读写使用当前实例的 stateDir
让 viewer 的 migration 扫描使用当前实例的 stateDir
让 OpenClaw fallback model 配置从当前实例的 stateDir 加载
在 summarizer 调用链中透传 stateDir
在未提供显式 profile stateDir 时保持默认行为不变
Tests | 测试
npm run build
npm test -- tests/profile-paths.test.ts tests/plugin-impl-access.test.ts tests/shutdown-lifecycle.test.ts
This PR enables OpenClaw profile support by making all paths to openclaw.json and the OpenClaw home directory respect the stateDir parameter instead of hardcoded ~/.openclaw. It introduces two new utility functions getOpenClawHome() and getOpenClawConfigPath() in config.ts, then propagates stateDir through Summarizer, loadOpenClawFallbackConfig(), buildSkillConfigChain(), ViewerServer, and the recall engine. A comprehensive test file (profile-paths.test.ts) validates that profile-specific config is loaded correctly.
The approach is clean and consistent — the change is mostly mechanical propagation of an existing parameter. The test coverage is good. This is an important feature for multi-profile/multi-instance deployments.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background | 背景
Closes #1224
memos-local-openclawstill falls back to~/.openclawin several runtime paths, which breaks instance isolation when OpenClaw is started with--profile.memos-local-openclaw在若干运行时路径上仍然会回退到~/.openclaw,这会破坏 OpenClaw 使用--profile启动时的实例隔离。This can cause the plugin to read or write config, viewer data, migration sources, and fallback model settings from the default instance instead of the active profile instance.
这会导致插件从默认实例而不是当前 profile 实例读取或写入配置、viewer 数据、migration 数据源,以及 fallback model 配置。
Changes | 改动
add profile-aware OpenClaw path helpers
make viewer config read/write use the active instance state dir
make viewer migration scan use the active instance state dir
make OpenClaw fallback model config load from the active instance state dir
pass
stateDirthrough the summarizer call chainkeep default behavior unchanged when no explicit profile state dir is provided
增加 profile-aware 的 OpenClaw 路径辅助函数
让 viewer 的配置读写使用当前实例的
stateDir让 viewer 的 migration 扫描使用当前实例的
stateDir让 OpenClaw fallback model 配置从当前实例的
stateDir加载在 summarizer 调用链中透传
stateDir在未提供显式 profile
stateDir时保持默认行为不变Tests | 测试
npm run buildnpm test -- tests/profile-paths.test.ts tests/plugin-impl-access.test.ts tests/shutdown-lifecycle.test.tsScope | 范围说明
no schema changes
no recall algorithm changes
no embedding algorithm changes
no install-script or README changes in this PR
不涉及 schema 变更
不涉及 recall 算法变更
不涉及 embedding 算法变更
本 PR 不包含安装脚本或 README 修改