fix(discord): Apply historyLimit to channel/group sessions to prevent compaction bypass#11356
Merged
Takhoffman merged 3 commits intoFeb 14, 2026
Conversation
Comment on lines
+1
to
+3
| { | ||
| "name": "openclaw", | ||
| "version": "2026.2.4", |
Contributor
There was a problem hiding this comment.
Unexpected lockfile addition
This PR adds a new package-lock.json (~12k lines). If the repo isn’t already tracking an npm lockfile, this will introduce a large, unrelated change surface for a targeted Discord history-limit fix and can change dependency resolution for consumers. Please confirm this is intentional (and aligned with the repo’s package manager policy), otherwise drop it from the PR.
Prompt To Fix With AI
This is a comment left during a code review.
Path: package-lock.json
Line: 1:3
Comment:
**Unexpected lockfile addition**
This PR adds a new `package-lock.json` (~12k lines). If the repo isn’t already tracking an npm lockfile, this will introduce a large, unrelated change surface for a targeted Discord history-limit fix and can change dependency resolution for consumers. Please confirm this is intentional (and aligned with the repo’s package manager policy), otherwise drop it from the PR.
How can I resolve this? If you propose a fix, please make it concise.d757bfc to
9d06864
Compare
… compaction bypass Extends getHistoryLimitFromSessionKey (renamed from getDmHistoryLimitFromSessionKey) to support channel and group sessions using the existing historyLimit config property. Previously, the function only applied limits to DM sessions, causing channel sessions to accumulate tokens indefinitely and eventually hit context overflow errors. Changes: - Extended history.ts to resolve historyLimit for 'channel' and 'group' session kinds - Added backward-compatible deprecated alias for getDmHistoryLimitFromSessionKey - Added getHistoryLimitFromSessionKey export to pi-embedded-runner.ts - Added comprehensive tests for channel/group session history limit resolution Fixes openclaw#11224
9d06864 to
ca2a407
Compare
Contributor
|
Merged via squash.
Thanks @shadril238! |
GwonHyeok
pushed a commit
to learners-superpumped/openclaw
that referenced
this pull request
Feb 15, 2026
… compaction bypass (openclaw#11356) thanks @shadril238 Verified: - pnpm build - pnpm check - pnpm test (ran; one unrelated existing failure in models forward-compat test) - pnpm vitest src/agents/pi-embedded-runner.history-limit-from-session-key.test.ts Co-authored-by: shadril238 <63901551+shadril238@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
lovewanwan
pushed a commit
to lovewanwan/openclaw
that referenced
this pull request
Apr 28, 2026
… compaction bypass (openclaw#11356) thanks @shadril238 Verified: - pnpm build - pnpm check - pnpm test (ran; one unrelated existing failure in models forward-compat test) - pnpm vitest src/agents/pi-embedded-runner.history-limit-from-session-key.test.ts Co-authored-by: shadril238 <63901551+shadril238@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
ogt-redknie
pushed a commit
to ogt-redknie/OPENX
that referenced
this pull request
May 2, 2026
… compaction bypass (openclaw#11356) thanks @shadril238 Verified: - pnpm build - pnpm check - pnpm test (ran; one unrelated existing failure in models forward-compat test) - pnpm vitest src/agents/pi-embedded-runner.history-limit-from-session-key.test.ts Co-authored-by: shadril238 <63901551+shadril238@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
May 9, 2026
… compaction bypass (openclaw#11356) thanks @shadril238 Verified: - pnpm build - pnpm check - pnpm test (ran; one unrelated existing failure in models forward-compat test) - pnpm vitest src/agents/pi-embedded-runner.history-limit-from-session-key.test.ts Co-authored-by: shadril238 <63901551+shadril238@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #11224 - Discord channel sessions were bypassing compaction, leading to context overflow errors.
Problem
Discord channel sessions accumulated tokens indefinitely, ignoring the
contextTokenslimit and compaction settings. This resulted in context overflow errors when sessions exceeded the model's context window (e.g., 211k tokens > 200k limit).Root Cause
The
getDmHistoryLimitFromSessionKeyfunction in history.ts explicitly skipped all non-DM sessions: