fix(feishu): keep top-level appSecret SecretRef active for the implicit default account (fixes #96929)#96965
Conversation
…it default account When a Feishu channel has top-level appId/appSecret using SecretRef format and sub-accounts with their own inline appSecret, the secrets resolver marks the top-level SecretRef as inactive because isBaseFieldActiveForChannelSurface only checks whether any explicit account inherits the field. Feishu account listing always creates an implicit default account from top-level credentials. The fix detects this implicit default account and keeps the top-level appSecret active accordingly, without changing the shared channel secret helper semantics for other channels. Fixes openclaw#96929 Signed-off-by: 赵旺0668001248 <[email protected]>
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Codex review: needs maintainer review before merge. Reviewed June 26, 2026, 2:56 AM ET / 06:56 UTC. Summary PR surface: Source +34, Tests +34. Total +68 across 2 files. Reproducibility: yes. source-level: current main combines Feishu implicit default account creation with top-level appSecret inactive-surface filtering when every explicit account overrides the field. I did not run tests or a live gateway startup because this review is read-only. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review detailsBest possible solution: Land a narrow Feishu-owned fix that mirrors Feishu account listing for top-level appSecret activation while preserving shared inactive-surface filtering for sibling channels. Do we have a high-confidence way to reproduce the issue? Yes, source-level: current main combines Feishu implicit default account creation with top-level appSecret inactive-surface filtering when every explicit account overrides the field. I did not run tests or a live gateway startup because this review is read-only. Is this the best way to solve the issue? Yes: the Feishu-owned active check is the narrowest maintainable fix because changing the shared helper would alter sibling channel credential semantics. The PR preserves named-account handling and adds focused regression coverage. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 81e53202f25f. Label changesLabel justifications:
Evidence reviewedPR surface: Source +34, Tests +34. Total +68 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
…it default account (openclaw#96965) When a Feishu channel has top-level appId/appSecret using SecretRef format and sub-accounts with their own inline appSecret, the secrets resolver marks the top-level SecretRef as inactive because isBaseFieldActiveForChannelSurface only checks whether any explicit account inherits the field. Feishu account listing always creates an implicit default account from top-level credentials. The fix detects this implicit default account and keeps the top-level appSecret active accordingly, without changing the shared channel secret helper semantics for other channels. Fixes openclaw#96929 Signed-off-by: 赵旺0668001248 <[email protected]>
…it default account (openclaw#96965) When a Feishu channel has top-level appId/appSecret using SecretRef format and sub-accounts with their own inline appSecret, the secrets resolver marks the top-level SecretRef as inactive because isBaseFieldActiveForChannelSurface only checks whether any explicit account inherits the field. Feishu account listing always creates an implicit default account from top-level credentials. The fix detects this implicit default account and keeps the top-level appSecret active accordingly, without changing the shared channel secret helper semantics for other channels. Fixes openclaw#96929 Signed-off-by: 赵旺0668001248 <[email protected]>
…it default account (openclaw#96965) When a Feishu channel has top-level appId/appSecret using SecretRef format and sub-accounts with their own inline appSecret, the secrets resolver marks the top-level SecretRef as inactive because isBaseFieldActiveForChannelSurface only checks whether any explicit account inherits the field. Feishu account listing always creates an implicit default account from top-level credentials. The fix detects this implicit default account and keeps the top-level appSecret active accordingly, without changing the shared channel secret helper semantics for other channels. Fixes openclaw#96929 Signed-off-by: 赵旺0668001248 <[email protected]>
…it default account (openclaw#96965) When a Feishu channel has top-level appId/appSecret using SecretRef format and sub-accounts with their own inline appSecret, the secrets resolver marks the top-level SecretRef as inactive because isBaseFieldActiveForChannelSurface only checks whether any explicit account inherits the field. Feishu account listing always creates an implicit default account from top-level credentials. The fix detects this implicit default account and keeps the top-level appSecret active accordingly, without changing the shared channel secret helper semantics for other channels. Fixes openclaw#96929 Signed-off-by: 赵旺0668001248 <[email protected]>
…it default account (openclaw#96965) When a Feishu channel has top-level appId/appSecret using SecretRef format and sub-accounts with their own inline appSecret, the secrets resolver marks the top-level SecretRef as inactive because isBaseFieldActiveForChannelSurface only checks whether any explicit account inherits the field. Feishu account listing always creates an implicit default account from top-level credentials. The fix detects this implicit default account and keeps the top-level appSecret active accordingly, without changing the shared channel secret helper semantics for other channels. Fixes openclaw#96929 Signed-off-by: 赵旺0668001248 <[email protected]> (cherry picked from commit 4e7992c)
…it default account (openclaw#96965) When a Feishu channel has top-level appId/appSecret using SecretRef format and sub-accounts with their own inline appSecret, the secrets resolver marks the top-level SecretRef as inactive because isBaseFieldActiveForChannelSurface only checks whether any explicit account inherits the field. Feishu account listing always creates an implicit default account from top-level credentials. The fix detects this implicit default account and keeps the top-level appSecret active accordingly, without changing the shared channel secret helper semantics for other channels. Fixes openclaw#96929 Signed-off-by: 赵旺0668001248 <[email protected]> (cherry picked from commit 4e7992c)
…it default account (openclaw#96965) When a Feishu channel has top-level appId/appSecret using SecretRef format and sub-accounts with their own inline appSecret, the secrets resolver marks the top-level SecretRef as inactive because isBaseFieldActiveForChannelSurface only checks whether any explicit account inherits the field. Feishu account listing always creates an implicit default account from top-level credentials. The fix detects this implicit default account and keeps the top-level appSecret active accordingly, without changing the shared channel secret helper semantics for other channels. Fixes openclaw#96929 Signed-off-by: 赵旺0668001248 <[email protected]> (cherry picked from commit 4e7992c)
What Problem This Solves
Fixes #96929.
When a Feishu channel has both a top-level
appSecretusing SecretRef format and sub-accounts (e.g.accounts.resource-shrimp) with their own inlineappSecret, the secrets resolver skips resolving the top-level SecretRef. This causes the[default]channel to fail on startup with:The resolver logs
SECRETS_REF_IGNORED_INACTIVE_SURFACEbecause it only checks whether any explicit account inherits the field — but the implicit[default]channel itself always uses the top-level value.Why This Change Was Made
isBaseFieldActiveForChannelSurfacereturnstrueonly when at least one enabled account does NOT override the field. When all accounts provide their own inline values, the top-level SecretRef was incorrectly marked as inactive.Feishu account listing (
extensions/feishu/src/accounts.ts) always creates an implicit default account from top-levelappId+appSecret, even when named accounts exist. This fix detects that implicit default account and keeps the top-levelappSecretactive accordingly.The change stays Feishu-scoped instead of modifying the shared
collectSimpleChannelFieldAssignmentshelper, avoiding any risk of affecting sibling channel semantics (Discord, Slack, IRC, etc.).User Impact
Users with multi-account Feishu configurations where all accounts provide their own
appSecretcan now use SecretRef format for the top-levelappSecretwithout the[default]channel failing to start. Previously, the only workaround was replacing the SecretRef with an inline secret string.Changes Made
extensions/feishu/src/secret-contract.ts: ReplacedcollectSimpleChannelFieldAssignmentswith inlinecollectSecretInputAssignmentlogic that checks for the implicit default account viahasConfiguredSecretInputValue(appId) && hasConfiguredSecretInputValue(appSecret).src/secrets/runtime-external-channel-audit.test.ts: Added regression test verifying top-level SecretRef is resolved when all accounts override the field.Evidence
node scripts/run-vitest.mjs run src/secrets/runtime-external-channel-audit.test.ts— 8/8 passednode scripts/run-vitest.mjs run src/secrets/runtime-discord-surface.test.ts— 8/8 passednode scripts/run-vitest.mjs run extensions/feishu/src/accounts.test.ts— 23/23 passedReal behavior proof
Config tested: Top-level
appSecretasenv:default:FEISHU_APP_SECRETwith one sub-account overridingappSecretinline.Environment: OpenClaw 2026.6.10 (7e4a082 — this fix), Linux, Node 24.13.1
secrets auditresult:{ "resolution": { "refsChecked": 1, "skippedExecRefs": 0, "resolvabilityComplete": true }, "summary": { "plaintextCount": 1, "unresolvedRefCount": 0, "shadowedRefCount": 0, "legacyResidueCount": 0 } }SECRETS_REF_IGNORED_INACTIVE_SURFACEwarning emittedWhat was not tested: Live Feishu platform message delivery (not required — fix is in config/secret resolution layer).