fix: fall back to root plugin config#328
Merged
Merged
Conversation
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.
Merged
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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.pluginConfigis missing or unusable.Why
Some OpenClaw runtimes do not provide a usable
api.pluginConfigto plugin registration, which caused lossless-claw to ignore configured settings even though the same values were still present underplugins.entries["lossless-claw"].config.Changes
Testing
npx vitest run test/plugin-config-registration.test.ts23tests to pass, including the new root-config fallback casesClosed #325