fix(openclaw): tolerate missing state dir resolver - #182
Conversation
|
Making plugin registration more resilient to uninitialized runtime is an important stability fix. The multiple fallback layers provide good coverage. We'll review and merge. |
1334fbb to
1c92460
Compare
|
Hi @Maxwell-Code07 — gentle ping on #182. You previously framed the state-dir resolver fallback as "an important stability fix" and explicitly said "We'll review and merge." I rebased onto current If anything blocks review on your side (scope, naming, follow-up patch), let me know and I'll address it on the same branch. Otherwise, any rough ETA so I can plan the next batch of PRs around it? |
YOMXXX
left a comment
There was a problem hiding this comment.
Approved as the canonical fix for #89.
Local verification:
COREPACK_ENABLE_AUTO_PIN=0 pnpm test(71/71 passed)COREPACK_ENABLE_AUTO_PIN=0 pnpm buildgit diff --check
This keeps the existing state-dir priority order while tolerating missing/throwing runtime state resolvers during plugin registration.
Signed-off-by: Ziyang Guo <121015044+RerankerGuo@users.noreply.github.com>
1c92460 to
d1d4fc4
Compare
|
Maintenance update: rebased onto current |
Description | 描述
Harden OpenClaw state directory resolution during plugin registration.
When OpenClaw loads the plugin before
runtime.stateis fully initialized, state directory lookup should not make registration fail. This change keeps the existing priority order but makes it more defensive:runtime.state.resolveStateDir()when available,OPENCLAW_STATE_DIRwhen the runtime state is missing, empty, or throws,~/.openclawwhen no host-provided state directory is available.Added focused tests for runtime, environment, throwing resolver, and default fallback paths.
Related Issue | 关联 Issue
Fix #89
Change Type | 修改类型
Self-test Checklist | 自测清单
Additional Notes | 其他说明
Verified with
npm testandnpm run buildusing Node v24.15.0.