Skip to content

fix: fall back to root plugin config#328

Merged
jalehman merged 2 commits into
mainfrom
issue-325/plugin-config-root-fallback
Apr 9, 2026
Merged

fix: fall back to root plugin config#328
jalehman merged 2 commits into
mainfrom
issue-325/plugin-config-root-fallback

Conversation

@jalehman

@jalehman jalehman commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

What

This PR hardens lossless-claw's runtime config loading during plugin registration so the plugin still reads its settings from the root OpenClaw config when api.pluginConfig is missing or unusable.

Why

Some OpenClaw runtimes do not provide a usable api.pluginConfig to plugin registration, which caused lossless-claw to ignore configured settings even though the same values were still present under plugins.entries["lossless-claw"].config.

Changes

  • Add root-config fallback for plugin registration
  • Cover missing direct plugin config path
  • Cover invalid direct plugin config path
  • Add patch changeset for runtime fix

Testing

  • npx vitest run test/plugin-config-registration.test.ts
  • Expect 23 tests to pass, including the new root-config fallback cases

Closed #325

jalehman added 2 commits April 8, 2026 12:43
Restore runtime config loading for OpenClaw builds that do not pass a usable
api.pluginConfig into the plugin registration path. Add focused registration
coverage for the nested plugins.entries["lossless-claw"].config fallback and a
patch changeset for the runtime fix.

Regeneration-Prompt: |
  Implement fix (2) from the issue-325 investigation in lossless-claw. Keep the
  change narrow: harden runtime config loading so plugin registration uses
  api.pluginConfig when it is a plain object, but falls back to
  api.config.plugins.entries["lossless-claw"].config when api.pluginConfig is
  missing or unusable. Add targeted regression coverage for both the missing and
  invalid direct plugin-config cases, and include a patch changeset because this
  is a user-visible runtime compatibility fix.
Treat an empty object in api.pluginConfig as unusable so registration still falls back to plugins.entries["lossless-claw"].config on incompatible OpenClaw runtimes. Add regression coverage for the empty-object case alongside the existing missing and invalid pluginConfig scenarios.

Regeneration-Prompt: |
  Follow up on PR 328's plugin-config fallback fix in lossless-claw. Keep the change narrow: the direct api.pluginConfig path should still win when it contains real settings, but an injected empty object from incompatible OpenClaw runtimes must not suppress the fallback to api.config.plugins.entries["lossless-claw"].config. Extend the registration regression test matrix to cover the empty-object case and rerun the targeted vitest file.
@jalehman jalehman merged commit 3de1f9e into main Apr 9, 2026
2 checks passed
@github-actions github-actions Bot mentioned this pull request Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Does not load config data via openclaw.json , openclaw config command broken

1 participant