fix(config): accept truncateAfterCompaction (#68395) · openclaw/openclaw@13fae16
MonkeyLeeT
·
2026-04-22
·
via Recent Commits to openclaw:main
5 files changed
lines changed
| Original file line number | Diff line number | Diff line change |
|---|
@@ -46,6 +46,7 @@ Docs: https://docs.openclaw.ai
|
46 | 46 | - Agents/harness: surface selected plugin harness failures directly instead of replaying the same turn through embedded PI, preventing misleading secondary PI auth errors and avoiding duplicate side effects. |
47 | 47 | - OpenAI Codex: add a ChatGPT device-code auth option beside browser OAuth, so headless or callback-hostile setups can sign in without relying on the localhost browser callback. (#69557) Thanks @vincentkoc. |
48 | 48 | - CLI sessions: keep provider-owned CLI sessions through implicit daily expiry while preserving explicit reset behavior, and retain Claude CLI binding metadata across gateway agent requests. (#70106) Thanks @obviyus. |
| 49 | +- fix(config): accept truncateAfterCompaction (#68395). Thanks @MonkeyLeeT |
49 | 50 | |
50 | 51 | ## 2026.4.21 |
51 | 52 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -145,6 +145,19 @@ describe("config schema regressions", () => {
|
145 | 145 | expect(res.ok).toBe(true); |
146 | 146 | }); |
147 | 147 | |
| 148 | +it("accepts agents.defaults.compaction.truncateAfterCompaction", () => { |
| 149 | +const res = validateConfigObject({ |
| 150 | +agents: { |
| 151 | +defaults: { |
| 152 | +compaction: { |
| 153 | +truncateAfterCompaction: true, |
| 154 | +}, |
| 155 | +}, |
| 156 | +}, |
| 157 | +}); |
| 158 | + |
| 159 | +expect(res.ok).toBe(true); |
| 160 | +}); |
148 | 161 | it("accepts string values for agents defaults model inputs", () => { |
149 | 162 | const res = validateConfigObject({ |
150 | 163 | agents: { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4692,6 +4692,12 @@ export const GENERATED_BASE_CONFIG_SCHEMA: BaseConfigSchemaResponse = {
|
4692 | 4692 | description: |
4693 | 4693 | "Pre-compaction memory flush settings that run an agentic memory write before heavy compaction. Keep enabled for long sessions so salient context is persisted before aggressive trimming.", |
4694 | 4694 | }, |
| 4695 | + truncateAfterCompaction: { |
| 4696 | + type: "boolean", |
| 4697 | + title: "Truncate After Compaction", |
| 4698 | + description: |
| 4699 | +"When enabled, rewrites the session JSONL file after compaction to remove entries that were summarized. Prevents unbounded file growth in long-running sessions with many compaction cycles. Default: false.", |
| 4700 | + }, |
4695 | 4701 | notifyUser: { |
4696 | 4702 | type: "boolean", |
4697 | 4703 | title: "Compaction Notify User", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -64,6 +64,15 @@ describe("agent defaults schema", () => {
|
64 | 64 | expect(result.embeddedPi?.executionContract).toBe("strict-agentic"); |
65 | 65 | }); |
66 | 66 | |
| 67 | +it("accepts compaction.truncateAfterCompaction", () => { |
| 68 | +const result = AgentDefaultsSchema.parse({ |
| 69 | +compaction: { |
| 70 | +truncateAfterCompaction: true, |
| 71 | +}, |
| 72 | +})!; |
| 73 | +expect(result.compaction?.truncateAfterCompaction).toBe(true); |
| 74 | +}); |
| 75 | + |
67 | 76 | it("accepts focused contextLimits on defaults and agent entries", () => { |
68 | 77 | const defaults = AgentDefaultsSchema.parse({ |
69 | 78 | contextLimits: { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -195,6 +195,7 @@ export const AgentDefaultsSchema = z
|
195 | 195 | }) |
196 | 196 | .strict() |
197 | 197 | .optional(), |
| 198 | +truncateAfterCompaction: z.boolean().optional(), |
198 | 199 | notifyUser: z.boolean().optional(), |
199 | 200 | }) |
200 | 201 | .strict() |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。