mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-16 21:08:17 +00:00
* 🗓️ fix: Refresh the Sidebar When a Scheduled Run Fires or Settles An automatic occurrence is the one generation nothing in the client starts, so no submission, stream or event handler tells the sidebar its chat exists, and the conversation list's five-minute staleness leaves it out of a tab that stays focused. The schedules panel is already polling for its cards, and `lastRun` moves at exactly the two moments the list should be re-read — a fire adds a chat, a settlement retitles and reorders it — so read the refresh out of that poll rather than adding one. Only transitions refresh; a schedule first seen is recorded in silence, so a panel opened long after a run does not refetch a list that has held its chat all along. This also settles the row Run Now seeds: the schedule's own completion is what replaces the schedule name with the generated title. * 🗓️ fix: Name the Running Occurrence's Chat So the Sidebar Can Fetch It Four review rounds each found a new way the schedule projection diverges from the run it stands in for: `lastRun` is not written at fire, `nextRunAt` moves before the conversation exists, and an edit mid-flight fences the terminal write so `lastRun` never changes at settlement. Nothing on a schedule document means "this run's chat is listable now", so every signal read from one was too early or too late. Stop inferring. The list handler already reads the user's schedules and limits in parallel; read their active run rows alongside — one user-scoped query, joined by schedule id — and project the running occurrence's conversation id as `activeRun`. It comes from the run's own row, so the configRevision fence on the schedule projection cannot hide it, and it is absent until dispatch has actually reserved a conversation. The panel hook then hands every id the list names to the same admission watch Run Now uses, which probes until the server has the chat and adds the server's own row: one mechanism for both paths, idempotent per id. A run leaving the list has settled, and the list is re-read once for the order its settlement changed. * 🗓️ fix: Fetch Every Chat the Schedule List Names, and Scope the Run Read Three from codex on the rebuilt design. A run short enough to start and settle between two polls is never seen running, and most scheduled chats are short. The list also names the chat the last occurrence produced, so the panel now fetches every chat the list names that it has not seen — active or settled — through the same admission watch. The first observation still fetches only runs in flight: a panel opened long after a run must not go and fetch history. Project every running occurrence rather than the latest. A `requires_action` pause does not block the next occurrence, so a schedule can hold two, and reducing to one hid the pause's settlement. This also deletes the picker. The single-schedule route's run read started before ownership was known and was scoped only by schedule id. The response was gated, but a speculative read must stay scoped to the caller: use the user-bound query the list uses and narrow it, rather than touch rows the caller may not own. * 🗓️ fix: Let One Layer Decide What to Watch, and Say Which Runs Are Generating Two from codex on the previous round. The admission watch forgets a run whose delivery outlasted its budget so a later announcement can retry, but the panel kept its own permanent record of every id it had handed over and never announced one twice — so that retry could never happen. Drop the panel's record: every chat the list names is handed to the watch on every observation, and the watch is the one place that decides whether an id is landed, in flight, or worth trying again. The one thing the panel still must not do is fetch history. Opening it used to start a watch per active occurrence, and a run parked on an approval can sit there indefinitely and accumulate, its chat listed long ago. Carry each occurrence's status on the wire, and on the first observation treat only a generating occurrence as in flight; a settled one and a paused one are history, and a pause resolving later still re-reads the list. * 🗓️ fix: Read Only Generating Runs for the List, and Hand Over Only Those Three from codex, and this round removes more than it adds. The list's run read returned every paused row, unbounded, on each poll. `ScheduleRun` is indexed by status rather than by user, `requires_action` rows accumulate for as long as their approvals wait, and `started` rows are bounded globally by the capacity slots — so the read now asks for `started` alone, through an optional status narrowing on the existing method. A pause resolving is still seen through `lastRun`; what this gives up is only the corner where that projection is fenced by a mid-flight edit. A run that failed during initialization settles with its reserved id but never writes a conversation, so its route answers 404 for good — and handing settled ids to the watch meant re-probing it every poll, forever. The watch only ever needed generating runs: a settled one is already covered by the list re-read its settlement triggers, which brings the server's own row. A deleted schedule leaves the list, and comparing only the schedules still present missed the abort-and-settle that deletion performs on its run. A schedule vanishing now counts as its state moving. * 🗓️ fix: Compare a New Schedule Against Idle, and Bound the Landed-Run Record Two from codex on the head GitHub replayed onto dev. A schedule created in another tab can arrive in this client's list with its first run already settled, and a comparison that walks only the schedules seen before never looked at it. Compare a newcomer against the idle state: one that arrives with a run behind it is news the list should hear, one that arrives with no run yet is not. The watch remembers every run it landed so a later announcement is a no-op, and a panel that stays mounted sees a new id per occurrence for as long as schedules keep firing. Keep the most recent 256: a run is announced only while in flight, and none is still in flight by the time that many have started after it, so the oldest can go without a watch ever running twice. * 🗓️ fix: Re-read on First Sight Only When a Run Outran the Sidebar, and Never Evict a Live Watch Two from codex. "The first observation is silent" assumed the sidebar's lists had been read after any run they should hold, and that is not guaranteed: open the panel after a run fired and finished with it closed, and the card says the run succeeded while the sidebar was read before it ever fired. The first observation has no earlier one to compare against, so compare against the sidebar instead — re-read only if some run fired after the lists were last read, which is precisely the case where they lack its chat, and stay silent otherwise. The landed-run cap assumed fewer than 256 generations could be in flight at once, and the config schema bounds neither maxPerUser nor fireConcurrency. Keep in-flight watches in their own set, bounded by real concurrency and never evicted — a second watch for a run still being watched is the one thing that set exists to prevent — and cap only the landed record, where a forgotten id costs at most one extra probe. * 🗓️ fix: Re-read on First Sight When Anything Has Run, Release Runs the List Drops, Observe Every Poll Three from codex, each a defect in an earlier fix, and each answered by removing something. Comparing a run's fire time against the list cache's `dataUpdatedAt` was measuring cache writes, not server reads: a foreground chat inserted after the run advanced the stamp without adding the scheduled chat. There is no timestamp for "last read from the server", so stop guessing — the first observation re-reads if any schedule has run at all, and one refetch on opening the panel is the honest price. A run can be landed and still generating for minutes, announced on every poll; a count cap evicted it and restarted its probes. The hook is the one place that sees an occurrence leave the list, so it releases the id then, and the watch remembers a run exactly as long as something can announce it. No cap. React Query hands back the same array for a deep-equal poll, so an effect keyed on the data never ran again while a run stayed in flight — and a watch that gave up was never asked to try again. Key on the poll's timestamp. * fix: Release Scheduled Run Retention Across Admission and Unmount 🧹 |
||
|---|---|---|
| .. | ||
| __tests__ | ||
| Agents | ||
| Auth | ||
| Endpoints | ||
| Files | ||
| Insights | ||
| Langfuse | ||
| MCP | ||
| Memories | ||
| Messages | ||
| Misc | ||
| Projects | ||
| Schedules | ||
| Skills | ||
| SSE | ||
| Subagents | ||
| Tools | ||
| CodeEnvironments.ts | ||
| connection.ts | ||
| Favorites.ts | ||
| index.ts | ||
| mutations.ts | ||
| prompts.ts | ||
| queries.ts | ||
| roles.ts | ||
| tags.ts | ||