mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 01:03:29 +00:00
fix(config): prevent RangeError in merged schema cache key generation
Fix merged schema cache key generation for high-cardinality plugin/channel metadata by hashing incrementally instead of serializing one large aggregate string. Includes changelog entry for the user-visible regression fix. Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> Co-authored-by: Bill <gsamzn@gmail.com>
This commit is contained in:
@@ -27,6 +27,7 @@ Docs: https://docs.openclaw.ai
|
|||||||
### Fixes
|
### Fixes
|
||||||
|
|
||||||
- Agents/compaction safeguard pre-check: skip embedded compaction before entering the Pi SDK when a session has no real conversation messages, avoiding unnecessary LLM API calls on idle sessions. (#36451) thanks @Sid-Qin.
|
- Agents/compaction safeguard pre-check: skip embedded compaction before entering the Pi SDK when a session has no real conversation messages, avoiding unnecessary LLM API calls on idle sessions. (#36451) thanks @Sid-Qin.
|
||||||
|
- Config/schema cache key stability: build merged schema cache keys with incremental hashing to avoid large single-string serialization and prevent `RangeError: Invalid string length` on high-cardinality plugin/channel metadata. (#36603) Thanks @powermaster888.
|
||||||
- iMessage/cron completion announces: strip leaked inline reply tags (for example `[[reply_to:6100]]`) from user-visible completion text so announcement deliveries do not expose threading metadata. (#24600) Thanks @vincentkoc.
|
- iMessage/cron completion announces: strip leaked inline reply tags (for example `[[reply_to:6100]]`) from user-visible completion text so announcement deliveries do not expose threading metadata. (#24600) Thanks @vincentkoc.
|
||||||
- Sessions/daily reset transcript archival: archive prior transcript files during stale-session scheduled/daily resets by capturing the previous session entry before rollover, preventing orphaned transcript files on disk. (#35493) Thanks @byungsker.
|
- Sessions/daily reset transcript archival: archive prior transcript files during stale-session scheduled/daily resets by capturing the previous session entry before rollover, preventing orphaned transcript files on disk. (#35493) Thanks @byungsker.
|
||||||
- Feishu/group slash command detection: normalize group mention wrappers before command-authorization probing so mention-prefixed commands (for example `@Bot/model` and `@Bot /reset`) are recognized as gateway commands instead of being forwarded to the agent. (#35994) Thanks @liuxiaopai-ai.
|
- Feishu/group slash command detection: normalize group mention wrappers before command-authorization probing so mention-prefixed commands (for example `@Bot/model` and `@Bot /reset`) are recognized as gateway commands instead of being forwarded to the agent. (#35994) Thanks @liuxiaopai-ai.
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import crypto from "node:crypto";
|
||||||
import { CHANNEL_IDS } from "../channels/registry.js";
|
import { CHANNEL_IDS } from "../channels/registry.js";
|
||||||
import { VERSION } from "../version.js";
|
import { VERSION } from "../version.js";
|
||||||
import type { ConfigUiHint, ConfigUiHints } from "./schema.hints.js";
|
import type { ConfigUiHint, ConfigUiHints } from "./schema.hints.js";
|
||||||
@@ -322,7 +323,24 @@ function buildMergedSchemaCacheKey(params: {
|
|||||||
configUiHints: channel.configUiHints ?? null,
|
configUiHints: channel.configUiHints ?? null,
|
||||||
}))
|
}))
|
||||||
.toSorted((a, b) => a.id.localeCompare(b.id));
|
.toSorted((a, b) => a.id.localeCompare(b.id));
|
||||||
return JSON.stringify({ plugins, channels });
|
// Build the hash incrementally so we never materialize one giant JSON string.
|
||||||
|
const hash = crypto.createHash("sha256");
|
||||||
|
hash.update('{"plugins":[');
|
||||||
|
plugins.forEach((plugin, index) => {
|
||||||
|
if (index > 0) {
|
||||||
|
hash.update(",");
|
||||||
|
}
|
||||||
|
hash.update(JSON.stringify(plugin));
|
||||||
|
});
|
||||||
|
hash.update('],"channels":[');
|
||||||
|
channels.forEach((channel, index) => {
|
||||||
|
if (index > 0) {
|
||||||
|
hash.update(",");
|
||||||
|
}
|
||||||
|
hash.update(JSON.stringify(channel));
|
||||||
|
});
|
||||||
|
hash.update("]}");
|
||||||
|
return hash.digest("hex");
|
||||||
}
|
}
|
||||||
|
|
||||||
function setMergedSchemaCache(key: string, value: ConfigSchemaResponse): void {
|
function setMergedSchemaCache(key: string, value: ConfigSchemaResponse): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user