Repository navigation
Config: expose Pi compaction tuning values - #21568
Merged
Merged
Conversation
Takhoffman
force-pushed
the
split/pi-compaction-config-values
branch
from
February 20, 2026 03:40
a180198 to
c8e3809
Compare
Contributor
Author
|
Autoland completion summary:
Verification run in prep worktree:
Notes:
|
anisoptera
pushed a commit
to anisoptera/openclaw
that referenced
this pull request
Feb 20, 2026
…akhoffman Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Takhoffman <[email protected]>
vincentkoc
pushed a commit
that referenced
this pull request
Feb 21, 2026
Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Takhoffman <[email protected]>
vincentkoc
pushed a commit
that referenced
this pull request
Feb 21, 2026
Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Takhoffman <[email protected]>
mmyyfirstb
pushed a commit
to mmyyfirstb/openclaw
that referenced
this pull request
Feb 21, 2026
…akhoffman Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Takhoffman <[email protected]>
lovewanwan
pushed a commit
to lovewanwan/openclaw
that referenced
this pull request
Apr 28, 2026
…akhoffman Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Takhoffman <[email protected]>
This was referenced Apr 29, 2026
ogt-redknie
pushed a commit
to ogt-redknie/OPENX
that referenced
this pull request
May 2, 2026
…akhoffman Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Takhoffman <[email protected]>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
May 9, 2026
…akhoffman Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Takhoffman <[email protected]>
This was referenced May 11, 2026
This was referenced May 22, 2026
1 of 5 tasks
lhfer
pushed a commit
to lhfer/openclaw
that referenced
this pull request
Oct 11, 2026
…akhoffman Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Takhoffman <[email protected]>
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
Describe the problem and fix in 2–5 bullets:
reserveTokens,keepRecentTokens) inagents.defaults.compaction, so users could not centrally tune Pi compaction behavior from OpenClaw config.agents.defaults.compaction.reserveTokensandagents.defaults.compaction.keepRecentTokens, and wired embedded Pi runners to apply those values viaSettingsManager.applyOverrides, while continuing to enforcereserveTokensFloor.compaction.enabled; did not change safeguard pruning logic; did not add docs/UI changes.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
agents.defaults.compaction.reserveTokensis now accepted and applied to embedded Pi runs.agents.defaults.compaction.keepRecentTokensis now accepted and applied to embedded Pi runs.agents.defaults.compaction.reserveTokensFloorcontinues to enforce a minimum floor for applied reserve tokens.agents.defaults.compaction.enabledis intentionally not exposed in this PR.Security Impact (required)
Yes/No): NoYes/No): NoYes/No): NoYes/No): NoYes/No): NoYes, explain risk + mitigation:Repro + Verification
Environment
{ "agents": { "defaults": { "compaction": { "reserveTokens": 15000, "keepRecentTokens": 12000, "reserveTokensFloor": 20000 } } } }Steps
openclaw.jsonunderagents.defaults.compaction.SettingsManager.Expected
reserveTokens/keepRecentTokens.reserveTokensnever drops below configured/default floor.Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
pnpm tsgopnpm test src/config/config.compaction-settings.test.tspnpm exec vitest run -c vitest.e2e.config.ts src/agents/pi-settings.e2e.test.tskeepRecentTokensunset preserves current Pi setting (no forced safeguard override)keepRecentTokens: 0is treated invalid and preserves current settingCompatibility / Migration
Yes/No): YesYes/No): NoYes/No): NoFailure Recovery (if this breaks)
a1801984b.src/agents/pi-settings.tssrc/agents/pi-embedded-runner/compact.tssrc/agents/pi-embedded-runner/run/attempt.tssrc/config/types.agent-defaults.tssrc/config/zod-schema.agent-defaults.tsRisks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write
None.Greptile Summary
Exposes Pi compaction tuning values (
reserveTokensandkeepRecentTokens) through OpenClaw config schema, enabling users to centrally tune Pi compaction behavior without manual Pi-side settings changes.Key changes:
agents.defaults.compaction.reserveTokensandagents.defaults.compaction.keepRecentTokensapplyPiCompactionSettingsFromConfig()to handle both reserve and keepRecent token settings with proper validationreserveTokensFloorenforcement to prevent unsafe configurationsValidation alignment:
nonnegativefor reserveTokens,positivefor keepRecentTokens)Math.max()logicBackward compatibility:
ensurePiCompactionReserveTokens()function preservedConfidence Score: 5/5
ensurePiCompactionReserveTokenstoapplyPiCompactionSettingsFromConfigis clean and maintains the floor enforcement safety mechanism. No security concerns, no breaking changes, and the scope is tightly focused on exposing existing Pi settings through config.Last reviewed commit: a180198