Repository navigation
fix(config): allow historyLimit: 0 in GroupChatSchema - #65359
Conversation
Greptile SummaryThis PR fixes a one-character inconsistency in Confidence Score: 5/5Safe to merge — minimal targeted fix with adequate test coverage and no side effects. The change is a single validator token fix that aligns GroupChatSchema with every other historyLimit schema in the file. Tests cover the critical boundary values. No logic, security, or architectural concerns. 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: 313c515d9d
ℹ️ 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".
| .object({ | ||
| mentionPatterns: z.array(z.string()).optional(), | ||
| historyLimit: z.number().int().positive().optional(), | ||
| historyLimit: z.number().int().min(0).optional(), |
There was a problem hiding this comment.
Regenerate base config schema for historyLimit change
Update the generated config schema artifact alongside this Zod change. GroupChatSchema.historyLimit now accepts 0, but buildBaseConfigSchema serves GENERATED_BASE_CONFIG_SCHEMA (src/config/schema.ts:463), and that snapshot still encodes messages.groupChat.historyLimit as exclusiveMinimum: 0 (src/config/schema.base.generated.ts:6193). This leaves runtime parsing and published schema out of sync, so schema-driven consumers (like config UIs/validators) can still reject 0 even though core now accepts it.
Useful? React with 👍 / 👎.
|
Codex review: needs maintainer review before merge. Reviewed July 3, 2026, 2:17 AM ET / 06:17 UTC. Summary PR surface: Source 0, Tests +63. Total +63 across 3 files. Reproducibility: yes. at source level. Current main validates 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. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land this narrow validation fix with schema and Gateway coverage once maintainers accept the documented zero-disables-history upgrade behavior and normal merge gates pass. Do we have a high-confidence way to reproduce the issue? Yes, at source level. Current main validates Is this the best way to solve the issue? Yes. The schema owns the lower-bound contract, Gateway AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4e6933c84f18. Label changesLabel justifications:
Evidence reviewedPR surface: Source 0, Tests +63. Total +63 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
|
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
cc931a4 to
1f33f52
Compare
1f33f52 to
a4f99c4
Compare
|
This pull request has been automatically marked as stale due to inactivity. |
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
GroupChatSchema used .positive() which rejects 0, while all other historyLimit schemas use .min(0). This caused a silent config reload failure when setting messages.groupChat.historyLimit to 0. Change .positive() to .min(0) and add test coverage. Fixes #65305
a4f99c4 to
b2a3ea8
Compare
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(config): allow historyLimit: 0 in GroupChatSchema This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Merged via squash.
|
GroupChatSchema used .positive() which rejects 0, while all other historyLimit schemas use .min(0). This caused a silent config reload failure when setting messages.groupChat.historyLimit to 0. Change .positive() to .min(0) and add test coverage. Fixes openclaw#65305
Summary
GroupChatSchema.historyLimitused.positive(), which rejects0, while the otherhistoryLimitschemas accept0with.min(0). This mademessages.groupChat.historyLimit: 0invalid even though0is the existing config value for disabling history.Fixes #65305
Fix
messages.groupChat.historyLimitfrom.positive()to.min(0)insrc/config/zod-schema.core.ts.0, positive values, and negative values.config.patchregression test proving the runtime API path acceptshistoryLimit: 0.Current Status
upstream/main(33b81686ad).a4f99c4cd2c05c26e52a06b315a5b81da24f509b.git rev-list --left-right --count upstream/main...refresh-historylimit-zero->0 1..positive()forGroupChatSchema.historyLimit.Test Plan
Current head verification after the final rebase:
node scripts/run-vitest.mjs run --config test/vitest/vitest.runtime-config.config.ts src/config/zod-schema.core.test.tsnode scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server.config-patch.test.ts -t "historyLimit: 0"./node_modules/.bin/oxfmt --check src/config/zod-schema.core.ts src/config/zod-schema.core.test.ts src/gateway/server.config-patch.test.tsgit diff --checkReal behavior proof
Behavior or issue addressed:
messages.groupChat.historyLimit: 0must be accepted as a valid runtime config value so group chat history can be disabled.Real environment tested: Local OpenClaw checkout of this PR branch after applying the schema/test changes, built locally and run with a local Gateway using token auth.
Exact steps or command run after this patch: Built the branch with
OPENCLAW_RUN_NODE_SKIP_DTS_BUILD=1 pnpm build, started the built local Gateway, connected through the backend Gateway protocol withoperator.admin, read the runtime config schema, calledconfig.patch, and read the config back from the running server.Evidence after fix: Copied live output from the local Gateway API smoke run:
Observed result after fix: The running Gateway advertised
minimum: 0formessages.groupChat.historyLimit;config.patchacceptedhistoryLimit: 0withok: true; a follow-up read returnedvalid: trueandhistoryLimit: 0.What was not tested: The dashboard browser clickpath was not exercised; this proof targets the runtime Gateway/API config validation path directly.
This specifically covers the concern that direct config loading may accept a value while runtime JSON Schema/API validation may still reject it.