config: accept browser.tabCleanup keys in zod schema (#74577) (#74638) · openclaw/openclaw@0142c79
lonexreb
·
2026-04-30
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -40,6 +40,7 @@ Docs: https://docs.openclaw.ai
|
40 | 40 | |
41 | 41 | ### Fixes |
42 | 42 | |
| 43 | +- Config: accept documented `browser.tabCleanup` keys in strict root config validation, so configured tab cleanup no longer fails before runtime reads it. Fixes #74577. Thanks @lonexreb and @ezdlp. |
43 | 44 | - Channels/status: keep Telegram, Slack, and Google Chat read-only allowlist/default-target accessors on config-only paths, so status and channel summaries do not resolve SecretRef-backed runtime credentials. Thanks @eusine. |
44 | 45 | - Active Memory: clarify the deprecated `modelFallbackPolicy` warning and config help so `modelFallback` is described as a chain-resolution last resort, not runtime failover. (#74602) Thanks @jeffrey701. |
45 | 46 | - Channels/Discord: keep read-only allowlist/default-target accessors from resolving SecretRef-backed bot tokens, so status and channel summaries no longer fail when tokens are only available in gateway runtime. (#74737) Thanks @eusine. |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -cb32b51492306179b4537514b0650ab24e2f5f8f6c2eda92154cb1420a11e560 config-baseline.json |
2 | | -ab9a004ec78ed51e646be29eb10aa6700de1d47fee77331a85ca5e2cd15b6e93 config-baseline.core.json |
| 1 | +c3bcb3a3da46bbbe15a7798869911cab109df950ee51c79fd86c96bb809dfdf1 config-baseline.json |
| 2 | +8f573caa7f4cf01ae9d4805d3d14e1ba6772f651f6da182baaf2b469592749a4 config-baseline.core.json |
3 | 3 | 92712871defa92eeda8161b516db85574681f2b70678b940508a808b987aeae2 config-baseline.channel.json |
4 | | -ede8b3d9bd7848a09abfcd9fa4f007d289d05742f66b0e38ef459da6dbf40897 config-baseline.plugin.json |
| 4 | +aca3215b7382af82b5060d73c631a7f82661c6e99193fa5eb1c5b4b499fb657b config-baseline.plugin.json |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -248,6 +248,45 @@ describe("config schema regressions", () => {
|
248 | 248 | expect(res.ok).toBe(false); |
249 | 249 | }); |
250 | 250 | |
| 251 | +it("accepts browser.tabCleanup overrides", () => { |
| 252 | +const res = validateConfigObject({ |
| 253 | +browser: { |
| 254 | +tabCleanup: { |
| 255 | +enabled: true, |
| 256 | +idleMinutes: 10, |
| 257 | +maxTabsPerSession: 10, |
| 258 | +sweepMinutes: 5, |
| 259 | +}, |
| 260 | +}, |
| 261 | +}); |
| 262 | + |
| 263 | +expect(res.ok).toBe(true); |
| 264 | +}); |
| 265 | + |
| 266 | +it("rejects browser.tabCleanup.sweepMinutes when not positive", () => { |
| 267 | +const res = validateConfigObject({ |
| 268 | +browser: { |
| 269 | +tabCleanup: { |
| 270 | +sweepMinutes: 0, |
| 271 | +}, |
| 272 | +}, |
| 273 | +}); |
| 274 | + |
| 275 | +expect(res.ok).toBe(false); |
| 276 | +}); |
| 277 | + |
| 278 | +it("rejects unknown keys under browser.tabCleanup", () => { |
| 279 | +const res = validateConfigObject({ |
| 280 | +browser: { |
| 281 | +tabCleanup: { |
| 282 | +unknownKey: true as unknown, |
| 283 | +}, |
| 284 | +}, |
| 285 | +}); |
| 286 | + |
| 287 | +expect(res.ok).toBe(false); |
| 288 | +}); |
| 289 | + |
251 | 290 | it("accepts tools.media.asyncCompletion.directSend", () => { |
252 | 291 | const res = validateConfigObject({ |
253 | 292 | tools: { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -871,6 +871,45 @@ export const GENERATED_BASE_CONFIG_SCHEMA: BaseConfigSchemaResponse = {
|
871 | 871 | type: "string", |
872 | 872 | }, |
873 | 873 | }, |
| 874 | + tabCleanup: { |
| 875 | + type: "object", |
| 876 | + properties: { |
| 877 | + enabled: { |
| 878 | + type: "boolean", |
| 879 | + title: "Browser Tab Cleanup Enabled", |
| 880 | + description: |
| 881 | +"Enables cleanup of idle tracked browser tabs for primary-agent sessions. Disable only when external tooling owns tab lifecycle completely.", |
| 882 | + }, |
| 883 | + idleMinutes: { |
| 884 | + type: "integer", |
| 885 | + minimum: 0, |
| 886 | + maximum: 9007199254740991, |
| 887 | + title: "Browser Tab Cleanup Idle Minutes", |
| 888 | + description: |
| 889 | +"Minutes of inactivity before a tracked primary-agent browser tab is eligible for closure. Set 0 to disable idle-time cleanup while keeping the per-session tab cap.", |
| 890 | + }, |
| 891 | + maxTabsPerSession: { |
| 892 | + type: "integer", |
| 893 | + minimum: 0, |
| 894 | + maximum: 9007199254740991, |
| 895 | + title: "Browser Tab Cleanup Max Tabs Per Session", |
| 896 | + description: |
| 897 | +"Maximum tracked browser tabs kept per primary-agent session. Oldest inactive tabs are closed first. Set 0 to disable the cap.", |
| 898 | + }, |
| 899 | + sweepMinutes: { |
| 900 | + type: "integer", |
| 901 | + exclusiveMinimum: 0, |
| 902 | + maximum: 9007199254740991, |
| 903 | + title: "Browser Tab Cleanup Sweep Minutes", |
| 904 | + description: |
| 905 | +"Minutes between browser tab cleanup sweeps. Keep this modest so idle tabs are reclaimed without adding frequent background work.", |
| 906 | + }, |
| 907 | + }, |
| 908 | + additionalProperties: false, |
| 909 | + title: "Browser Tab Cleanup", |
| 910 | + description: |
| 911 | +"Best-effort cleanup policy for browser tabs opened by primary-agent sessions. Keep enabled to avoid stale sandbox or managed-browser tabs accumulating across long-lived gateways.", |
| 912 | + }, |
874 | 913 | }, |
875 | 914 | additionalProperties: false, |
876 | 915 | title: "Browser", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -463,6 +463,15 @@ export const OpenClawSchema = z
|
463 | 463 | ) |
464 | 464 | .optional(), |
465 | 465 | extraArgs: z.array(z.string()).optional(), |
| 466 | +tabCleanup: z |
| 467 | +.object({ |
| 468 | +enabled: z.boolean().optional(), |
| 469 | +idleMinutes: z.number().int().nonnegative().optional(), |
| 470 | +maxTabsPerSession: z.number().int().nonnegative().optional(), |
| 471 | +sweepMinutes: z.number().int().positive().optional(), |
| 472 | +}) |
| 473 | +.strict() |
| 474 | +.optional(), |
466 | 475 | }) |
467 | 476 | .strict() |
468 | 477 | .optional(), |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。