mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-17 05:20:55 +00:00
* 🍃 fix: Serialize Index Builds and the Agent Edge Cleanup for DocumentDB Amazon DocumentDB admits one index build per collection at a time and rejects a second with code 40333. MongoDBSaver.setup() starts the compound and TTL builds of each checkpoint collection concurrently and returns the rejections, which buildMongoSaver logged and ignored, so the TTL index was the likely loser on every boot and checkpoints never expired. setupCheckpointIndexes re-runs the idempotent setup() while any rejection is a 40333. auditLog and the two index migrations bypassed createIndexesWithRetry; buildIndexWithRetry is the raw-collection form and they use it. removeAgentIdsFromEdges pruned deleted agent ids with an aggregation-pipeline update, which DocumentDB rejects; the guard missed it because the pipeline reached updateMany as a function return value. It is now a read, a prune in code, and a compare-and-set bulk write, keeping the per-graph atomicity the pipeline had. The static guard now carries the full 5.0 unsupported-operator matrix, rejects $set/$unset at stage position and the $count accumulator, follows calls to functions that return an array, and holds every index build to the retrying helpers. * 🍃 fix: Keep Companion Setup Errors Past the Deadline and Trace Appended Stages Codex round 1. setupCheckpointIndexes now carries the non-conflict errors of the last pass and returns them beside the conflict when the peer-build deadline passes, so a permanent failure on one collection is still logged when the other stays busy. The alias-stage detector also inspects the arguments of push, unshift and concat and both branches of a conditional element, since a pipeline assembled by push was invisible to it. Both tests fail without their fix. * 🍃 fix: Page the Edge Cleanup, Count the Build Deadline From the First Conflict, and Widen the Guard Codex round 2 and Copilot. buildWhenCollectionFree now starts its deadline at the first conflict rather than the first attempt, so a saver that admits one long build before reporting a companion 40333 still gets its rerun instead of caching with an index missing. removeAgentIdsFromEdges reads matching graphs a page at a time (sort by _id, limit) and uses the filter as its cursor, bounding application memory the way the server-side update did; the loop is bounded by passes without progress rather than a fixed attempt count. The guard follows array-returning class and object methods, resolves stages held in variables, and exempts the Meilisearch createIndex by its primaryKey option instead of by file. retryWithBackoff rejects NaN options instead of skipping every attempt. Every new test fails without its change. * 🍃 fix: Walk the Edge Cleanup Behind an _id Cursor and Propagate Setup Rejections Codex round 3. removeAgentIdsFromEdges pages behind an _id cursor so every pass resumes where the last one stopped instead of rescanning the cleaned prefix, with one sweep from the top once the cursor is exhausted to pick up compare-and-set misses; a test lands a concurrent edit on a first-page graph and checks the miss is cleaned. setupCheckpointIndexes rethrows a rejection of setup() itself so buildMongoSaver keeps its in-process fallback, converting only a build conflict that outlasts the deadline. The guard resolves a returned identifier against array-bound variables, so a pipeline built in a local and returned is still a pipeline update. * 🍃 fix: Bound Cleanup Sweeps and the Audit Index Wait, Reuse the Removed-Id Set Codex round 4. removeAgentIdsFromEdges gives up after a bounded number of sweeps from the top when references keep being added, since progress otherwise resets the stall bound forever (reachable in deleteUserAgents, which deletes the agents after cleanup); the removed-id set is built once per cleanup rather than per graph. The audit append index build on the request path now has a deadline, so a peer holding the collection makes the append fail open instead of holding the request; createAuditLogMethods takes optional index-build overrides so a test can shorten it. The guard treats a variable annotated with an array type as array-valued whatever its initializer, and states that dataflow is followed within a file only. |
||
|---|---|---|
| .. | ||
| documentdb | ||
| ferretdb | ||