LibreChat/packages
Danny Avila 7083cf8935
👻 fix: Guard Redis Stream Resume Against Disposed HITL Graph (#14258)
When a run pauses for `ask_user_question` (or tool approval), the paused turn's
client is disposed and `disposeClient` (api/server/cleanup.js `graphPropsToClean`)
runs `clearHeavyState()` and then NULLS the graph's internal arrays (`messages`,
`contentData`). `RedisJobStore` still holds a `WeakRef` to that graph in
`localGraphCache`, so on resume/reconnect `getContentParts()` / `getRunSteps()`
deref the disposed graph and call `graph.getContentParts()` (`this.messages.slice()`)
/ `graph.getRunSteps()` (`[...this.contentData]`), throwing "Cannot read properties
of null (reading 'slice')" / "this.contentData is not iterable" and aborting the
resume. Redis-only: InMemoryJobStore reads `state.contentParts` /
`graph?.contentData ?? []` directly and never calls the throwing SDK getters, which
is why `USE_REDIS_STREAMS=false` works.

RedisJobStore now reads the cached graph through `readCachedGraph()`, which tolerates
a disposed graph: it swallows the deref error, drops the stale cache entry, and lets
the caller fall back to durable chunk reconstruction instead of crashing.

The true root cause (the unguarded null deref) is in `@librechat/agents`
`StandardGraph.getContentParts()` / `getRunSteps()` and is addressed there
separately; this is the host-side defensive guard.

Fixes #14247. Addresses Bug 3 of #14253.
2026-07-14 11:58:04 -04:00
..
api 👻 fix: Guard Redis Stream Resume Against Disposed HITL Graph (#14258) 2026-07-14 11:58:04 -04:00
client 🧰 feat: Redesign Agent Builder with Unified Tools Marketplace, Skills & Orchestration (#13952) 2026-07-05 11:30:12 -04:00
data-provider ♨️ feat: Prewarm Stateful Code Sandboxes with Cold-Boot UX Feedback (#14239) 2026-07-14 10:25:37 -04:00
data-schemas 🧭 feat: Mid-Run Steering and Queued Messages for Agent Runs (#14220) 2026-07-14 10:11:10 -04:00