mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-16 13:00:55 +00:00
* 🧷 fix: Promote Unapplied Steers to Durable Queued Turns at Run End A steer the server accepted (202) but the run never applied was handed back in FINAL as `pendingSteers` and re-owned by the browser as a tab-local queued message. A reload, closed tab, or a predecessor race before the drain lost it. At terminal publication, a normally completed run now promotes such steers into server-owned agent queued turns (parent: the ended response, epoch: the ended generation's createdAt, chained behind any turn already queued against that epoch). The job store hands the parked copy over atomically (`promoteSteerLeftover`: parked item removed, receipt settled `recovered`), so status recovery, lost-ACK retries and legacy recovery starts cannot queue the same words again. FINAL reports the receipts in `promotedSteers`; the client adopts them as server rows instead of converting the steer locally. Promotion is opt-in per steer (`promoteLeftover`, sent only by clients that adopt receipts and only for steers with no tab-only context), so older clients keep the legacy path unchanged, and older servers simply never report `promotedSteers`. * 🔒 fix: Settle a Promoted Steer's Hand-Off at Admission, Not Only at FINAL The job-store hand-off of a promoted steer now returns an outcome and stamps the receipt with the owning queued turn, so it is idempotent for that turn. The queued-turn resolver repeats it before admitting a promoted turn: it completes a hand-off a crash interrupted, and cancels the turn when the parked copy was discarded or recovered elsewhere, so the words never run twice. At FINAL, a row whose hand-off was refused and whose retirement cannot be confirmed is withheld from `pendingSteers` and left for that admission check. The conservative reconcile frame keeps `promotedSteers`, and the client adopts it there before sweeping local chips. * 🔏 fix: Give Promoted Steers Durable Ownership, Their Run's Queue Lineage and Approval Mode A turn promoted from an unapplied steer now records its source on its own row: the steer's ids, the generation that accepted it, and a mark set only once the job store handed the parked copy to that row. Admission runs a promoted turn on that mark or on a hand-off the job store confirms now; without proof (the store's evidence expired, or the host cannot ask) the turn is held for review instead of running. - Hand-off replies that are lost no longer cancel the row. The row stays as the client's handle and its admission settles ownership, so a committed hand-off can no longer leave the steer with no runnable copy. - A replayed promotion never hands the parked copy to a row that was cancelled or failed. - Promoted turns join the queue lineage of the generation that accepted the steer, so a sibling still queued behind that run no longer strands them with a predecessor mismatch. - The steer request carries the sender's code approval mode onto the promoted turn; an unreadable mode keeps the steer on the client path. - A steer whose quotes its owner stripped stays on the client path. - The queued-turn receipt names the promoted steer by both ids, and the receipt list retires a pane's local copies even when it missed FINAL. * 🚧 fix: Fence Promoted Turns to Workers That Prove Steer Ownership A promoted row without an approval mode was published under the v1 queued turn capability, so during a rolling deploy a worker that predates the ownership check could claim it and run an unsettled row while the parked steer was still recoverable elsewhere. Promoted rows now publish under a new agent_queued_turn_v3 capability and a v3 delivery identity, always reserved before insertion. A replica that projects an older version can neither publish the reserved delivery nor claim it, and enqueue refuses a promoted row without a reservation. * 🪦 fix: Keep a Dead Promoted Turn Answering for Words It Held A pane that learns of a promoted steer from the receipt list dropped the mapping for every dead row. A row quarantined as ADMISSION_INDETERMINATE can still settle as admitted, and a row that died after it was proven the sole owner of the words is their only surface, so in both cases the pane kept a chip whose recovery could never run. The receipt now says whether the turn owned its steer's words, and a dead receipt keeps answering for them when it did or when its admission is indeterminate. A replayed promotion applies the same rule to a settled row. * 🧾 fix: Find Promoted Turns by the Steer a Pane Holds, Join Root Lineages, Redact Hand-off Errors - A promoted turn's request id is now derived from the client steer id, and a pane asks for the receipts of the steers it still holds a local copy of (recovery rows and failed chips). A promoted turn that already ran is only listed when asked for by name, so a pane that missed FINAL now finds it and retires its copy. A client steer id too long to key a queued turn is not promoted. - The lineage lookup includes a generation admitted from a root queued turn, which has a parent and no epoch. The promoted turn joins that lineage without an epoch instead of opening a second one. - A failed hand-off at admission reports a fixed message. The job store's own error text stays out of the dead-letter record a client can read, and promotion logs carry safe error metadata instead of error text. * 🔢 fix: Ask for Held Steers First Under the Receipt Lookup Limit The receipt list answers for at most 100 request ids, and a pane's server rows were listed ahead of the steers it still holds, so a full server queue could push every held steer out of the request. A promoted turn that had already run was then never found. Held steers now come first. An active server row is listed whether or not it is asked for, while a settled promoted turn is found only by name. |
||
|---|---|---|
| .. | ||
| controllers | ||
| middleware | ||
| routes | ||
| services | ||
| utils | ||
| cleanup.js | ||
| csp.spec.js | ||
| experimental.js | ||
| experimental.spec.js | ||
| index.js | ||
| index.metrics.spec.js | ||
| index.spec.js | ||
| socialLogins.js | ||
| socialLogins.spec.js | ||
| telemetry.js | ||
| telemetry.spec.js | ||