LibreChat/client
Danny Avila 06ddaf8a3d
🧷 fix: Attach to a Continuation the Finished Run Left Behind (#15414)
* 🧷 fix: Attach to a Continuation the Finished Run Left Behind

The FINAL path never clears the submission atom. A pane that has just finished
a run therefore keeps holding it, and the external-run re-arm treated that as
"already attached" — so the announcement was skipped, the status query stayed
disabled, and nothing attached.

That is the common shape, not an edge case. A background tool dispatch
finishing starts the next generation for a conversation whose pane almost
always just completed the run that dispatched it. The sidebar spinner showed
the run because it reads the active list directly; the pane itself sat on the
previous turn until a reload, so both the harvested task output and every
following generation stayed invisible.

Distinguish an attachment from bookkeeping: a submission stands in for a live
stream only while `isSubmitting`, which stays true across reconnect backoff and
is raised before a submission is installed, so recovery still reads as attached
and a fresh send has no window where it looks finished. When the announcement
is answered and a finished submission is still installed, release it — the run
it describes is over, and a server-side continuation is a different generation
that the resume path owns building for.

* 🪢 fix: Treat an Attaching Resume as Live, Not as Leftovers

Self-review of the previous commit. Gating liveness on `isSubmitting` alone
reads a resumed attachment as finished for the whole window between installing
its submission and its stream opening — this hook installs the submission, and
only the `open` handler raises `isSubmitting`. An announcement landing there
would release the submission this hook had just built, tearing down the
attachment to rebuild it, and on a slow or retrying subscribe that repeats
every heartbeat.

The generation epoch is the missing half: this hook stamps it immediately
before installing a resume submission, `subscribeToStream` stamps it for every
other attachment, and terminal teardown clears it. Read both — `isSubmitting`
covers sends and reconnect backoff, the epoch covers attaching — and a
submission counts as leftovers only when neither says otherwise.
2026-08-31 10:20:33 -04:00
..
public
scripts
src 🧷 fix: Attach to a Continuation the Finished Run Left Behind (#15414) 2026-08-31 10:20:33 -04:00
sw
test 🔇 refactor: Quiet Framework Logging in Unit Tests (#15363) 2026-08-30 15:26:30 -04:00
babel.config.cjs
check_updates.sh
index.html
jest.config.cjs 🧮 fix: Currency-Safe Single-Dollar LaTeX via Micromark Tokenizer (#15181) 2026-08-24 22:29:02 -04:00
jest.resolver.cjs
nginx.conf
package.json 📦 chore: Bump Packages from LibreChat SCA Audit (#15410) 2026-08-31 08:51:17 -04:00
postcss.config.cjs
tailwind.config.cjs ✨ feat: Context Gauge Hover Reveal and Breakdown Motion Polish (#15038) 2026-08-21 11:34:36 -04:00
tsconfig.json
vite.config.ts