fix(discord): keep default account online when adding named accounts#96401
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 1, 2026, 7:02 PM ET / 23:02 UTC. Summary PR surface: Source +34, Tests +66. Total +100 across 2 files. Reproducibility: yes. Source inspection shows current main can skip materializing channels.discord.token when explicit named accounts all provide tokens, while Discord still lists a configured top-level token as an implicit default account and fails closed if that token remains an unmaterialized SecretRef. Review metrics: 1 noteworthy metric.
Stored data model 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. Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the Discord-owned SecretRef collector fix after maintainer acceptance of the compatibility change and normal merge gates. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main can skip materializing channels.discord.token when explicit named accounts all provide tokens, while Discord still lists a configured top-level token as an implicit default account and fails closed if that token remains an unmaterialized SecretRef. Is this the best way to solve the issue? Yes. The PR fixes the Discord-owned SecretRef collection boundary, matching a sibling Feishu precedent and avoiding both a shared helper signature change and a runtime token fallback. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6df7db9f9e49. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +34, Tests +66. Total +100 across 2 files. View PR surface stats
Acceptance criteria:
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
|
ca2bdd6 to
4d73cca
Compare
a534f6f to
12a8900
Compare
12a8900 to
6b89308
Compare
|
Merged via squash.
|
…penclaw#96401) * fix(discord): keep default SecretRef active with named accounts * fix(discord): align implicit default secret surfaces --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
…penclaw#96401) * fix(discord): keep default SecretRef active with named accounts * fix(discord): align implicit default secret surfaces --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
Closes #92985
What Problem This Solves
Fixes an issue where users with a working default Discord account could take that account offline when adding a second named Discord account backed by SecretRefs. The default account's top-level token could remain unresolved in the active runtime snapshot, causing Discord startup to treat it as configured but unavailable and enter the restart loop reported in #92985.
Why This Change Was Made
Discord already treats a configured top-level token as an implicit
defaultaccount even when named accounts exist. This change keeps that implicit-default handling inside the Discord secret contract so Discord SecretRef collection matches Discord account listing/runtime behavior without changing the public shared channel-secret helper signature. Sibling channel behavior remains unchanged.User Impact
Adding a named Discord account no longer prevents the existing default account's file-backed SecretRef token from being materialized. Multi-account Discord gateways can keep the default account available while bringing up the additional account.
Evidence
pnpm install --frozen-lockfilepnpm exec oxfmt --check --threads=1 extensions/discord/src/secret-config-contract.ts src/secrets/channel-secret-basic-runtime.ts src/secrets/runtime-discord-surface.test.tsnode scripts/run-oxlint.mjs extensions/discord/src/secret-config-contract.ts src/secrets/channel-secret-basic-runtime.ts src/secrets/runtime-discord-surface.test.tsOPENCLAW_VITEST_FS_MODULE_CACHE_PATH=.vitest-cache-92985-private OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=300000 node scripts/run-vitest.mjs src/secrets/runtime-discord-surface.test.ts src/secrets/runtime-telegram-token-inheritance.test.ts src/secrets/runtime-channel-inactive-variants.test.tsnode --import tsx: prepared and activated a runtime snapshot withchannels.discord.tokenandchannels.discord.accounts.second.tokenboth sourced from a JSON file SecretRef, then resolved Discord runtime accounts without printing token values.snapshotWarnings: []materializedConfig.topLevelTokenPresent: truematerializedConfig.secondTokenPresent: trueaccounts.default.tokenStatus: available,tokenSource: config,tokenPresent: trueaccounts.second.tokenStatus: available,tokenSource: config,tokenPresent: trueenabledAccounts: default, second.agents/skills/autoreview/scripts/autoreview --mode local --prompt "Review the updated narrow fix for issue #92985 after moving implicit-default SecretRef handling behind the Discord-owned secret contract instead of changing the public shared helper signature. Focus on owner boundary, file-backed SecretRef proof shape, sibling channel behavior, and whether this remains minimal."