Repository navigation
Conversation
GroupChatSchema.historyLimit used .positive() which rejects 0, while every other historyLimit in the codebase (DmConfigSchema, channel account schemas) uses .min(0). Setting messages.groupChat.historyLimit to 0 (meaning "no history") caused a silent config reload failure — Zod rejected the value and the runtime fell back to the previously cached config with no prominent error. Fix: change .positive() to .min(0), consistent with all sibling historyLimit schemas in the same file. Fixes openclaw#65305
Greptile SummaryChanges Confidence Score: 5/5Safe to merge — single-token schema fix with no side effects. The change is a one-line correction that aligns GroupChatSchema.historyLimit with every other historyLimit field in the codebase. No logic beyond schema validation is touched, and the fix directly resolves the reported silent config-reload failure. No files require special attention. Reviews (1): Last reviewed commit: "fix(config): allow historyLimit: 0 in Gr..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c6c2efe2d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // Use .min(0) not .positive() — 0 is a valid value meaning "no history". | ||
| // Consistent with DmConfigSchema.historyLimit and all other historyLimit | ||
| // fields in this file (#65305). | ||
| historyLimit: z.number().int().min(0).optional(), |
There was a problem hiding this comment.
Regenerate config schema artifacts for historyLimit
After changing GroupChatSchema.historyLimit to min(0), the generated base schema artifacts were not updated, so messages.groupChat.historyLimit still appears as exclusiveMinimum: 0 in src/config/schema.base.generated.ts (around line 6020). Any consumer that validates/edit-configs via GENERATED_BASE_CONFIG_SCHEMA (for example schema-driven UI/CLI flows) will continue to reject 0, leaving runtime validation and published schema behavior inconsistent.
Useful? React with 👍 / 👎.
Summary
GroupChatSchema.historyLimituses.positive()which rejects0, while every otherhistoryLimitin the codebase uses.min(0). Settingmessages.groupChat.historyLimit: 0(meaning "disable group chat history") causes a silent config reload failure — Zod rejects the value and the runtime falls back to the previously cached config with no prominent error.Fixes #65305
Root cause
Fix
.positive()→.min(0)on line 357. One token changed.Scope
src/config/zod-schema.core.ts(+3/-1)Credit to @maxreith for identifying the inconsistency in #65305.