feat: Bitwarden secret resolver and async register#398
feat: Bitwarden secret resolver and async register#398Coke1120 wants to merge 3 commits intoCortexReach:masterfrom
Conversation
Add src/secret-resolver.ts supporting ${ENV_VAR} and bws://<secret-id>
Bitwarden CLI secret references for embedding, rerank, and LLM API keys.
Make plugin register() async to support async secret resolution.
Update openclaw.plugin.json docs to advertise bws:// support.
Fix all tests to await plugin.register().
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
With async register() now awaited, selfImprovement defaults to enabled and registers command:new before the sessionMemory assertion runs. Explicitly disable it in the base test config to isolate the assertion. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Review: REQUEST-CHANGESThe Bitwarden secret resolver addresses a real operational gap (issue #349). Two issues need fixing before merge: Must fix:
Worth considering (not blocking):
|
…t resolution
Make register() synchronous again (OpenClaw loader does not await it).
All hook/tool registrations happen immediately; embedder, retriever, and
smartExtractor are initialized in a fire-and-forget initPromise that
resolves async secrets. Every hook that uses these awaits initPromise
before proceeding. register() returns initPromise so awaiting callers
(tests, host implementations that do support async) can still wait.
Also fix:
- bws access token passed via BWS_ACCESS_TOKEN env var instead of
--access-token CLI arg to avoid exposure in process listings
- embedder double-resolveEnvVars: skip expansion if key lacks ${}
- selfImprovement: { enabled: false } in sessionDefaultApi,
sessionEnabledApi, and session-summary harness to isolate assertions
from the now-default-true selfImprovement feature
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
src/secret-resolver.tssupporting${ENV_VAR}andbws://<secret-id>Bitwarden Secrets Manager refs for embedding, rerank, and LLM API keysplugin.register()async to support async secret resolutionopenclaw.plugin.jsondocs to advertisebws://support on all API key fieldsawait plugin.register()Test plan
node --test test/secret-resolver.test.mjs— verify Bitwarden and env-var resolution pathsnpm test— full test suite passes with async registerSplit from #349.
🤖 Generated with Claude Code