* fix: Preserve Draft Identity Across Navigation
* fix: Await Conversation Records With Loaded Assistant Catalogs
* fix: Reconcile Retained Conversation State on Route Remount
* ⚡ perf: Throttle Code Highlighting While a Message Streams
* fix: harden streamed code highlight throttling
* test: cover wall clock changes during highlighting
* style: tidy highlight regression test
* fix: restart highlight work across lifecycle changes
* style: avoid nested highlight timing ternary
* fix: propagate highlight throttle to startup config
* fix: share and validate highlight throttle
* fix: keep streamed code visible during highlighting
* test: stream highlight tool arguments
* fix: preserve highlights when cadence config resolves
* fix: reschedule highlights when cadence changes
* test: preserve default fake tool chunking
* fix: prevent stale streamed highlights
* test: open the tool pane before asserting streamed highlights
Every scenario in this file waited for highlight tokens without opening the
card. Dev's #16143 stopped passing a closed pane any code at all, so the four
runs polled a card that renders raw text and had nothing to find: the failed
traces show the disclosure at aria-expanded="false" for the whole run, with no
click against it and no tokens in the code element.
Highlighting is now asserted through the card's disclosure, which ProgressText
owns and which carries an aria-expanded state only once the card has input to
show, so waiting on it also waits for the first streamed argument chunk. The
open happens inside expectHighlightedCode, so a scenario cannot assert tokens
without it, and it lands while arguments are still streaming, which is the only
window where the throttle is under test at all.
* test: reopen the rebuilt card for the settled highlight
Opening the pane got the streaming assertions passing and the traces show 240
highlight spans mid-stream, so the throttle itself lands. The settled check
still failed because persisting the streamed message rebuilds the card, and a
rebuilt card starts closed while autoExpandTools is off: the disclosure goes
back to aria-expanded="false" and a closed pane renders raw text.
The settled and cancelled states now assert through the same open-then-wait
helper, so each one measures the card the reader would actually be looking at
instead of the tokens the streaming card happened to leave behind.
* test: leave a window to cancel a streaming highlight
With the settled assertions fixed, the cancellation scenario timed out on the
Stop button instead: it waited for a highlight before stopping, and the ~40
argument chunks it streams at 35 ms are gone in under two seconds, so the run
had already finished and there was nothing left to cancel. It failed on all
three attempts.
The card is now opened and the run stopped before any token is awaited, since
tokens after cancellation are what the scenario is about, and the cancel
variant streams its arguments at a wider cadence so the window does not depend
on how loaded the runner is. Only that label changes cadence; every other
scenario keeps the timing it had.
* fix: preserve initial highlights and honor shared-page cadence
---------
Co-authored-by: Lia <lia@librechat.ai>
* fix: preserve tool pane choices through response finalization
* test: read real message context in content part mock
---------
Co-authored-by: Lia <lia@librechat.ai>
* 🌁 fix: Stop Painting the Closed Mobile Drawer
* 🌁 fix: Re-assert the unpainted value when the slide settles
React owns the resting value and writes it when the travel window closes at
TRANSITION_MS; the release ran a buffer later and cleared the property, which
dropped that value while React still believed its unchanged prop was applied.
React never wrote it again, so every animated close left the drawer painted and
the artifact could recur. Re-asserted through one shared constant, the same way
the drawer width already is.
---------
Co-authored-by: Lia <lia@librechat.ai>
* fix(client): map image/svg+xml artifacts to a renderable template (#16087)
* fix: Rebuild the SVG preview shell from edited source
An SVG artifact previews a derived index.html holding a copy of the
source, so replacing only the edited index.svg left the preview on the
original drawing. Expose the derived-file builder as deriveFiles and
rebuild the whole set from the editor text in SandboxArtifactTabs.
* fix: Scope the SVG preview sizing rule to the root viewport
CSS overrides SVG presentation attributes, so the unscoped `svg` rule in the
preview shell stretched every nested `<svg>` viewport to the panel, corrupting
the layout of sprites and inset diagrams. Scope it to `body > svg`.
---------
Co-authored-by: Frank_zhu <58329837+Frank-zhu0404@users.noreply.github.com>
Co-authored-by: Lia <lia@librechat.ai>
* 🖼️ fix: Resolve Pinned Model Icons from Endpoint Config
- pass `endpointsConfig` and `model` to `MinimalIcon` from the pinned favorites row so a custom endpoint's `iconURL` is honored
Fixes#16088
* test: Cover Pinned Model Endpoint Config Propagation
---------
Co-authored-by: Lia <lia@librechat.ai>
`style.css` pinned every `code` and `pre` element to
`Consolas, Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace !important`.
The repository ships none of those faces, so Windows rendered code in Consolas
and macOS in Monaco, which carries neither an italic nor a bold face for the
browser to use. `!important` also outranked the 21 `pre` and `code` elements
that ask for `font-mono` by class, so the self-hosted Roboto Mono the app
already bundles was never used for code anywhere.
Move the stack to `theme.fontFamily.mono`, where `sans` already lives, so
Tailwind's preflight styles the bare elements and the `font-mono` utility
carries the same value. The tail is ordered so the glyphs the bundled latin
subset omits keep Roboto Mono's advance width.
Co-authored-by: Lia <lia@librechat.ai>
* 🫧 fix: Fold a Streaming Thought Into the Live Row Before Its First Tool Call
A thought at the live tail rendered as its own row with a multi-line peek until a tool call arrived, which then snapped it into the one-row fold. With a reasoning model that talks between calls that is a jump up and back down on every step. The span now folds from the thought's first character and previews it one sentence at a time, under a reasoning glyph until a tool gives it icons.
* 🫧 fix: Keep a Live Card's Key When Its First Tool Call Arrives
* 🫧 fix: Stop Unfolding the Whole Live Span for Every Code Call Without a Leading Intent
blocksLiveFold unfolded the entire span while a bash/code call with complete args, no output and no intent was running, so its card could show the sandbox-startup label. When the model writes intent after command, every code call qualifies: a 47-call run opened to its full height and shut again on each call. The row now reads the same sandbox signal for its newest call and the span stays one card. Also keeps tool-anchored card-key aliases across finalization so a reasoning-led card a reader opened stays open when the response settles.
* 🧹 chore: Sort Imports in ActivityPhaseGroup
* 🫧 fix: Preserve Reasoning Disclosures and Isolate Streaming Siblings
* 🧪 test: Keep Real Part Identity in Content Renderer Mocks
* 🫧 fix: Migrate Sandbox Startup Readers and Writer to Jotai
---------
Co-authored-by: Lia <lia@librechat.ai>
`useLazyHighlight` tokenized the same input twice on every mount that could
highlight immediately. The state initializer highlighted during render whenever
the grammars were already loaded, which holds for every card after the first in
a session, and then the effect highlighted the same input again because its
dedupe ref started empty and could not match on a fresh mount. Each card paid
two tokenizations, two hast-to-React conversions and an extra commit.
Card bodies also tokenized while collapsed. Every code, bash, read-file and
file-authoring card highlighted its content on mount, so opening a long agent
conversation highlighted code nobody had asked to see.
The tokens now carry the key they were produced from, so the effect recognizes
what the initializer already did, and each call site passes its content only
while its pane is open. ExecuteCode gains the raw fallback its three siblings
already had: with highlighting deferred to the pane opening, rendering only the
highlighted nodes would leave the pane empty until the grammars load.
* 🫧 feat: Hold a Live Run's Activity at One Row
Fold the span a run is still writing into a single collapsed row from its first tool call, with a header that bubbles up the newest activity (streamed intent, generic running text, filled batch label, or the thought streaming after them) on a 500ms leading+trailing throttle. The settled rendering is unchanged.
* 🫧 fix: Name Every Live Line and Take the Fold Preference From the Host
Live header resolves failed/cancelled through resolveToolCallPhase, names trailing commentary, and only folds agents-shaped calls it can name. ContentParts takes foldLiveActivity from its host instead of reading Recoil; subagent panels opt out.
* 🫧 fix: Carry Background Stops and Nested Sign-Ins Into the Live Fold
* 🫧 feat: Preview Tail Reasoning One Sentence at a Time in the Live Row
* 🫧 fix: Keep Handoffs, Detached Failures and Status Announcements Out of the Fold's Blind Spots
* 🫧 fix: Keep the Live Line's Shimmer Off the Ticker's Animated Element
Found in Chromium: .shimmer declares animation/position/display, so on the same element it replaced the slide-out and the retired line never left. The sweep now rides an inner span, and the header button is block-level flex so a live row measures the same 28px as the settled row.
* 🧹 chore: Sort Imports in the Live Activity Helper
* 🫧 refactor: Decide a Live Line's Outcome With the Group Header's Resolver
The live header derived pass/fail on its own and re-learned, one review at a time, signals the cards already handle. getToolMeta moves out of ToolCallGroup into Content/outcome.ts and the live line reads it, which covers cancelled status attachments and memory-tool prose failures. A legacy Assistants call now ends a live span like a handoff, and the live disclosure is named by its current line alone (aria-labelledby) so the polite region's previous line stays out of its accessible name.
* 🫧 fix: Make the Live Row Agree With the Cards It Hides
Span-level outcome beside the newest line (an earlier call can fail while a later one runs), announcements with their own identity in one polite region that outlives the live header, the memory-error artifact and step-scoped attachment ownership in the shared resolver, one localized 'Failed: {{0}}' template for the card and the row, and a parity suite that compares the folded row with the REAL cards on unmocked outcome logic.
* 🫧 fix: Keep Live Subagents Unfolded and Give Reused Ids and CJK Sentences Their Own Lines
* 🫧 fix: Hold a Finished CJK Sentence and Honor Open Thinking in Live Folds
* 🫧 fix: Say "Running in Background" as the Card Does and Hold Reasoning Identity Across Whitespace
* fix: Harden live activity folding boundaries and lifecycle
* 🫧 feat: Surface a Span's Own Glyphs on Its Collapsed Header
A header stands for rows it hides, so it carries the most specific glyphs they show. The icon stack swaps the generic search glyph for the sites a web search read (from attachments, or the streamed results while live), and the settled phase header keeps the span's tool, MCP and site icons instead of a bare check; a failed phase keeps its warning glyph. Applied to the live row, the settled phase header and the tool group header. Source helpers move out of WebSearch into Content/sources.ts.
* fix: Preserve owned glyphs and outcomes across collapsed headers
---------
Co-authored-by: Lia <lia@librechat.ai>
* ⚓ fix: Keep a Resumed Compaction Anchored to the Turn It Summarizes
A compaction submits no user turn: its user-message slot names the leaf it
summarizes up to. The resume paths adopted that identity-only projection as a
ROW, rewriting the answer being summarized into an empty, parentless user
message, which buildTree files as a phantom root: the thread folded and the
pane could return on another branch. Treat the slot as an anchor everywhere
rows are written, and let the anchor name the branch to restore.
* Recognize a compaction anchored on a user leaf
Compact runs on whatever leaf the branch ends with and canCompact does not restrict its author, so the anchor is a user message as often as an answer. Detecting it by not-user-created recognized only the assistant-leaf kind: the other was rebuilt as an ordinary turn, so the sync path merged the identity-only projection over the stored row and blanked the prompt still on screen, and a failed abort appended a second row under its id. Judge the anchor by the projection shape instead, and carry the resolved answer on the resumed submission so a flagless re-attach agrees.
---------
Co-authored-by: Lia <lia@librechat.ai>
* 💵 feat: Show Cost per Record, Step and Response in the Trace Ledger
* 💵 fix: Cost for Whole Responses Only, Hidden Records Included, and Said Aloud
* 💵 fix: Give the Oldest Loaded Response No Cost While Older Records Remain
Classify HTTP 408, 429, and 5xx before legacy body-message classifiers can invalidate client registration or start consent. Preserve typed temporary failures across refresh storage and verify retry with the existing grant against the real SDK test provider. Keep permanent grant errors and existing UI retry behavior intact.
Co-authored-by: Lia <lia@librechat.ai>
* ✂️ fix: Name Tool Rounds From the Trace, and Match a Cut Response From Its End
* 🧵 fix: Join a Cut Model Call's Round Only When One Is Waiting
* 🏷️ fix: Read Labels From the End Only for the Response the Limit Cut
* 🪪 fix: Say a Tool Round Came From the Conversation Only When It Did
* 🧾 fix: Carry Where a Tool Round's Calls Came From
* fix: Stop Sealing a Code Environment Decision a Chat Never Made
Switching an existing chat to a coding agent left the composer unable to
send. The chat had no workspace to select, Send stayed disabled, and the
workspace chip was a read-only status with a recovery hint.
Both layers treated "no decision recorded" as "decided to run without an
attached environment". `readPersistedDecision` documented that a stored
conversation always carries a decision and inferred `without_attached`
whenever `codeEnvironmentMode` and `codeWorkspaces` were both absent,
which is the ordinary state of a chat whose turns never involved a
code-capable agent. `resolveConversationCodeEnvironmentDecision` then
sealed that inference, so the first workspace its owner picked came back
as `locked`. The client mirrored the same premise: `locked` was any saved
chat, so `useCodeWorkspace` withheld agent defaults, a remembered
selection, and a sole workspace, and `CodeWorkspaceMenu` rendered its
non-interactive locked branch.
Only a recorded decision is sealed now. A conversation holding neither
field is undecided, so its first coding turn establishes the decision,
and `resolvePersistableCodeEnvironmentDecision` records that decision
with its selections; writing the mode alone would leave `attached`
without the selections the next turn validates. On the client the same
predicate drives `locked`, and the selection defaults that already
applied to a new chat now apply to any chat that has not decided.
An explicit `without_attached` stays sealed, a legacy row still infers
`attached` from the selections it stores, and a sealed decision is still
replaced only by its owner's move.
* fix: Record the first code environment decision on an existing chat
A saved chat that holds no decision may record the one a run establishes,
but every caller persists through `saveConvo`, which carries those fields
only in `$setOnInsert`. On a row that already exists the write was dropped,
so the choice never survived a reload and a later turn could resolve a
different workspace.
`saveConvo` now fills a whole decision onto a row that holds none, by
compare-and-set on that absence: a writer that decided first keeps its
decision, a chat that already holds one is untouched, and bare selections
never seed a row.
* fix: Record the decision a failed turn of a saved chat ran under
`saveErrorTurn` built its conversation fields only when it was seeding a new
row, so an existing chat kept the stored error turn without the decision that
turn ran under: a retry could then pick a different workspace than the failure
already recorded. The validated decision now travels on both branches, where
the conditional write in `saveConvo` keeps it from replacing a stored one.
* refactor: Resolve the error turn's decision fields in `packages/api`
The error-turn save derived its own decision fields, putting persistence
policy in a CJS controller where `/api` is meant to hold wiring only. It now
calls `resolvePersistableCodeEnvironmentDecision`, the resolver the streaming
saves already use, so one rule decides what a turn may record: a chat that
holds a decision keeps it and receives no decision fields at all.
* fix: Keep the legacy code environment lock until the protocol is advertised
The composer unlocked a saved chat that holds no decision without consulting
`codeEnvironmentDecisionVersion`, so during the rollout window it could attach
an agent default and submit it to a replica that still reads a field-less row
as a sealed `without_attached` and rejects the turn as `locked`.
The unlock now waits for the deployment to advertise the protocol, which makes
the hook identical to its previous behavior while the flag is unset. Nothing is
lost by waiting: the unmade decision is only reported once that flag is on.
---------
Co-authored-by: Lia <lia@librechat.ai>
* 🫗 fix: Roll Back Incomplete Skill Archive Imports
A .zip or .skill import created the skill first and persisted its bundled
files one by one, keeping the skill and answering 201 when a file failed
validation, a size limit, storage, or its database row. The client never
read the internal `_importSummary`, so it showed "Skill created" and
navigated to a skill that silently lacked the resources SKILL.md names.
Import is now atomic: any failed bundled file rolls back the skill, its
file rows, the ACL grant, and the blobs already written to storage, and
the request answers 422 `skill_import_incomplete` with the failed paths
and reasons. The upload dialog stays open and lists them.
* fix: Localize Import Failure Reasons and Report Every Lost File
Addresses the first review round on the archive import rollback.
Failure reasons are now stable codes (`invalid_path`, `file_too_large`,
`archive_too_large`, `archive_entry_changed`, `persistence_failed`) that
the client localizes, so a non-English locale no longer sees English text
and storage or driver messages stay in the server log.
The decompression budget stops the scan mid-archive, and the entries it
never reached were missing from the response, telling the user they had
seen the whole failure set. Those paths are now reported too.
Rollback deletes stored blobs only once `deleteSkill` confirms the skill
is gone; otherwise the blobs stay and the request answers 500
`skill_import_rollback_failed`, because a surviving skill pointing at
deleted files is worse than unreferenced storage.
The failure list scrolls instead of overflowing the dialog, and a
response that resolves after the dialog was dismissed no longer
repopulates it for the next session.
* fix: Ignore Late Skill Import Successes
* fix: Make Skill Import Rollback Retryable
* fix: Propagate Incomplete Skill Cleanup
* fix: Settle Rollback Blob Cleanup
* test: Type Partial Cleanup Fixture
* fix: Preserve Settled Skill Cleanup Steps
* fix: Export Skill Cleanup Step Type
* fix: Reconcile Partially Deleted Skills
* fix: Reconcile Skill Rollback Caches
* style: format cleanup reconciliation changes
* fix: complete skill rollback cleanup
* chore: leave generated locale catalogs unchanged
* fix: preserve synced skill blob cleanup
* test: type synced blob cleanup mock
* fix: Validate Archive Paths and Bound Rollback Cleanup
---------
Co-authored-by: Lia <lia@librechat.ai>
Co-authored-by: Danny Avila <danny@librechat.ai>
* 🌓 refactor: Scrim OGDialog With the Overlay Theme Role
OGDialog scrimmed with a literal bg-black/80, so a theme that redefined
surface-overlay moved the Dialog and AlertDialog families and left every
OGDialog black. The scrim now paints bg-surface-overlay/80: the opacity
is unchanged, so the themes whose overlay resolves to black (dark, and
both high-contrast modes) render the same rgba as before, and the light
theme gets the gray scrim it defines, at 4.3:1 against the dialog it
frames.
Follow-up from the review of #15798, tracked as berry-13/LibreChat#14.
* 🧪 test: Carry the Scenario Theme Mode in the URL
The black-overlay scenario switched modes by writing `color-theme` and
reloading, but the init script that seeds the mode stays registered for
the life of the page and rewrote it on every load, so the high-contrast
iterations re-read the first mode and never matched their `<html>`
classes. The mode now rides in the URL and the init script copies
whatever the current navigation asks for.
* 🧪 test: Read the Scrim of the Frontmost Open Dialog
The scrim helpers resolved the dialog with `querySelector`, which takes
the first match in document order. Nothing in the suite is affected —
the settings modal is Headless UI and carries no `data-state`, so the
stacked scenario already measured the account confirmation — but a
scenario that opened an OGDialog from inside another one would have
silently read the outer dialog's scrim. The helpers now resolve the
frontmost open dialog by z-index and read its sibling scrim, and the
color and both sample points come back from one pass over the DOM.
* 🗂️ fix: Let the SharePoint Picker Take the App's Scrim
The picker rendered an OGDialogOverlay of its own beside the
OGDialogContent that portals one anyway. Both sat at depth 1, so both
resolved to z-index 130, and the primitive's overlay — mounted second —
painted over the picker's, so the lighter black it asked for never
reached the screen. The dialog is opaque, so it needs no backdrop of
its own: the extra overlay and its literal are gone and the picker
scrims with the theme's overlay role, exactly once, like every other
OGDialog.
* 🧪 test: Compare the Picker's Scrim to the Primitive's Own
The picker spec pinned the scrim's utility classes, which says nothing
a reader of the app would recognise and would break the next time the
primitive's opacity moves. It now renders a bare OGDialog beside it and
asserts the picker's single scrim is the same layer the app paints.
* 📱 fix: Open Sign-In and External Links From iOS Home-Screen Apps
Sign-in prompts, the MCP OAuth Continue buttons and the account menu links opened with window.open and a noopener,noreferrer features string. WebKit treats a features string as a popup-window request, which an iOS home-screen app cannot open, and the chat sign-in also awaited its CSRF bind before opening, outside the tap. Links now open through a target=_blank link with rel=noopener noreferrer, and the chat prompt binds when it appears so the tap opens the provider synchronously.
* fix: Keep sign-in closed until its CSRF bind lands, and surface builder OAuth in its dialog
A tap while the chat prompt's bind was still in flight could open the provider before its CSRF cookie existed, and an Action callback has no fallback without that cookie; the button now stays disabled until the bind lands. The MCP builder card opened the authorization URL only after its initialize request, which iOS home-screen apps refuse and which left the card with no way to continue; it now shows the MCP OAuth dialog instead.
* fix: Let the tapped prompt own the CSRF binding, and show only the card's live OAuth flow
Live sign-in prompts share one CSRF cookie per callback path, so the last prompt to bind owned it; a tap now re-binds its own prompt right after opening the provider. The builder card kept a local copy of the authorization URL that outlived its flow and could reopen it on a later initialization; it now shows the manager's shared flow URL, cleared when the flow ends, and only for a flow the card itself started.
* 🪶 perf: Render a Finished Message's Markdown in One Pass
Opening a conversation rendered every assistant text part per top-level
block: a full mdast parse just to find block boundaries, then one
ReactMarkdown pipeline, two providers and a layout effect per paragraph,
table and fence. The split only pays while a message streams, where it
keeps completed blocks memoized.
A message that was never streamed in this view now renders as one pipeline
and skips the boundary parse, keyed on its source so an in-place edit
remounts it with fresh code and artifact indices. A message that streamed
here keeps the per-block split after it finishes, so ending an answer never
remounts its blocks. The benchmark gains a finished-message mount case.
* 🪪 perf: Keep the Agents List From Re-Rendering Every Message Part
The author header a message hands its parts, restated after an inline
steer, was an element built from the resolved agent. The agents list
resolves after first paint, so that element changed identity, broke the
memo on ContentParts and re-rendered every part of the message, even
though the header only shows after a steer.
Both row renderers now hand the parts one constant header element that
reads the author from AuthorContext. An agent or assistant resolving
re-renders only the headers on screen, and the row's own icon and label
reuse the same memoized author.
* 🧷 fix: Move a Finished Message to Per-Block Rendering on Its First Change
A finished message kept its single pipeline keyed on its source, so every
change remounted all of it. An artifact editor saves the message every few
hundred milliseconds while the user types, and each save collapsed its
expanded Mermaid rows and reset its code blocks, where per-block rendering
had re-rendered only the artifact's block.
The single pipeline now serves a message only while it is exactly as it
mounted. Generating or any content change moves it to per-block rendering
for good, which remounts it once; later changes re-render only the blocks
they touch. The move happens as generation starts, so the fade baseline is
set on the blocks it mounts.
The splitter also sliced each top-level block after its indentation, which
decides how the block parses: an indented fence under a two-digit list item
kept its indentation in the code, and a two-space-indented list turned a note
into a code block. Blocks now keep their line's indentation.
* 📱 fix: Fit the Tool Library and Skills Pickers to Small Screens
The Tool Library dialog assumed a viewport wide enough for its 224px
navigation rail: below `md` the rail took more than half of a 390px
screen and the card grid was squeezed into the remainder. The rail is
now `md`-only, and the same kind and view navigation renders as a
horizontally scrollable chip row under the search field.
Card and row actions were hover-only, so Configure, Favorite and Remove
were unreachable on a touch screen. They stay hidden until hover only
where hover exists (`@media (hover: hover)`), and are always visible
otherwise.
The Skills picker header put the create button, the filter field and the
view radio on one row, where the field collapsed to 50px beside a
`shrink-0` radio. The view radio and the create button now sit on the
title row, the create button flush right, and the filter field owns the
row below them.
The dialogs fill the viewport below `md` and switch `vh` to `dvh`, so
mobile browser chrome no longer cuts off the bottom of the panel.
* ♿ fix: Gate Hidden Tool Actions on Touch, Not on Hover
Hiding an action until hover has to ask whether a finger can reach it, and
`(hover: hover)` does not answer that: on a 2-in-1 it is true because it
describes the trackpad, while the touchscreen sits right next to it. Tool cards
and tool rows gated their Configure, Favorite and Remove controls on that query,
so a finger user of such a device saw no actions at all.
`packages/client/tailwind.preset.cjs` already carries `touch` for this exact
distinction, `(any-pointer: coarse)` rather than `(pointer: coarse)`. This adds
its inverse, `no-touch`, and gates the hidden state on it, so the hide applies
only where no coarse pointer exists at all and hover no longer takes part in the
decision.
* 📐 fix: Split the Skills Header Onto Two Rows Below md
The Skills header put the create button, the filter field and the view radio on
one row. The radio's segments are `whitespace-nowrap`, so the group never
narrows below 261px, and the field — `flex-1`, basis 0 — absorbed the shortfall
and measured 50px on a 390px screen.
Below md the radio and the create button now take the first line, the create
button flush right, and the field takes the second. From md the row is exactly
what it was: create button, field, category, radio. One DOM order serves both
through `order-*`, so the radio and the create button each exist once.
* 🧷 fix: Let the Skills View Radio Wrap Instead of Clipping
The three view segments carry `whitespace-nowrap` and `px-4`, so the group has a
hard 261px minimum in English and more in longer locales. On a 360px phone that
group and the 42px create button exceed the dialog, which is `overflow-hidden`,
and the trailing option becomes unreachable. The group now uses the primitive's
`wrap` variant and may shrink, so the segments flow onto a second row; at 390px
they still occupy one.
`wrap` reproduced `inset-y-1` by assuming the group had no vertical padding, so
turning it on for a `p-1` group shrank the moving indicator by 8px and left it
floating inside its segment. It now measures that padding from the first row's
offset, which leaves an unpadded group's geometry unchanged.
* 🧪 test: Cover the Small-Screen Tool Library and Skills Header
Ten mock-harness scenarios for the behaviour this branch changes, one per
acceptance scenario id, asserting rendered geometry and computed styles rather
than class strings.
The tool library file covers a phone viewport (the dialog fills it, the rail is
gone, the chip row filters, and no card crosses the viewport edge — the 744px
grid-column overflow), the action gate on all three pointer profiles (visible
with a coarse pointer, hover-gated with a mouse, revealed by keyboard focus),
the selected tool row, and the unchanged desktop rail.
The skills file covers the two-row header below md, the wrapped view radio at
320 and 280 CSS px with every option inside the dialog and the indicator on its
checked segment, and the single desktop row.
* 🧪 test: Pin the Scenario Contexts and Settle Their Geometry
The verifier runs every tagged test in three projects, one of which is a touch
phone, so the mouse scenarios asserted a mouse on a device that reports a coarse
pointer, and the desktop rail on a 412px screen. They now pin their own viewport
and pointer instead of inheriting the project.
Geometry and opacity were also read mid-animation: the dialog scales as it
opens, which put its left edge at 1.5px rather than 0, and the actions fade over
the shared motion duration, which caught keyboard focus at 0.84. Both now poll
for the resting value.
With nothing selected the skills section offers only the dashed empty-state
card, whose accessible name carries the hint line, so the exact-name locator for
Add skill never matched.
* 📏 fix: Keep the Tool Library Shell and Its Body the Same Height
Giving the shell an explicit `md:h-[88vh]` while the body kept its 840px ceiling
let the two disagree: on a viewport taller than about 955px the difference became
dead space below the catalog, 216px at 1280x1200, and below `md` the full-height
sheet left 293px on a 744x1133 tablet.
The body carries the height from `md` again, the way it did before this change,
so the shell wraps it. Below `md` the shell stays the full-bleed sheet and the
body is capped to the same `100dvh`, which it needs because its `h-full`
resolves against a grid area sized to the whole catalog.
Measured shell and body heights now agree exactly: 840 at 1280x1200, 757 at
1280x860, 1133 at 744x1133 and 844 at 390x844, with the catalog still scrolling
inside its own container.
* 🎯 fix: Keep the Search Field Clear of the Dialog Close Button
`md:px-6` on the search row is a responsive variant, so it is emitted after the
base utilities and reset the `pr-12` that reserves room for the close button:
on desktop the row's right padding dropped from 48px to 24px and the field ran
16px underneath the button. It now sets only the left side at `md`.
Measured gap between the field's right edge and the button: 8px at 1280x860 and
at 390x844, with no vertical overlap. Asserted inside the phone-viewport and
desktop-rail scenarios rather than as a new id, since it is the same surface.
* ⌨️ fix: Read the Skills Header in Tab Order and Keep the Chip Row Draggable
Two defects with the same shape: a control that the eye can reach and the
keyboard or the mouse cannot.
The Skills header used `order-*` to serve both layouts from one DOM order, which
left tab order disagreeing with the visual order from `md`: focus went from the
rightmost radio group back to the create button and then into the middle. The
breakpoint now selects the DOM order instead, the way the marketplace dialog
already selects its rail, so each layout reads in the order it renders. Every
control is still built once, so there is one radio group and one create button at
any width.
The mobile chip row hid its scrollbar unconditionally. A narrow desktop window is
below `md` as well, and there a wheel scrolls the page rather than the row, so
Made by you and Favorites could not be reached with a mouse at all. The hiding is
now gated on `touch`, the same `(any-pointer: coarse)` query the rest of this
branch uses.
Measured: desktop DOM order create, field, radio and mobile radio, create, field,
each matching its layout; `scrollbar-width` resolves to `auto` in a 520px mouse
window whose row overflows, and to `none` on a touch phone.
* 👆 fix: Give the Touch Layout Touch Geometry
Two findings with one cause: the coarse-pointer layout inherited the mouse
layout's geometry after this branch changed what it shows and in what order.
Card actions no longer fade out where a finger can reach them, but they are
absolutely positioned over the card's content, so on touch they covered the last
line of a three-line description for as long as the card was on screen - an
overlap that used to be transient. The card now reserves a strip for them there,
`touch:h-36` with `touch:pb-9` on the content, which keeps all three lines.
The chip row is that layout's primary navigation and exists only where a finger
is what reaches it, yet its chips were about 30px tall and its create control
32px, while the repository already exposes the 44px `theme-control-touch` size
for this. Both now carry that floor through `touch:`, and the mouse layout keeps
its compact sizing.
Measured on a 390x844 touch profile: all eight chips 44px, the card 144px, and
the description's box clear of the action cluster. Both are asserted in the
phone-viewport and touch-action scenarios.
* 🗣️ fix: Keep Provider Error Text on Unclassified Agent Failures
An upstream failure LangChain does not classify discarded the provider's own
message and answered with the generic upstream sentence plus a status, so a
gateway or privacy-proxy rejection lost the only account of what happened.
The provider text now rides along in the persisted payload as `message`,
withheld only where a content policy inspects the traffic — the same condition
`getUserFacingProviderError` and `getUserFacingRequestError` already decide by.
* fix: Harden Provider Error Detail Retention
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
- The Anthropic thinking-budget description dropped 'to': 'Claude is
allowed use for' -> 'allowed to use for'.
- The reasoning-summary description rendered 'none,auto' without a
space after the comma.
Only the English locale file is touched.
Signed-off-by: simpleqt <89645338+simpleqt@users.noreply.github.com>
* 🪜 feat: Trace Viewer Steps, Sequence Scale and Previews
* 🪜 fix: split tool-only rounds by run step; preview only a step's own roots
* 🪜 fix: keep windows and previews on the records they describe across pages, modes and failed wrappers
* 🪜 fix: keep step folds and previews honest across page boundaries and failed turns
* 🪜 fix: causal tie-breaks, final-only previews, span-shaped title runs, and truncating long names
* 🪜 fix: index previews in one pass, split agent handoffs, withhold parallel lanes
* 🪜 fix: skip the holes a streaming message leaves in its content
* 🪜 fix: reserve a round for compaction summaries; keep parallel-lane tools with their own model call
* 🪜 fix: record a handoff that starts with reasoning; look lanes up in a map
* 🪜 fix: per-lane leading steps, wrappers for turns without work yet, no final alignment for runs that ended early
* 🪜 fix: append to a step's per-tool bucket instead of copying it per call
* fix: Preserve Trace Preview Alignment Across Run Boundaries
* perf: Cache Trace Ancestors and Lane Branches
* fix: Enable programmatic Bash in selected attached workspaces
* Centralize project PTC construction and preserve recognized capabilities
* Prevent stale list refreshes from restoring removed pins
* ⏮️ fix: Keep the Last Keystrokes When a Run Finishes
* 🧪 fix: Restore the Draft Mocks After the Real-Storage Block
---------
Co-authored-by: Lia <lia@librechat.ai>
* 📓 fix: Keep Typed Text When Starting a New Chat
* 🧷 fix: Keep the Draft Claim Through the Empty-Files Write
---------
Co-authored-by: Lia <lia@librechat.ai>
* 👆 fix: Thumb-Sized Send Button on Touch Devices
* fix: floor the submit target wherever touch is reachable, not only on a coarse primary pointer
---------
Co-authored-by: Lia <lia@librechat.ai>
* 🪃 fix: Remember the Last Code Approval Mode
The code approval dropdown reopened on "Ask before changes" after every new
chat and reload. `useCodeApprovalMode` derived its selection from
`conversation.codeApprovalMode ?? 'ask'`, and a new conversation never carries
that field: `buildDefaultConvo` runs the last setup through `parseConvo`, whose
agents schema does not pick `codeApprovalMode`, so the pick was dropped.
The menu now records each pick in a localStorage-backed Jotai atom, and the
hook seeds its default from it when the conversation carries no mode of its
own. The remembered value is a preference and not a grant: it passes the same
policy gate as a stored mode, so anything current policy no longer allows
falls back to `ask`, and sign-in/sign-out clears it so a shared browser does
not hand the next account a permissive default.
* 🎨 style: Format the Code Approval Preference Files
---------
Co-authored-by: Lia <lia@librechat.ai>
* 🧱 fix: Keep Streamed Content When a Turn Fails
A failure the server reported outside the run — a rejected start on a resumed turn, an error SSE event, a lost connection — rebuilt the response row from the submission's empty placeholder, so the failure replaced the reasoning, text and tool calls that had already streamed and stood alone as if it were its own message. A failure inside the run never did this: the server appends it as an ERROR content part and the row keeps its parts.
resolveErrorTurn now builds every client-constructed failure the same way: the in-flight response keeps what it streamed, less stream holes and the empty text part a run opens before its first token, and takes the failure as one more ERROR part. A turn that fails before anything streamed is still the whole row.
* 🪪 fix: Keep Render Identity and Skip Empty Slots in the Failed Row
The streamed tail is compacted with isEmptyContentPart, so a comparison run's type: '' placeholders and a text or think part opened before its first delta no longer count as streamed content — a run that failed before either lane produced anything is the whole-row error again. Kept parts are stamped with preserveStreamedContentIdentity before the failure is appended, as the final path stamps them, so compacting a hole does not remount the settled row; the appended part is keyed past every existing key so a carried stamp cannot collide with it.
The spec fixtures are typed so the client typecheck passes.
* 🛤️ fix: Keep a Comparison Lane's Placeholder When the Other Lane Streamed
Empty slots now decide only whether anything streamed. Once something did, every non-hole part stays, so a comparison run whose one lane produced output before the failure keeps the other lane's type: '' placeholder — without it the parallel grouping saw a single agent and demoted the surviving output to the sequential flow under the primary agent's name.
* 🪪 fix: Keep the Streamed Row's Envelope When Appending a Failure
The failed row keeps the author, model, icon and creation time it streamed under and takes from the failure envelope only its metadata. A server payload names System as its sender and the schema dates a fresh envelope now; spreading either over the row changed its attribution and timestamp when only a part was being appended.
* ⏱️ feat: Reveal Queued Follow-Up At Run Completion
In an agent conversation the server admits a queued follow-up on its own clock, and the client learned of that successor only through the receipt poll, the active-job poll and a resume attach, so the user's words appeared as the latest turn a second or more after the reply above them ended.
The queued follow-up is now drawn as the newest user turn the moment its predecessor completes cleanly, with its chip reduced to a remove action until the server admits it. The drawn turn is presentation intent only: it never enters the message cache, anchors no send, edit, fork or rerun, and shows only while the completed response it follows is the thread's tail. The intent ends once anything parents on that response, on a cancelled, dead or indeterminate receipt, or on the user's own removal. The composer queues behind it and the completed response offers no rerun while it stands.
The receipt poll also stays alive while the client holds a server-owned row the projection has not settled, so a successor that starts and finishes inside one active-job poll gap is no longer noticed only on the next focus.
* ⏱️ fix: Re-select the Reveal When Its Head Settles and Stop Polling Expired Rows
A revealed head that is cancelled or dies before admission leaves the server-owned queue non-empty and its terminal evidence outside the settled receipts, so nothing re-ran the drain for the row the backend moves on to; the drain now subscribes to the admissible head and the reveal itself. An uncertain row whose reconciliation window has expired is held for manual recovery only and no longer keeps the receipt poll alive.
* ⏱️ fix: Route Dictated Submissions Through the Composer's During-Run Path
A transcription completing while a queued follow-up was about to start called the send path directly and could race the turn the server already owed. The form's routing (answer mode, then steer or queue during a run or a pending reveal, then an ordinary send) now lives in one function that typed and dictated submissions share; a refused during-run submit keeps the text in the composer.
* fix: preserve queued turn ownership across admission handoff
* fix: preserve queued handoff lineage and ownership through recovery
* fix: delegate draft consumption and preserve refused prompts
* 🔓 fix: Keep Code Approval Mode Selectable Mid-Run
The composer's code approval mode selector was disabled while a run streamed, and a mode picked during a run was reverted when the final or abort event merged the server conversation back. The selector now stays usable in flight and both merges retain a mid-run selection, which the next send carries.
* 🔓 fix: Retain Mid-Run Approval Mode Across Cache and Recovery
Stamp the live approval mode onto the submission conversation at send so the retention baseline matches what was read, keep a retained mode in the conversation query cache on final and cancel, and rebuild failed or aborted conversations from a preset that carries the mid-run pick.
* 🔓 fix: Scope Retained Approval Mode to the Submitted Conversation
Retention now requires the live conversation to be the one the run submitted, or the id the server assigned to a new chat, so navigating elsewhere mid-run cannot write that conversation's mode back. A single recovery helper rebuilds failed or aborted conversations from the retained preset and patches the detail cache for every recovery site.
* 🔓 refactor: Keep the Local Approval Mode on Every Server Merge
Replace per-path retention with one rule: a locally picked code approval mode is newer than any server copy of the same conversation, so the final and abort merges and the error recovery preset keep it. The selector writes the pick into the conversation's detail cache, which navigation rebuilds from, so the pick is conversation-scoped without reading the index-global atom from the SSE handlers.
* 🔓 fix: Prefer the Live Conversation When Caching the Final Merge
The final handler's detail-cache merge now takes the local approval mode from the open conversation when it is the one that finished, falling back to the cached record only for a conversation that is no longer on screen.
* 🔓 fix: Keep the Local Approval Mode Through Settled-Start Reconciliation
The resumable transport's settled-start reconciliation and replacement handoff wrote a fetched conversation straight into conversation state and the detail cache. Both now apply the same local-mode rule as the event handlers, treating a new chat's pending id as the settled conversation's own.
* 🔓 fix: Seed the Detail Record When a Mode Is Picked
A conversation that has its id but no detail record yet now gets one from the live conversation when a mode is picked, the same key the resumable transport seeds optimistically, so recovery and navigation find the pick. A chat with no id yet still keeps the pick in conversation state alone.
* feat: send video/audio to custom endpoints that opt in via supportedMimeTypes
The video and audio encoders only emitted OpenAI-format parts (video_url,
input_audio) for OpenRouter, and Google's media part for Google/Vertex. For
every other provider the file was validated and then silently dropped, so a
custom OpenAI-compatible endpoint (vLLM, LiteLLM, ...) never received the
attachment even though the wire format is identical to OpenRouter's.
Emit the OpenAI-format part for OpenAI-like providers when the endpoint's
fileConfig supportedMimeTypes explicitly allows the file's type. The inherited
default list does not count as opting in (isExplicitMimeConfig, keyed on
referential identity like the client's picker), so endpoints whose gateway
cannot handle media are unaffected.
* feat: let a configured custom endpoint pick and attach video/audio
The attach menu's Upload to Provider filter and the drag-drop viability check
only opened video/audio for Google and OpenRouter, or for a custom endpoint
with a fully permissive (.*) supportedMimeTypes. Honor any admin-configured
allowlist on a custom endpoint instead, so a finite list that includes
video/.* or audio/.* is enough, matching the server-side encoders.
* fix: canonicalize input_audio format from MIME type
The `input_audio.format` value was derived from the filename extension via
`filename.split('.').pop()`, which produces values providers reject:
- `clip.wave` (audio/wave) emitted `wave`, but the accepted format is `wav`
- a file with no extension (`recording`) emitted the whole filename, since
splitting a dotless string yields a single-element array, so the existing
non-empty guard never fired
- `clip.mpeg` (audio/mpeg) emitted `mpeg` rather than `mp3`
All of these pass MIME validation and then fail at the provider. Derive the
format from the MIME type instead, mirroring the canonicalization already in
STTService, and fall back to the filename extension only when it is itself a
supported format. Throws when neither source yields one rather than sending an
unsupported value.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix: route opted-in custom endpoint media to the provider path
In unified upload mode an upload carries no tool resource, so its delivery path is
inferred by resolveDefaultLLMDeliveryPath. That resolver judged audio and video for any
named endpoint with isMediaSupportedProvider, which lists only Google, Vertex and
OpenRouter, so a custom endpoint that opted into media through supportedMimeTypes still
recorded video as none and audio as text, and the encoder branch was never reached.
The upload resolver already holds the endpoint's file config, so it now passes the
endpoint's supportedMimeTypes through, and an explicit match on an OpenAI-compatible or
custom endpoint counts as provider-capable, mirroring isConfiguredProviderMediaType on
the encoder side. The inherited default list is still not an opt-in, and known providers
whose encoders emit nothing for media are unchanged. BaseClient re-resolves per turn with
the same function, so the turn path follows.
* fix: scope the media opt-in to custom endpoints that run as OpenAI
The opt-in applied to the built-in openAI and azureOpenAI endpoints too, but the picker
and drag-drop only open media for custom endpoints, so that was a route the client could
not send to. It is now limited to endpoints that are not a known provider.
A custom endpoint may also declare provider: anthropic, in which case initialization runs
it as Anthropic and the encoders emit no media part for it. getCustomEndpointProvider
reads that declaration off the app config, the upload callers pass it as endpointProvider,
the agent encoder and BaseClient pass the agent's resolved provider, and an endpoint known
to run as something other than OpenAI keeps its previous route: video stays off the model
path and audio still reaches transcription.
* fix: reject unsupported provider audio during upload
---------
Co-authored-by: Renato Garita Figueiredo <renato.garitafigueiredo@uni-osnabrueck.de>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* 🪧 feat: Unify Artifact Triggers as Tool Rows
Every chat-side artifact trigger — code-execution output, a model-authored
`:::artifact` block, and a mermaid diagram — now renders through one
`ArtifactRow` that sits on the tool-row axis instead of three card variants
in a wrapped chip strip. The row carries the file type twice: the language's
brand glyph where one exists, and a format badge for titles that are not
filenames. `kind.rendersPreview` tints the glyph and folds the same fact into
the accessible name, so the row says whether opening it yields a rendered view
or source to read.
The mermaid panel routes every download through its export menu — SVG, PNG and
the diagram source — rather than parking a second, unlabelled button beside it.
The menu turns the pressed format into its own loading row, defers the
synchronous SVG export by a macrotask so the spinner paints before the frame
blocks, and no longer disappears on the code tab. A mermaid download keeps its
real filename: its content *is* the stored `.mmd`, so it is not suffixed
`.preview`.
`useArtifactDownload` holds the original-file vs. edited-content decision that
both the generic download button and the mermaid menu need.
* 🩹 fix: Save the Stored Artifact File, Not Its Cached Text
The panel serialized a mermaid diagram from `artifact.content`, which is the
backend cache `extractUtf8` truncates at 512 KB, so "Download source" saved a
corrupt `.mmd` for any larger stored diagram. An unedited mermaid artifact now
takes the same original-file route as every other text-backed artifact,
`handleDownload` reports whether bytes were actually delivered, and the export
menu turns a failed delivery into its failure status and toast instead of
"Diagram download started.".
A `text/plain` row announced "Opens as source" while the panel opened it on the
rendered markdown preview; it now announces the preview. A pending preview
placeholder keeps the row slot it arrived in rather than sinking to the end of
the artifact group and jumping up once it resolves.
* 🧪 test: Exercise Artifact Rows and Mermaid Exports End to End
Seven acceptance scenarios in the mock harness cover what the unit suites
cannot: that a message which writes five artifacts shows five trigger rows on
one axis, that a row's accessible name matches what the panel actually does
with the artifact (rendered preview vs. source, including `text/plain`), that
the mermaid export menu offers SVG, PNG and the diagram source on both the
preview and the code tab, that "Download source" delivers the stored file and
announces a failure when the stored file is unreachable, and that a pending
preview placeholder keeps the row slot it arrived in.
Each test carries its `@scenario:<id>` tag and is self-contained: fixtures come
from the existing fake-model markers, Mongo seed helpers, or page-scoped route
stubs, and every seeded conversation is deleted again.
* 🏷️ fix: Name a Mermaid Blob After the Preview It Is
A share with snapshots disabled strips the download route from a
code-execution `.mmd` but keeps the cached `attachment.text`, and that text is
what `extractUtf8` truncated at 512 KB. With no route to the stored file the
panel can only serialize that cached copy, and the mermaid exception in
`getArtifactDownloadFilename` handed those partial bytes over as `flow.mmd` —
the stored file's own name, from a menu item labelled "Download source".
Mermaid now follows every other file-backed artifact: a serialized blob is named
`flow.preview.mmd`, and only the original-file route produces `flow.mmd`. A
model-authored diagram has no stored file to be a preview of, so it keeps its
own name.
* 🎹 test: Reach the Export Menu's First Item From Either Start
`supports keyboard export` opened the menu with Enter and pressed ArrowDown
once, assuming no item was active yet. CI observed the opposite — the first item
already active — so the single ArrowDown walked past SVG onto PNG and the test
failed there while passing locally (it failed the same way on the previous head).
`Home` lands on the first item from either starting point.
* 🔧 test: Fix the Fixtures Three Artifact Scenarios Ran On
The first verification run failed five of the seven scenarios on fixture defects,
not on product behavior:
- `artifact-trigger-rows` drove a fake-model marker
(`E2E_ARTIFACT_SHOWCASE_REPLY`) that does not exist, so the reply carried no
artifacts and no trigger rows. Both tests now seed the assistant message text
through Mongo, the way the passing plain-text scenario does.
- `mermaid-source-download` waited for an `ArtifactRow` that a code-execution
`.mmd` never renders — it renders an inline diagram whose trigger is "Open as
artifact" — and its cached diagram embedded the literal truncation marker,
which mermaid cannot parse, so the diagram failed to render at all. The cached
copy is now a valid shorter diagram and the stored file keeps the sentinel that
proves which bytes were saved.
- `pending-artifact-row-slot` gave the tool call's id to only one of its two
attachments. Attachments reach a renderer through `mapAttachments` keyed by
tool-call id, so the other one rendered nowhere; both now carry the same id and
land in the one `artifact-row-group` whose ordering the scenario is about.
* 🪜 test: Count Four Authored Rows, Then the Mermaid One\n\nA mermaid fence is not a trigger row while it is inline: it renders the diagram\nwith an "Open as artifact" button and only becomes an ArtifactRow once opened.\nThe axis scenario now asserts the four authored artifacts stack as rows, then\nopens the diagram and asserts its row joins the same column.
* 📐 test: Measure the Row Axis in One Layout State\n\nOpening an artifact narrows the chat column, so comparing the mermaid row's x\nagainst a box measured before the panel opened reported an 8px offset that no\nuser sees. All five rows are now measured after the open, and the panel is\nlocated at page level, where it renders \u2014 not inside the message list.
* 🧩 fix: Give the Mermaid Row Its Own Filename and Download
A code-execution `.mmd` arrives wrapped in a header that prints the filename and
a download button, and that header stayed put when the diagram collapsed into
its trigger row — so the chat showed `flow.mmd` twice and left the download
outside the row that every other file-backed artifact keeps it in.
`Mermaid` now takes the file's download action and hands it to `ArtifactRow`,
and reports whether it is currently rendered as that row; `ToolMermaidArtifact`
drops its header while the row owns both. Opening and closing the diagram
therefore moves the filename and the download between exactly one place each.
* 🔖 test: Match a File-Backed Diagram's Own Trigger Id\n\nThe row ownership scenario looked for a \ trigger id, which\nonly a model-authored fence gets; a code-execution diagram's row carries the\nattachment's artifact id.
* 📱 test: Dismiss the Artifact Sheet Before Using the Row\n\nOn a phone the artifact panel opens as a sheet over the message list, so the\nrow's download button sits behind it. The scenario now closes the panel with its\nown control first, which also shows the trigger stays a row after closing.
* 🔔 fix: Raise One Toast per Failed Source Download\n\n\ already toasts "Error downloading file" before reporting a\nfailed delivery, and the export menu then raised its own — two notifications for\none press, on every ordinary 4xx/5xx, because React Query's refetch resolves\nwith an error result rather than throwing.\n\nA reported failure now only updates the menu's live region, which keeps the\nexport's own phrase for a screen reader; a thrown task still raises the toast,\nsince nothing else has spoken for it.
* 🔕 fix: Let the Download Layer Own Every Failure It Reports
The previous round split the failure notification by cause and left a hole in
the other direction: `useAttachmentLink` toasted only its empty-response
branch, so a thrown fetch — and the artifact hook's own blob failure — returned
`false` with nobody having spoken, and the export menu's live-region-only
announcement reached no sighted user.
One rule instead of two branches: whichever layer returns `false` has already
told the user. `useAttachmentLink` toasts its thrown branch as well, and
`useArtifactDownload` toasts when the blob path throws or there is nothing to
serialize. The mermaid export menu keeps announcing the export's own phrase in
its live region, so one press still raises exactly one toast — this time for
every failure, not just the polite ones.
* 🪄 fix: Hold the Row Slot and the Frame Before Blocking Work
Two fixes on the same theme — a row or a control that moves at exactly the
moment it is meant to stay put.
Writing salience-sorted resolved entries back into their arrival slots still
moved a pending row once it resolved: the placeholder joined the sort and could
pass an empty artifact that had been sitting above it. `attachmentSalience`
reads only `bytes`, which resolution does not change, so one sort over the whole
panel row — pending entries included — is stable across the transition and is
also less code.
The export deferral used `setTimeout(…, 0)`, which only moves the blocking SVG
work to another task; the timer can still run before the browser paints the
loading row, which is the whole point of deferring it. It now waits for an
animation frame and then a task, falling back to a timer when the tab is hidden
and serves no frames.
* 🏷️ fix: Keep the Recovered Filename on the Mermaid Row\n\n\ turns a sandbox-generated \ back into\n\, but that name lived only in the wrapper header. The moment the\ndiagram collapsed into its trigger row, the row title and its download button's\naccessible name fell back to \ — the internal filename.\n\n\ now takes the caller's display name for the row, and\n\ passes the one it already computed.
* 🗂️ fix: Open Each Artifact on the Tab Its Row Promises
A code-only artifact forces the panel onto Code, and that constraint was written
back into the panel's single `activeTab`. The next HTML, Markdown, plain-text,
React or diagram artifact then opened on Code while its trigger row announced
"Opens as a rendered preview" — the row was telling the truth about the artifact
and a lie about the click.
The constrained tab no longer leaks: the panel resets to the preview tab when a
different, unconstrained artifact is opened, so a manual Code choice lasts as
long as that artifact stays open and never follows the user to the next one.
`displayedTab` already derived the forced tab for rendering, so nothing else
depended on the write-back.
* 🧯 refactor: State Failed Turns in Copy a Reader Can Act On
Every client-facing error code now has authored copy, so no failed turn renders
raw JSON, an unresolved `com_error_*` key, or a provider message cut at 512
characters. `client/src/components/Messages/Content/Error.tsx` becomes a module
directory: a dispatcher resolving `json.code ?? json.type`, a registry splitting
one-sentence copy from payload-aware renderers, and shared parts that resolve the
provider, model, user-key ownership and compaction capability behind the failure.
Message-limit violations persist `resetAt`/`retryAfterSeconds`, so the row counts
down to the window's reset instead of naming a window length alone.
* 📸 chore: pin before/after error copy screenshots for the pull request
* 🧹 chore: drop the pinned pull request screenshots from the tree
* 🔻 style: Trail the error disclosure chevron after its label
* ⏱️ refactor: Derive Limiter Resets in packages/api, Stamp Key Expiry as ISO
The message limiter's reset fallback and retry arithmetic move out of the
CJS middleware into `getRateLimitReset` in packages/api, which both the
message and agent-event handlers now call, so /api keeps only the wiring.
`checkUserKeyExpiry` persists `expiredAt` with `toISOString()` instead of
the server's `toLocaleString()`, which a client in another locale could
parse with day and month swapped.
* 🪪 fix: Attribute Failed Turns to the Row, Agent and Payload That Failed
Error content parts render through `Part` without their message, so their
copy named the conversation's current endpoint and model rather than the
ones that failed. The chat, flat-thread and search row renderers now supply
the row's identity through `ErrorSourceProvider`, and the dispatcher reads
it whenever no row is passed directly.
A saved agent's row carries the `agents` endpoint and the agent id as its
model, so identity, key ownership and the key dialog resolve against the
agent's own provider and model; an endpoint named by the payload (an
expired key) outranks both. The agent builder is only suggested where the
side panel would offer it: agents configured, builder not disabled, USE and
CREATE held, and an EDIT grant or administrator role.
Also in the renderers:
- structured refusals read Anthropic's `stop_details.explanation`
- provider bodies nesting their message under `error` keep that message
- upstream model failures name the provider when it is known
- `INVALID_USER_KEY` offers the key dialog on a user-provided endpoint
- an oversized message is never told to compact the conversation
- the countdown is bounded by the limiter's window, not a fixed day, and its
ticking text is hidden from the assertive live region
- an expiry persisted in a server locale is shown as written
- search rows that failed render through the dispatcher, not as markdown
- the payload type is an explicit JSON value type
* 🧪 chore: Seed Real Refusal, Legacy Expiry and Nested Provider Error Shapes
The gallery's refusal case used a string `info` no producer writes; it now
carries Anthropic's stop metadata and a Bedrock content filter. It also
seeds an expiry stamped in a server locale, an unreadable key on a
user-provided endpoint, and a provider body nesting its message under
`error`, and removes whatever it inserted when a write fails.
* 🧵 fix: Keep the Reason From a Provider Body Embedded in Failed-Run Text
A failed run persists a provider error as `<base message>: <SDK message>`,
and Anthropic's SDK message embeds the response body, so the persisted text
reads `…request: 400 {"type":"error","error":{"message":…}}`. The
fallback renderer dropped that body and kept only the prefix, losing the
reason. It now swaps the body for the message it carries.
* 🔀 fix: Resolve Handoff Agents, URL-Owned Credentials and Nested Error Codes
An error part after an `AGENT_UPDATE` belongs to the agent the run was
handed to. `ErrorSourceProvider` now records where a row's handoffs sit,
and an error part resolves the agent active at its own `partIndex`; search
and shared rows give error parts that position too. A handoff the agents
map cannot resolve names no provider instead of the agent that handed off.
A user-provided base URL makes the reader's own record hold the key as
well, so key failures on such an endpoint offer the key dialog. `NO_BASE_URL`
and `INVALID_BASE_URL`, which only a user-provided URL produces, render
through the same renderer with named copy and an add or update action.
OpenAI-compatible bodies nest `code` and `type` under `error`; when the top
level names neither, the dispatcher reads the envelope, so a nested
`invalid_api_key` reaches the key renderer.
* 🕰️ fix: Keep Unknown Key Ownership Generic, Measure Resets From the Row
A shared link's viewer has no endpoint configuration, so whether the reader
or the deployment owns a key is unknown; key copy there read that as
deployment-owned and told the viewer to ask an administrator. Ownership is
now undefined without a configuration, and the copy stays generic.
The countdown's window bound used this device's clock, so a device running
behind the server could drop a valid reset. The window now runs from the
row's own timestamp, which the server stamped alongside `resetAt`.
* 🗜️ fix: Suggest Compaction Only Where the Compact Action Is Offered
Manual compaction is only reachable from the context usage popover, which
`interface.contextUsage: false` removes. Context errors on such a deployment
suggested compacting anyway; they now fall back to the standard next steps.
* 🧭 fix: Keep Row Identity Authoritative and Every Generation Charge Visible
A row's own endpoint and model now stand even where it lacks them, so a
restored failure no longer borrows whatever the conversation selected since;
only an error rendered with no row reads the conversation, and an agents row
with no stored agent id (the live row of a turn that just failed) still
resolves the conversation's agent.
Also:
- a token-balance row lists every generation instead of the first 20
- search rows re-render when their `error` flag changes
- `AUTH_CROSS_ORIGIN`, added since this branch began, renders the login
page's copy and has a gallery case, so the seed's completeness check runs;
a table test now fails for any enum member without authored copy
- upstream model failures keep the provider-neutral sentence the server
persists as their text, which the e2e suite reads the row by
* 🪞 fix: Resolve Ephemeral Agent Ids and Keep an Agents Row's Model Name
An agents row whose model is a model name, as an ephemeral agent's is,
lost both its provider and its model whenever no saved agent resolved.
Agent ids now resolve the way sibling headers resolve them: a saved agent
through the map without the parallel `____N` suffix, an ephemeral agent
through the endpoint and model its id encodes. A row that still resolves
nothing keeps the model name it recorded; an agent id is never shown.
* 🛤️ fix: Attribute Lane Errors to Their Agent, Count Live Retries Relatively
A parallel run stamps each part with the agent of its lane, and an error
part in one lane was attributed to whichever handoff last preceded it. The
row now records error parts' own agents alongside its handoff positions,
and an error part's own agent comes first.
A live countdown subtracted this device's clock from the server's
`resetAt`, so a device running fast could report the limit already over.
`retryAfterSeconds` is now counted from the row's own timestamp, which the
device stamps on a live row and the server on a restored one.
Search results read a cached startup config but have no compact control, so
compaction guidance now also requires the chat surface.
* 🧷 fix: Resolve an Agents Row From Its Own Model, Never the Current Agent
An agents row that stored a model name, as an ephemeral agent's does, fell
back to the conversation's current agent when no saved agent resolved, so
switching the conversation to a saved agent later rewrote who produced the
old failure. The fallback served no real row: the client's live placeholder
for an agents turn stores the conversation's agent id as `model`, as
persisted rows do. The row's `model` now decides on its own — a saved or
encoded ephemeral id resolves, a model name is kept, and the `ephemeral`
placeholder names nothing; only an error with no row reads the conversation.
---------
Co-authored-by: Danny Avila <danny@librechat.ai>