Config: require Discord ID strings#18220
Conversation
|
The formal models extracted constants ( This check is informational (not blocking merges yet). If this change is intentional, follow up by updating the formal models repo or regenerating the extracted artifacts there. |
1 similar comment
|
The formal models extracted constants ( This check is informational (not blocking merges yet). If this change is intentional, follow up by updating the formal models repo or regenerating the extracted artifacts there. |
|
The formal models extracted constants ( This check is informational (not blocking merges yet). If this change is intentional, follow up by updating the formal models repo or regenerating the extracted artifacts there. |
|
The formal models extracted constants ( This check is informational (not blocking merges yet). If this change is intentional, follow up by updating the formal models repo or regenerating the extracted artifacts there. |
Summary
Describe the problem and fix in 2–5 bullets:
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
openclaw doctor --fixto convert numeric IDs to strings.Security Impact (required)
Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
channels.discord.allowFrom: [123].openclaw doctor.Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
Compatibility / Migration
openclaw doctor --fixto convert numeric Discord IDs to strings.Failure Recovery (if this breaks)
src/config/zod-schema.providers-core.ts,src/commands/doctor-config-flow.ts.Risks and Mitigations
Greptile Summary
Enforced string-only Discord IDs across config schema, types, and runtime to prevent JSON parsing inconsistencies and truncation. Added
DiscordIdSchemavalidator with.refine()that accepts numbers but only passes strings, providing clear error messages. ImplementedmaybeRepairDiscordNumericIds()in doctor flow to auto-convert numeric IDs to strings viastructuredClone+ map transformation across all Discord allowlist paths (DMs, guilds, channels, roles, approvers). Updated 10 files with comprehensive type changes fromArray<string | number>tostring[]for type safety.Confidence Score: 4/5
openclaw doctor --fixto migrate, which could cause friction if not communicated clearly.Last reviewed commit: e73a3d6