fix(feishu): keep default appSecret refs active#96933
Conversation
Signed-off-by: WilliamK112 <[email protected]>
|
Codex review: needs maintainer review before merge. Reviewed June 26, 2026, 10:41 PM ET / 02:41 UTC. Summary PR surface: Source +36, Tests +130. Total +166 across 3 files. Reproducibility: yes. source-level: current main and 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:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land one Feishu-scoped fix that keeps top-level Do we have a high-confidence way to reproduce the issue? Yes, source-level: current main and Is this the best way to solve the issue? Yes, this is the best fix shape: Feishu-owned activation matches Feishu account listing and is narrower than changing the shared simple collector for every account-scoped channel. The remaining question is which sibling candidate to land, not whether this repair belongs in Feishu. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 56259606d15f. Label changesLabel justifications:
Evidence reviewedPR surface: Source +36, Tests +130. Total +166 across 3 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
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fcec0fe82b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
What Problem This Solves
Fixes #96929.
When Feishu has top-level
appId/appSecretcredentials and named accounts that each overrideappSecret, the secrets runtime can incorrectly markchannels.feishu.appSecretinactive. That leaves the implicit default Feishu account with an unresolved top-level SecretRef at startup.Why This Change Was Made
Feishu account resolution treats top-level credentials as an implicit
defaultaccount even when named accounts exist. The Feishu secret contract now mirrors that account-listing behavior forappSecret: top-levelappSecretrefs remain active when top-level credentials define the implicit default account, while named account appSecret refs still use their existing enabled-account rules.The change stays Feishu-scoped instead of changing the shared channel secret helper semantics for Discord, Slack, IRC, or other account-scoped channels. It also keeps stale top-level
appSecretrefs inactive when an explicitaccounts.defaultentry overrides or disables the default account, because no enabled Feishu account inherits that top-level value in those configs.User Impact
Users can keep a top-level Feishu
appSecretSecretRef for the default account while adding named Feishu accounts with their own inline or referenced app secrets. The default account no longer fails startup because its top-level SecretRef was skipped as inactive.Configs with an explicit
accounts.default.appSecretoverride or disabledaccounts.defaultdo not start resolving stale top-levelchannels.feishu.appSecretSecretRefs that no enabled runtime account reads.Evidence
Runtime proof from local terminal on
867bc4ba48a74c28b041dde3e34ef1a830f4c45cusing only synthetic/redacted secrets.OPENCLAW_BUNDLED_PLUGINS_DIR=<repo>/extensionspoints the production bundled-plugin public-surface loader at this checkout's Feishusecret-contract-api.ts, so the command exercises the PR head source instead of the previously built dist artifact.OPENCLAW_BUNDLED_PLUGINS_DIR=<repo>/extensions node --import tsx --input-type=module <runtime-proof-script>OPENCLAW_BUNDLED_PLUGINS_DIR=<repo>/extensions node --import tsx --input-type=module <explicit-default-stale-ref-proof-script>node scripts/run-vitest.mjs src/secrets/runtime-external-channel-audit.test.ts extensions/feishu/src/accounts.test.ts src/secrets/runtime-discord-surface.test.ts -- --reporter=verboseresolves Feishu top-level appSecret refs for the implicit default account.skips stale Feishu top-level appSecret refs when explicit default overrides them.skips stale Feishu top-level appSecret refs when explicit default is disabled.Test Files 2 passed (2),Tests 18 passed (18); Feishu extension shardTest Files 1 passed (1),Tests 24 passed (24).corepack pnpm format:check -- extensions/feishu/src/secret-contract.ts src/secrets/runtime-external-channel-audit.test.ts extensions/feishu/src/accounts.test.tsAll matched files use the correct format.git diff --checkCI note: GitHub
Real behavior proofis green on this head. The remaining red CI job ischecks-node-compact-small-7, which timed out insrc/gateway/server-startup-session-migration.test.tson the PR merge ref. That file/test comes from currentmainon the merge ref, not from this Feishu secret-contract diff; rerun was attempted withgh run rerun --failedbut GitHub rejected it because this account does not have repository admin rights.