mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
CLI: make read-only SecretRef status flows degrade safely (#37023)
* CLI: add read-only SecretRef inspection * CLI: fix read-only SecretRef status regressions * CLI: preserve read-only SecretRef status fallbacks * Docs: document read-only channel inspection hook * CLI: preserve audit coverage for read-only SecretRefs * CLI: fix read-only status account selection * CLI: fix targeted gateway fallback analysis * CLI: fix Slack HTTP read-only inspection * CLI: align audit credential status checks * CLI: restore Telegram read-only fallback semantics
This commit is contained in:
@@ -178,6 +178,38 @@ Compatibility note:
|
||||
subpaths; use `core` for generic surfaces and `compat` only when broader
|
||||
shared helpers are required.
|
||||
|
||||
## Read-only channel inspection
|
||||
|
||||
If your plugin registers a channel, prefer implementing
|
||||
`plugin.config.inspectAccount(cfg, accountId)` alongside `resolveAccount(...)`.
|
||||
|
||||
Why:
|
||||
|
||||
- `resolveAccount(...)` is the runtime path. It is allowed to assume credentials
|
||||
are fully materialized and can fail fast when required secrets are missing.
|
||||
- Read-only command paths such as `openclaw status`, `openclaw status --all`,
|
||||
`openclaw channels status`, `openclaw channels resolve`, and doctor/config
|
||||
repair flows should not need to materialize runtime credentials just to
|
||||
describe configuration.
|
||||
|
||||
Recommended `inspectAccount(...)` behavior:
|
||||
|
||||
- Return descriptive account state only.
|
||||
- Preserve `enabled` and `configured`.
|
||||
- Include credential source/status fields when relevant, such as:
|
||||
- `tokenSource`, `tokenStatus`
|
||||
- `botTokenSource`, `botTokenStatus`
|
||||
- `appTokenSource`, `appTokenStatus`
|
||||
- `signingSecretSource`, `signingSecretStatus`
|
||||
- You do not need to return raw token values just to report read-only
|
||||
availability. Returning `tokenStatus: "available"` (and the matching source
|
||||
field) is enough for status-style commands.
|
||||
- Use `configured_unavailable` when a credential is configured via SecretRef but
|
||||
unavailable in the current command path.
|
||||
|
||||
This lets read-only commands report “configured but unavailable in this command
|
||||
path” instead of crashing or misreporting the account as not configured.
|
||||
|
||||
Performance note:
|
||||
|
||||
- Plugin discovery and manifest metadata use short in-process caches to reduce
|
||||
|
||||
Reference in New Issue
Block a user