Skip to content

fix(discord): align DiscordAccountConfig.token type with SecretInput#32490

Merged
joshavant merged 3 commits intoopenclaw:mainfrom
scoootscooob:fix/discord-token-secret-input-type-32445
Mar 3, 2026
Merged

fix(discord): align DiscordAccountConfig.token type with SecretInput#32490
joshavant merged 3 commits intoopenclaw:mainfrom
scoootscooob:fix/discord-token-secret-input-type-32445

Conversation

@scoootscooob
Copy link
Copy Markdown
Contributor

Summary

  • Updates DiscordAccountConfig.token from string to SecretInput (string | SecretRef) in the TypeScript type layer
  • The Zod schema (SecretInputSchema) and runtime resolution (normalizeResolvedSecretInputString) already support SecretRef values (landed in feat(secrets): expand SecretRef coverage across user-supplied credentials #29580), but the TS type was still string
  • This aligns the type definition with the schema and runtime so consumers get correct type-checking when using SecretRef tokens

Test plan

  • tsc --noEmit passes (no new type errors)
  • All 7 Discord token tests pass
  • All 675 config tests pass
  • Pre-commit lint passes

Closes #32445

🤖 Generated with Claude Code

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 3, 2026

Greptile Summary

This PR fixes a type-layer inconsistency by updating DiscordAccountConfig.token from string to SecretInput (string | SecretRef) in src/config/types.discord.ts. The corresponding Zod schema (SecretInputSchema at zod-schema.providers-core.ts:411) and the secrets target registry (secretShape: "secret_input" in target-registry-data.ts:90) already fully supported SecretRef values — only the TypeScript interface was lagging behind.

  • Change is non-breaking: string is a subtype of SecretInput, so all existing callers passing plain token strings continue to type-check correctly.
  • Correct alignment: All three layers (Zod schema, type registry, TS interface) now agree on the shape of the token field.
  • No issues found: The change is minimal, focused, and accurate.

Confidence Score: 5/5

  • This PR is safe to merge — it is a minimal, non-breaking type alignment with no runtime or logic changes.
  • The change is a single-line type fix that brings the TypeScript interface in sync with the already-existing Zod schema and secret registry definitions. Plain string values remain valid, so no existing consumers are broken. The Zod schema and runtime resolution (normalizeResolvedSecretInputString) were already handling SecretRef correctly; only the TS type was stale.
  • No files require special attention.

Last reviewed commit: 393681a

@joshavant joshavant force-pushed the fix/discord-token-secret-input-type-32445 branch from 393681a to c21aaba Compare March 3, 2026 20:45
joshavant added a commit to scoootscooob/openclaw that referenced this pull request Mar 3, 2026
scoootscooob and others added 2 commits March 3, 2026 14:45
The Zod schema (SecretInputSchema) and runtime token resolution
already accept SecretRef values, but the TypeScript type was still
`string`. Update to `SecretInput` so the type layer matches.

Closes openclaw#32445

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@joshavant joshavant force-pushed the fix/discord-token-secret-input-type-32445 branch from c21aaba to e6faa09 Compare March 3, 2026 20:47
@joshavant joshavant merged commit ff96e41 into openclaw:main Mar 3, 2026
9 checks passed
@joshavant
Copy link
Copy Markdown
Contributor

Merged via squash.

Thanks @scoootscooob!

@openclaw-barnacle openclaw-barnacle bot added docs Improvements or additions to documentation channel: discord Channel integration: discord gateway Gateway runtime labels Mar 3, 2026