mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-18 22:14:27 +00:00
3335 commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
1c115cdebf
|
🐛 fix: improve sidebar title clarity and hover scrolling (#15644)
* fix: improve sidebar title clarity and hover scrolling * fix: address PR review bot findings Copilot: - Drive the title fade from CSS so autoprefixer emits -webkit-mask-size for WebKit; Web Animations silently drops prefixed keyframe properties. - Guard MediaQueryList subscription so legacy addListener/removeListener engines neither miss the change handler nor throw during cleanup. |
||
|
|
a9da01fbe7
|
📐 fix: Keep the Live Slot Under a Phase Card One Row Tall (#15639)
Some checks are pending
Codegraph E2E Votes / vote (full suite) (push) Waiting to run
Docker Dev Branch Images Build / publish (push) Waiting to run
Frontend Unit Tests / Codegraph select (push) Waiting to run
Frontend Unit Tests / Build packages (push) Waiting to run
Frontend Unit Tests / TypeScript type checks (client) (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/client (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 1/2) (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 2/2) (push) Blocked by required conditions
Frontend Unit Tests / Vite build verification (push) Blocked by required conditions
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Blocked by required conditions
* ♻️ refactor: Share the Tool Row Box Across Call Cards Eight call cards carried the same literal for their header row's box — `relative my-1.5 flex h-5 shrink-0 items-center gap-2.5` — one per card kind. It is one design decision (a 20px line with 6px above and below), and the next commit needs a ninth element to match it exactly, so it becomes `TOOL_ROW_CLASSES` in `rows.ts`. No rendered output changes. * 📐 fix: Keep the Live Slot Under a Phase Card One Row Tall While a run streams, the slot beneath a collapsed synthesized phase card alternates between two things: the streaming cursor, rendered the moment a label fills and its row folds into the card, and the next call's row, rendered the moment that call starts. Replaying a real export through `ContentParts` step by step showed those two boxes differ: the cursor sat in a bare `Container` (20px, no margins) while every call row is `my-1.5 h-5` (32px). Everything beneath the card therefore stepped up on each absorb and back down on each call — measured at 6px in Chromium with the app's generated CSS, and larger in the live column where the row's bottom margin cannot collapse. The cursor now takes `TOOL_ROW_CLASSES`, the exact box of the row it stands in for, so the swap is height-neutral; a 2px inset centers the 12px dot on the 16px glyph rail. The test asserts the cursor carries every token of the row box, and fails against the previous container. |
||
|
|
f4e967bf22
|
🩹 fix: Restore the Client Build by Parsing Single-Dollar Math via Micromark (#15638)
`markdownToHtml` (#15087) imported `preprocessLaTeX` from `client/src/utils/latex.ts`, but #15181 replaced that preprocessing pass with the currency-safe `singleDollarMath` micromark construct and removed the function. The symbol exists nowhere in the repo, so `dev` fails `tsc --noEmit` with TS2305 and the Vite build with `[MISSING_EXPORT] "preprocessLaTeX" is not exported by "src/utils/latex.ts"`, which reds out the client typecheck, the build verification, and every job downstream of the client build on `dev` and on every open pull request. Register `singleDollarMath` in the extension list when `mode.latex` is set instead. That is exactly what the message renderers do — `markdownConfig.ts` adds `remarkSingleDollarMath` only when `latexParsing` is on, and that plugin does nothing but push `singleDollarMath` into `micromarkExtensions` — so clipboard HTML keeps mirroring the rendered message, which is the parity this helper is built around. `markdownToHtml` parses with `fromMarkdown` directly rather than through unified, so the extension array is the equivalent seam. Both specs already pinned the intended behavior and pass unchanged: `$E=mc^2$` becomes inline math under `latex: true`, `$5 to $10` stays currency. Their titles said "preprocesses", which no longer names a mechanism that exists; they now say "parses". |
||
|
|
f174da6159
|
📋 feat: Copy Messages as Rich Text (#15087)
* feat: copy messages as rich text Adds an opt-in setting that places a rendered HTML flavor on the clipboard next to the markdown, so pasting an assistant response into an app that does not understand Markdown (Teams, Outlook, Word) keeps its headings, lists, tables and code formatting. The HTML is serialized from the same mdast pipeline the message renderer already uses, with inline styles because those paste targets strip stylesheets. Raw HTML in a message is escaped rather than passed through, matching the renderer, and link and image URLs go through the existing isSafeUrl allowlist. The plain copies (share links, API keys, OAuth callback URLs) keep using the base hook, so they are never wrapped in markup. The setting is off by default: markdown-aware targets prefer the HTML flavor when it is present, so making it unconditional would regress them. Closes #13973 * fix: address review feedback on rich text clipboard copy Mirror the renderer's `singleDollarTextMath: false` so paired currency such as "$5 to $10" is not read as math and stripped of its dollar signs in the HTML flavor. Pair every background the serializer sets with its own foreground, and let blockquotes and table cells inherit the destination's colors. The paste target's theme is unknowable, so a lone light background could land under a dark editor's light text. Resolve reference-style links and images against their definitions rather than dropping the hyperlink. Skip the HTML flavor for user messages while `enableUserMsgMarkdown` is off. Those render as literal text on screen, so formatting them on paste would not match what was copied. * fix: mirror the message renderers more closely in rich text copies Apply the same `remarkApproxTilde` and `remark-supersub` transforms the renderers apply to the parsed tree, so `x^2^` arrives as a superscript instead of literal markers. Select the renderer to mirror per message: `Markdown` (assistant) enables directives, `MarkdownLite` (user) does not, so a user message showing literal `:::` markers keeps them in the HTML flavor. Resolve path-relative URLs against the app's base URI. A generated file or image link resolves against LibreChat on screen but against the destination document once pasted. Absolute URLs are passed through verbatim rather than normalized. Serialize each text content part as its own document. Each part renders through its own Markdown instance on screen, so a construct must not span two of them; a private-use sentinel carries the boundary through citation processing, which only touches its own markers. * fix: match the renderer on line breaks, relative URLs and LaTeX Message text renders under white-space: pre-wrap, so a soft line break is a visible line on screen. Emit those as <br /> instead of a raw newline, which every HTML paste target would collapse to a space. Screen URLs through react-markdown's own transform rather than the artifact template's isSafeUrl, which rejected bare relative targets like docs/guide.html and dropped links the conversation shows as working. Everything relative is then resolved against the app's base URI. Apply preprocessLaTeX to assistant segments when LaTeXParsing is on, as the assistant renderer does, so single-dollar math is read as math rather than left as literal dollar signs. * fix: align rich text copies with directives, footnotes and search rendering Show an inline directive by name, as the artifact plugin displays it, rather than dropping the marker and keeping only its children. Number footnotes by the order their references appear and omit a definition nothing references, matching what the renderer displays instead of emitting the source label. Keep a generated citation marker from resolving against a reference definition that happens to share its number, which linked the citation to the wrong URL. An unresolved reference now falls back to its own source form, as remark-rehype reverts one. Let a caller state the renderer its row was displayed with. SearchContent falls back to MarkdownLite for a message without content parts whatever its author, so search results and shared links pass that through. Replace the part-boundary sentinel with a citation processor that carries its numbering across parts, so each part is formatted on its own without a private-use character that message text could itself contain. * fix: close remaining gaps between rich text copies and the rendered message Route rooted /images/ sources through apiBaseUrl the way the renderer's image component does, so a subdirectory deployment's images survive the paste instead of losing the base path to the leading slash. Show an artifact directive by its title, which is what its button displays, rather than pasting the implementation the conversation hides. Gather footnote definitions into a footer ordered by first reference, matching where and in what order the renderer shows them. Keep a loose list's paragraph wrappers. mdast records looseness on the list, not on every item, so the parent decides whether an item is tight. Emit the citation footer as its own segment. Appended to a segment ending in an unclosed fence, the sources were swallowed into the code block. Pass the search results MessageParts already loads into useMessageHelpers, which was copying assistant responses with their citation markers stripped and no sources appended. * fix: transform MCP markers and default an untitled artifact Run mcpUIResourcePlugin over assistant segments as the full renderer does, so a UI resource marker leaves as nothing rather than pasting the protocol text. An embedded interactive resource has no static form, and MarkdownLite does not transform the markers, so user turns keep them literal exactly as they are displayed. Fall back to the Artifact component's own default title when a directive carries none, instead of dropping the artifact from the copy. * fix: honor definition precedence, file link rewrites and error rows Keep the first of two reference definitions sharing a label, as CommonMark does, instead of letting the last one win. Route a user's own generated-file links through the app's file endpoint the way the anchor component does, so a pasted link points where the one in the conversation points rather than at the provider URL. Skip the HTML flavor for an errored row. ErrorMessage renders those, so serializing the raw payload as markdown would paste something the conversation never showed. Scope reserved citation labels to the segment that generated them. Each part is its own document, so a legitimate reference in one part is no longer suppressed by a citation numbered the same in another. * fix: resolve file citations against the references collection File-search sources live under references, as useCitation reads them, but the clipboard's type map had no entry for file. Their markers were therefore stripped without a source, so a citation visible in the response went missing from the copy. |
||
|
|
000349681e
|
🩻 feat(insights): Scope Insights to Authorized Agents (#15549)
* feat(insights): add agent-scoped access * fix(insights): exclude unattributed assistant messages * fix(sharing): key role insight toggles by principal * fix(sharing): preserve insight grant snapshot * fix(permissions): preserve insight bits atomically * fix(permissions): guard insight audit rollback * fix(insights): keep admin grant controls accessible * fix(permissions): reconcile duplicate principal updates * fix(insights): show automatic admin access * fix(permissions): harden insights access updates * fix(insights): simplify authorization and preserve client state |
||
|
|
3d085b227d
|
🛰️ feat: Show BYOM Worker Readiness (#15618)
* feat: Show BYOM worker readiness * test: Exercise approved BYOM commands end to end * test: Wait for BYOM worker readiness |
||
|
|
d9dfdeb643
|
💫 style: Align the Phase Summary Rail and Simplify its Fold (#15619)
Some checks are pending
Backend Unit Tests / Build packages (push) Waiting to run
Backend Unit Tests / Codegraph select (push) Waiting to run
Backend Unit Tests / TypeScript type checks (push) Blocked by required conditions
Backend Unit Tests / Circular dependency checks (push) Waiting to run
Backend Unit Tests / Tests: api (shard 1/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 2/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 3/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: data-provider (push) Blocked by required conditions
Backend Unit Tests / Tests: data-schemas (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 1/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 2/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 3/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 4/4) (push) Blocked by required conditions
Codegraph E2E Votes / vote (full suite) (push) Waiting to run
Docker Dev Branch Images Build / publish (push) Waiting to run
Frontend Unit Tests / Codegraph select (push) Waiting to run
Frontend Unit Tests / Build packages (push) Waiting to run
Frontend Unit Tests / TypeScript type checks (client) (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/client (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 1/2) (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 2/2) (push) Blocked by required conditions
Frontend Unit Tests / Vite build verification (push) Blocked by required conditions
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Blocked by required conditions
* 💫 style: Align the Phase Summary Rail and Simplify its Fold A phase summary was the only row in a transcript with no icon rail, so its text sat at 13px while the tool rows it stood for sat at 24px and the rows it swallowed moved out to 37px behind the card's `px-3` — three left edges in one block, with every folded row stepping 13px sideways as the box materialized. - The header takes the same 16px glyph slot every tool row has (`Check`, or `TriangleAlert` when the phase failed), which lands its text on the one rail. - The card chrome is gone: border, background, radius, body padding and divider. The summary is a row among rows, so nothing moves horizontally when it forms, and the entrance is the two grid rows trading places rather than four properties resolving at once. - The label is a ticker. A synthesized card re-titles itself every time it absorbs another finished block, and swapping that text instantly is what made the absorbed row look like it simply vanished; the retired summary now rises out of the clipped row while the new one comes up from below. - The label uses `tool-status-text`, so a summary scales with the reader's font-size setting like the rows around it instead of sitting at a fixed 14px. `ToolCallGroup`'s category glyph was a fourth rail at 28px (`h-5 w-5`); it now matches `ToolIcon` at `size-4`. `ease-[cubic-bezier(0.16,1,0.3,1)]` emitted nothing: `tailwindcss-animate` registers its own `ease` utility for `animation-timing-function` alongside Tailwind's `transition-timing-function` one, an arbitrary value matches both, and Tailwind resolves that ambiguity by dropping the class. The curve had never reached the chrome — the two-easings problem the comment warns about, caused by its own fix. It is written as an arbitrary property now, and it was the only such usage in the repo. * 🩹 fix: Settle the Phase Label in One Commit and Drop a Duplicate Media Query Review follow-ups on the phase ticker. - `useSmoothStreaming` already resolves to `smoothStreaming && !reducedMotion`; subscribing to the same media query again installed one `matchMedia` listener per phase card without changing the answer. - The label copied `text` into state from a passive effect, so a swap with no animation could paint the previous summary for a frame while the button's `aria-label` already carried the new one. It is adjusted during render now, which settles both paths in the same commit. - The incoming line kept its `animate-in` class only while the retired line existed, so clearing that line on its `animationend` could strip the class from a slide still in flight. The class now rides its own flag. - The test's label factory no longer needs `as unknown as`: every field on the ACTIVITY_LABEL part but `type` is optional, and the double cast was only there because a computed key widens to `string`. * ♿ fix: State the Phase Header's Inset Focus Ring Locally The header sits inside a permanent `overflow-hidden` wrapper — the 0fr/1fr grid needs it — so its focus ring has to be inset or it is drawn outside the border box and clipped away. That holds today only because the shared ghost variant supplies `ring-inset`; a change in `packages/client` could remove the indicator from here with no signal. It is declared on the element now, with a test that asserts both the clip and the inset ring. |
||
|
|
c302ae6f35
|
🪁 fix: Honor Endpoint Drop Params in Parameter Panels (#15610)
* Remove parameters from UI when parameter is dropped through dropParams * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Addressed copilot and codex review suggestions * 1. Normalize drop parameter names in client/src/components/SidePanel/Parameters/Panel.tsx Admin-configured dropParams for Azure/OpenAI-compatible custom endpoints use the effective backend field names (maxTokens, topP, frequencyPenalty, presencePenalty), but the panel's filter compared them against the UI's snake_case keys (max_tokens, top_p, etc.), so the controls stayed visible and silently discarded whatever the user set. Added a dropParamsBackendToUIKey map (in packages/data-provider/src/parameterSettings.ts) and normalize each dropParams entry through it before filtering. 2. Apply the same drop-parameter filtering in client/src/components/SidePanel/Agents/ModelPanel.tsx The Agent builder's model panel built its parameter list independently and never consulted endpointsDropParamsMap at all, so it kept offering controls for Azure/custom providers whose values the backend drops. Reused the same resolution logic (including the new backend→UI key normalization) there, sourced from useGetStartupConfig. 3. Remove any escapes from Azure fixtures in packages/api/src/app/config.test.ts Three tests built azure groupMap/modelGroupMap fixtures via ... as any as AppConfig['endpoints'], bypassing type checking for that shape. Replaced them with two typed helpers, createAzureGroupMap and createAzureConfig, built from the existing TAzureConfig/TAzureGroupMap/TAzureModelGroupMap types, so the fixtures are now fully type-checked with no any. * HAL-1081 Deploy librechat open 1. Gate the backend-name alias to OpenAI-compatible parameter sets (packages/data-provider/src/parameterSettings.ts) dropParamsBackendToUIKey had been applied unconditionally, rewriting a dropped topP to top_p even for a custom endpoint whose defaultParamsEndpoint is anthropic/google (or a native bedrock-* endpoint) — where topP is the UI key, so the rewrite broke hiding the control. Replaced the plain map with resolveDropParamsUIKeys(dropParams, endpointKey), which only aliases backend names for OpenAI-compatible endpoint keys (openAI, azureOpenAI, custom, openRouter) and passes native-provider keys through unchanged otherwise. Updated both Panel.tsx and ModelPanel.tsx to call it with overriddenEndpointKey, and added a resolveDropParamsUIKeys test suite in parameterSettings.spec.ts. 2. Prune stale model_parameters when a control becomes hidden (client/src/components/SidePanel/Agents/ModelPanel.tsx) When a parameter an agent already had set gets added to its endpoint's dropParams, the control disappeared but the value stayed in model_parameters and was saved unchanged by composeAgentUpdatePayload — invisible to the user and silently reactivated if the endpoint later stopped dropping it. Added a useEffect, mirroring the conversation panel's existing pruning effect, that strips any model_parameters key no longer present in the currently-visible parameters list. Also fixed a pre-existing test regression (missing useGetStartupConfig mock) and added two tests covering pruning-on-drop and value retention when the control stays visible. * fix: Preserve parameters for unknown agent providers * fix: Sanitize agent parameters on submission * fix: Preserve agent model overrides during pruning --------- Co-authored-by: Marc Amick <MarcAmick@jhu.edu> Co-authored-by: MarcAmick <5194465+MarcAmick@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> |
||
|
|
d07527ff93
|
style(insights): give panels their own surface in dark mode (#15552)
* style(insights): give panels the Click UI chartWidget surface in dark mode In dark mode the panels drew the shared `surface-primary` (#0d0d0d) against a page of the same colour, so the cards read as one flat sheet with only a faint border separating them. Click UI treats a dashboard widget as its own surface, a step lighter than the page behind it. Add the `dashboards.chartWidget` surface and stroke as theme tokens and apply them to the Insights panels under `dark:` only, so light mode keeps the shared surface/border tokens untouched: dark #282828 surface / #323232 stroke light #ffffff surface / #e6e7e9 stroke (defined for completeness; unused) `Panel` is local to InsightsView, so this cannot leak into other pages -- all six panels (the four KPI tiles, both user tables, the conversation list, and the loading/error cards) pick it up from the one definition. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix(theme): register muted text role * fix(theme): register chart widget colors --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Ravi Kumar L <ravi.lazar@clickhouse.com> |
||
|
|
d21bffa4c6
|
fix(insights): stop the KPI grid orphaning a card on its own row (#15553)
* fix(insights): stop the KPI grid orphaning a card on its own row `repeat(auto-fit, minmax(min(100%, 220px), 1fr))` packs as many 220px tracks as will fit, so every width between three and four tracks rendered three cards in the top row and left the fourth alone underneath. Four tiles divide evenly by two and by four, so those are the only counts that leave no hole. Pin the grid to two columns, widening to four at `xl`. Viewport breakpoints are sound here because `UnifiedSidebar` forces the panel collapsed on the Insights route (`panelExpanded = expanded && !isInsightsRoute`), so the content width is a fixed function of the viewport: `vw - 52 - 64`. At the `xl` boundary that leaves 1164px, or 282px per tile. Swept 640/768/900/1024/1100/1279/1280/1440/1600/1920/2560: every width renders either 4x1 or 2x2, never 3+1. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix(insights): restore mobile KPI column --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Ravi Kumar L <ravi.lazar@clickhouse.com> |
||
|
|
2656f44c03
|
style(insights): use Click UI muted token for KPI labels and 32/12 page spacing (#15551)
The KPI tile labels were 18px (`text-lg`) in `text-secondary`. Click UI sizes a muted label at `400 0.875rem/1.5` -- 14px -- so the label now uses `text-sm` with a matching muted colour. None of the existing text tokens carried Click UI's muted value: `text-secondary` (#424242) and `text-tertiary` (#595959) are both darker and warmer than Click UI's #696e79. Rather than hardcode a hex in the component, add `--text-muted` alongside the other text tokens in all four theme blocks and register it in `createTailwindColors`, so it themes and takes opacity modifiers like its neighbours: light #696e79 (Click UI global.color.text.muted / bigStat.color.label.muted) dark #b3b6bd The content column also drops its responsive padding ramp for a flat 32px on left/top/right and a 12px row gap, matching the 12px the inner grids already used so horizontal and vertical spacing agree. Bottom padding is left at 16px. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|
|
e795f0ca3b
|
🏕️ feat: Provision Native Code Workers (#15587)
* 🧭 feat: Guide Native BYOM Worker Setup
* fix(code): harden worker onboarding options
* test(code): align native worker onboarding checks
|
||
|
|
10c5c91594
|
🎨 feat: Theme-Adaptive SVG Support for Custom MCP and Group Icons (#13817)
* feat: theme-adaptive SVG support for custom MCP and group icons Custom icons (MCP server iconPath, model spec groupIcon) were rendered as plain <img>, so monochrome SVGs kept fixed dark colors and were nearly invisible in dark theme. Introduce a shared CustomIcon component that detects monochrome SVG glyphs and tints them with currentColor so they follow the active theme, while multi-color SVG logos and raster images keep their original colors. The monochrome decision parses the SVG's color tokens; content is fetched once, cached, and any failure falls back to the original image. Monochrome SVGs render via CSS mask, never inlined, so no SVG markup reaches the DOM. Apply across all custom-icon surfaces: MCP settings cards, the chat MCP dropdown, stacked MCP icons, tool-call headers, and model group icons. Also support SVG in the MCP avatar uploader: add SVG to the accepted file types and sanitize uploaded SVGs with DOMPurify before storing them, and make the dialog preview theme-adaptive via the same component. Add unit tests for SVG detection, monochrome analysis, sanitization, and CustomIcon rendering. * fix: reset adaptive icon tint state when the source changes A reused CustomIcon instance kept the monochrome verdict from a previous source until its effect re-ran, so switching to a raster image or a new multi-color SVG could briefly render it as a currentColor silhouette. Key the resolved verdict to the current source and reset it synchronously during render (seeding from cache when available), so a stale verdict can never tint a different icon. Add hook tests covering the source change. * fix: do not tint custom SVGs that have an opaque background A grayscale SVG with an opaque full-canvas background (for example an exported logo with a white background rect and a black glyph) passed the monochrome check and was drawn through a CSS mask. Masks key off the alpha channel, so the opaque background filled the whole area with the tint color and the icon collapsed into a solid block. Detect a full-canvas opaque background rect and exclude such SVGs from tinting, rendering them with their own colors instead. Transparent single-color and multi-shade glyphs remain tintable. Add tests for the background cases. * fix: detect opaque SVG backgrounds without a viewBox Opaque background detection only read canvas dimensions from the viewBox, so an SVG that declares width and height on the root element but omits the viewBox slipped through and was tinted into a solid block. Fall back to the root svg width and height when no viewBox is present, and match attribute names exactly so stroke-width is not mistaken for the canvas width. Add tests for the no-viewBox cases. * fix: parse comma-separated SVG viewBox values The viewBox regex only accepted whitespace between values, so a valid viewBox like "0,0,24,24" failed to parse and an opaque background went undetected, tinting the icon into a solid block. Accept commas and whitespace as separators. Add a test for the comma-separated case. * refactor: detect SVG tintability with DOMParser instead of regexes The monochrome/tintable decision scraped SVG markup with regexes, which kept missing edge cases (opaque backgrounds, missing or comma-separated viewBox, stroke-width vs canvas width, embedded raster images). Parse the SVG once with DOMParser and inspect real elements and attributes: reject embedded <image>/<foreignObject> content, detect a full-canvas opaque background rect, read the canvas size from the viewBox or root width/height, and gather paint colors from attributes, inline styles, and <style> blocks. Unparseable input is treated as not tintable. Tests cover these cases. * fix: only tint single-tone grayscale SVGs A grayscale SVG can draw its background as a full-canvas path (not just a rect), e.g. a white background path plus a black glyph. The rect-only background check missed that, and the icon flattened to a solid currentColor block under the CSS mask. Tint only when the SVG resolves to a single grayscale tone. Any second tone (a background shape drawn as a path or rect, an accent, or a second shade) now preserves the icon's own colors, which covers full-canvas path backgrounds without per-shape geometry parsing. * fix: count default black fill when detecting tintable SVGs * fix: treat currentColor as a tone and stroked closed shapes as filled * fix: ignore non-rendering template paint and count filled open paths * fix: scan defs and symbol paint rendered through use references * fix: resolve currentColor against fixed color and match style fills for default paint * fix: treat alpha-zero fills as transparent in SVG tint detection * fix: resolve inherited and CSS fill for backgrounds and default paint * fix: resolve CSS currentColor and default-black use instances * fix: count default-filled polylines when detecting tintable SVGs * fix: resolve inherited fill and style/CSS opacity in SVG tint detection * fix: ignore display:none shapes and stop counting CSS color as paint * fix: only count CSS paints that match rendered elements * fix: match root for CSS currentColor and skip unreferenced defs tones * fix: count paint only on rendered shapes and filter hidden CSS currentColor * fix: resolve use-instance currentColor and skip hidden use default fills * fix: resolve CSS paints onto rendered painters and skip overridden use fills * fix: keep checking ancestor opacity after resolving paint opacity * fix: resolve CSS paints by specificity and skip transparent default fills * fix: apply CSS over presentation attributes and follow nested use targets * fix: strip CSS comments, honor visibility, and inherit paint through nested use * fix: skip transparent svg use references * Account for SVG filter colors * fix: propagate outer use color through nested currentColor references * fix: preserve url() id casing and record every nested use chain * fix: preserve SVGs whose filters recolor the source * refactor: detect monochrome icons via canvas pixel sampling Replace the SVG source parser with offscreen-canvas pixel sampling: draw the icon, read pixel data, and treat it as monochrome only when every non-transparent pixel is grayscale within tolerance and the image has some transparency (a fully opaque image would mask to a solid block). Verdicts are cached per src. An explicit monochrome flag on CustomIcon skips detection; sampling is the fallback. Image load failures and canvas taint from non-CORS cross-origin icons fall back to untinted rendering instead of throwing. * harden custom SVG icon handling across security, a11y, and perf Sanitize user-provided MCP iconPath server-side; the client-side DOMPurify pass was bypassable by posting iconPath straight to the API. Adds sanitizeMcpIconPath in @librechat/api (allowlist SVG sanitizer that preserves case-sensitive names) and runs it in the create/update controllers, plus a length cap on iconPath in the shared schema. - gate theme detection to same-origin/data sources so a remote icon is no longer auto-fetched from every viewer's browser - restore forced-colors (High Contrast) visibility and the broken-icon onError fallback for tinted icons - mark redundant icons decorative to avoid screen-reader double reads - base64-encode inlined SVG data URIs and bound the verdict cache - harden the client SVG sanitizer and guard FileReader failures - cover the tinted render branch, sanitizer allowlist, and edge cases * fix: preserve local SVG references while stripping external hrefs The hardened sanitizers dropped <use> and every href outright, blanking self-contained exporter output like <defs><path id="p"/></defs> <use href="#p"/> and gradients inheriting stops via href="#g". Re-allow <use> and href/xlink:href on both sanitizers, restricted to same-document fragments: the client uses a dedicated DOMPurify instance with an afterSanitizeAttributes hook (kept off the shared default instance), and the server mirrors the rule with a sanitize-html tag transform plus an empty allowedSchemes list as a second layer. External, protocol-relative, relative-path, and javascript: hrefs are still stripped, leaving the element inert. * fix: keep xlink namespace and safe filters in the server icon sanitizer The server allowlist stripped xmlns:xlink from the root while keeping xlink:href, leaving an unbound prefix that is a parse error once the icon is stored as an image/svg+xml data URI, so SVG 1.1 exporter output went blank after save. It also dropped <filter>/fe* primitives that the client sanitizer's svgFilters profile allows, so icons relying on effects like feDropShadow lost them between preview and reload. Allow xmlns:xlink and mirror the client's filter allowlist (elements plus their presentation attributes); feImage passes through the existing fragment-only href transform, so external references are still stripped. * fix: require empty pixels for tinting and block external url() references Two issues from review of the icon sanitizer and monochrome detector: - scanMonochrome flagged any pixel below full opacity as transparency, so an SVG that fills the whole canvas with a semi-transparent grayscale wash was tinted and rendered as a solid currentColor block. Require a genuinely empty pixel (alpha at or below the paint threshold) instead. - The fragment-only reference rule only covered href/xlink:href, so a url() in filter/fill/mask/clip-path/style kept external targets like filter="url(https://evil/f.svg#f)". Both sanitizers now strip any attribute carrying a non-fragment url(), preserving local url(#id). * fix: preserve internal SVG stylesheets while scrubbing their references Exporter SVGs that store multi-color paint in an internal <style> block (e.g. .red{fill:#e00} with class="red") lost all styling because the sanitizers dropped <style> outright, so multi-color logos rendered with default paints after upload. Re-allow <style> on both sanitizers and scrub its CSS: strip comments and @import at-rules and rewrite any non-fragment url() to none, keeping local url(#id) paints. These icons only render in inert <img>/CSS-mask contexts isolated from the host page (no script, and no subresource loads once external refs are scrubbed), so a script-free stylesheet is safe to keep; a premature </style> close still has its trailing markup re-sanitized by the parser. * fix: normalize icon value before deciding it is not an SVG data URI A posted iconPath with leading whitespace or C0 controls (e.g. "\n data:image/svg+xml,...") slipped past the anchored data-URI check, so sanitizeMcpIconPath returned it raw while a browser trims the prefix and still renders the SVG, keeping its external <image>/url() and other stripped content. Normalize the value the way URL parsing does, trimming leading/trailing C0 controls and spaces and removing embedded tab/newline, before the SVG check so these variants are sanitized too. * fix: cap sanitized icon length and re-encode as compact base64 The schema length check ran on the input, but sanitizeMcpIconPath then re-encoded the markup with encodeURIComponent, which expands SVG by well over the base64 input size (a 235KB base64 icon became a 374KB percent string). create stored that over-limit value, and editing the server resubmitted the prefilled value and failed MCPServerUserInputSchema. Re-encode the sanitized SVG as base64 (far more compact for angle-heavy markup, which sanitizing can itself grow via explicit close tags) and drop anything still over MAX_MCP_ICON_PATH_LENGTH, so a stored icon can never exceed the cap that a later edit re-validates against. * fix: resolve CSS escapes before stripping external SVG references A literal url(/@import matcher missed CSS-escaped references: a value like style="fill:u\72l(https://attacker/x)" or an escaped @import survived sanitization because the browser un-escapes \72 to r at tokenization time while the regex never saw a url(...). The external reference was then persisted and served to other clients. Un-escape CSS the way a browser does (single pass over \hex and \char escapes) before the url()/@import matchers run, on both the client and server sanitizers. Also scrub the multi-declaration style attribute in place instead of dropping it, so co-located local paint rules survive while escaped external references are neutralized. * fix: re-sanitize after scrubbing style blocks to block markup reintroduction scrubStyleBlocks runs after sanitizeHtml and splices un-escaped CSS back as raw markup, so an escaped sequence like \3c/style\3e\3cimage/\3e (inert text during the first pass) became a real </style><image href> element after unescaping, past the allowlist. Re-run the allowlist over the scrubbed result whenever a <style> block was rewritten, stripping any element the un-escaping surfaced while leaving legit local rules intact. The client sanitizer is unaffected: it sets the scrubbed CSS as a DOM text node, which serializes with < and > escaped, so no element is reintroduced. Added a regression test pinning that behavior too. * fix: make forced-colors icon tint override the inline background color The forced-colors rule for .custom-icon-tint had no !important, so it lost the cascade to the element's inline `background-color: currentColor` and the masked glyph still blanked out in Windows High Contrast — the exact regression the rule was meant to prevent. Verified in a real forced-colors render: without !important the tinted icon is invisible; with it the glyph paints in CanvasText and stays visible. * fix: enforce icon length cap in the sanitizer, not the schema The schema `.max()` on iconPath rejected the whole update at parse time. A server whose stored icon predates the cap (previous versions allowed large data-URI images) re-submits that value from the edit dialog, so the user was locked out of changing any field or clearing the bad icon. Drop the schema `.max()` and enforce MAX_MCP_ICON_PATH_LENGTH in sanitizeMcpIconPath for every value type: an over-cap SVG is compacted or dropped, an over-cap raster/URL is dropped. Editing a server with a pre-existing oversized icon now succeeds and clears the icon instead of failing validation. * fix: decode XML entities and parse quoted URLs in SVG CSS scrubbing Two more bypasses of the CSS reference scrubber, both live once the stored image/svg+xml is parsed by a viewer: - A <style> block reaches the scrubber as raw text, so an entity-encoded reference like @import (or @import) was never seen as @import; the browser decodes it at render time. Decode XML character references (numeric + the five predefined named) before the matchers run. - The url() regex excluded ')' even inside quotes, so a valid quoted URL like url("https://x/a)b") slipped through. Parse quoted and unquoted URL tokens separately so a ')' inside quotes stays part of the target. Applied to both the server (sanitizeMcpIconPath) and client (sanitizeSvg) scrubbers. Entity decoding also catches an entity-encoded </style> markup breakout, which the re-sanitize pass then strips. * fix: close custom icon review threads * fix: transpile sanitize-html's ESM dependency chain in api jest runs * fix: preserve marker definitions and fragment-only marker references * fix: keep object-cover sizing when tinting masked icons * fix: preserve textPath labels and currentColor color scopes in icon sanitizer * fix: preserve pattern coordinate-system attributes in icon sanitizer Keep patternUnits, patternContentUnits, and patternTransform so patterned SVGs do not fall back to objectBoundingBox after server-side sanitize. * refactor: sanitize icons with one shared DOMPurify policy The server re-implemented DOMPurify's SVG profiles as two hand-written sanitize-html allowlists, so every element and attribute the client kept had to be transcribed by hand, and each miss surfaced as an icon that previewed correctly and then lost its markers, patterns, filters, or xlink binding once stored. Run DOMPurify on jsdom instead and share the config and reference hook with the client, which drops both allowlists. Restrict url() values to same-document fragments on every attribute rather than on the marker properties alone, so external references in fill, stroke, filter, mask, and clip-path are stripped as well. Restore feDropShadow casing after sanitizing. DOMPurify has to parse as HTML, its XML mode drops filter primitives and gradients, and the HTML tag-name adjustment table predates that primitive, so it survived lowercased and left its filter empty once the stored icon was re-parsed as image/svg+xml. * fix: defer jsdom load until MCP icon sanitization jsdom and dompurify were imported at module scope, so every require('@librechat/api') paid their startup cost. Load them on first SVG sanitize instead. * fix: sort type import in MCP icon sanitizer The static-check import sorter wants value imports before type-only imports. Moving the DOMPurify type import after librechat-data-provider clears the drift. * fix: address PR review bot findings chatgpt-codex-connector: - Resolve icon URLs through new URL() instead of trusting a leading slash, so /\attacker.example/icon.svg is no longer treated as same-origin - Check every url() token in an SVG attribute rather than only the first, and reject values carrying a CSS escape that would decode into one - Forbid animateTransform, animateMotion, animateColor, and mpath, which the SVG profile admitted despite the policy intending to remove animation - Preserve the radial-gradient fr attribute the profile omits - Reject multi-tone grayscale in scanMonochrome, which a mask would flatten - Sample at 128px so a small chromatic accent is not averaged away - Settle a stalled icon load after 10s so its in-flight entry is released - Bound the decoded SVG before building a jsdom tree for it - Reject an oversized icon upload with a visible error instead of accepting it and silently clearing it on save * fix: address Codex findings and trim icon sanitizer comments - Bound icon files by size before reading or sanitizing them - Track tone spread across every painted pixel, not only solid ones - Settle monochrome detection on any sampling throw - Use named DOMPurify/JSDOM types and shorten PR comments * fix: percent-decode SVG data URI bodies before base64 decoding * fix: declare the SVG namespace on sanitized icons and keep icon rejections out of form validity |
||
|
|
b76b02062a
|
🔬 test: Make the Paste Action's Hover-Gate Guard Actually Guard (#15589)
* 🔬 test: Make the Paste Action's Hover-Gate Guard Actually Guard Review follow-up to #15588, and a correction: the guard it shipped could not fail against the markup it exists to reject. Two independent reasons, each enough on its own. `toHaveTextContent` is a SUBSTRING match. #15588 adopted it over exact `textContent` equality to shed whitespace brittleness and, in doing so, dropped the only assertion in this test that was catching anything. The swap kept both labels mounted and hid one in CSS, so the control read "PlainMove back into message" — which a substring match accepts. Anchored now, which keeps the whitespace normalisation that motivated the change. The token sweep read `control.className`. The gate lived on the child spans and never on the button, so it was scanning an element that never carried what it was looking for. It sweeps the control's subtree now. Verified by restoring the pre-#15586 component and re-running: the guard fails against it, where both of the shipped forms passed. * 🧪 test: State the Hover-Gate Invariant Instead of Listing Its Spellings Codex P2 on the previous commit: the sweep named `group-hover`, `group-focus-within` and `[@media(hover:none)]` — the three spellings this bug happened to use — so the next spelling of the same idea walks past it. `invisible hover:visible` on the control, or `hidden focus:block` on a descendant, leaves the label absent at rest with the anchored text still matching, because in jsdom the text is mounted either way. Replaced with the rule the list was standing in for. A Tailwind token is `variant:utility`; the utility is what follows the last colon, which holds for bracketed variants too. Both halves of a gate are then rejectable on meaning rather than on spelling: no utility may hide the label at rest, and no utility under a hover or focus variant may reveal or hide it. Colour under those variants stays permitted — that parity is asserted separately, and banning `hover:` wholesale would contradict it. Verified against all three spellings by patching the component: the historical two-span swap, a direct gate on the control, and a direct gate on a descendant. Each fails the guard. * 🔭 test: Narrow the Hover-Gate Guard to What jsdom Can Decide Codex found four ways past the previous commit's sweep, and two ways it misfired. Bypasses: `text-transparent hover:text-text-secondary`, `opacity-[0]`, Tailwind 3's `!hidden`, and a gate moved onto an ANCESTOR, which the traversal never looked at. Misfires: `hover:inline-flex` is layout, not concealment, and would be rejected; and a classed SVG descendant returns an `SVGAnimatedString` from `.className`, so the sweep would throw before asserting anything. Failing in both directions at once is the signal that the approach was wrong rather than incomplete. Deciding whether a mounted node is visually hidden needs a cascade, and jsdom loads no stylesheet — so every version of this was a denylist wearing the language of an invariant, and a fourth would have invited a fifth bypass. Narrowed to the half that holds: the control's text is exactly the label, which catches the swap that actually shipped, since it kept both labels mounted and the control read "PlainMove back into message". The unobservable half is written down as unobservable, with a pointer at where a real assertion belongs — `toBeVisible()` in a browser, which `e2e/` has no composer-paste spec for. |
||
|
|
bd83da552d
|
👓 fix: Match Pasted Text Focus Feedback (#15588)
Review follow-up. The label's colour shift answered the pointer only. The focus ring already announces focus, so this is parity rather than a missing indicator — but two input modes getting different feedback for the same state was a difference with nothing behind it. The hover-gate guard keeps asserting class tokens, brittle as that is. jsdom loads no stylesheet, so a hover gate has no effect on the DOM under test and a presence check cannot see one: the swap this replaced kept both labels mounted, which is why the spec it replaced asserted both were in the document at once. Recorded the reasoning where the next reader will meet it. |
||
|
|
374ed8df14
|
🧶 fix: Render Solo Agent Groups as Sequential Content (#15574)
* 🛤️ fix: Render a Single-Agent Group as Sequential Content A multi-agent graph assigns a parallel group id to every starting node (`MultiAgentGraph.computeParallelCapability`), so an ordinary agent that merely has other agents loaded carries a `groupId` on its OWN run steps and on every content part built from them. `groupId` is not evidence of parallel execution. The client treated `groupId != null` as parallel content in four places, so an ordinary turn: - rendered inside a `SiblingHeader` lane box, restating the message's own sender and adding a redundant branch control - lost tool grouping, activity-label headers and client-synthesized phase folds, because lanes render raw parts - widened the message row for columns that never arrive - rendered the one group repeatedly when phase markers split it, since each segment runs its own `ParallelContentRenderer` `~/utils/lanes.ts` adds `hasParallelLanes` / `MIN_PARALLEL_LANES`: a group backed by one agent is not a comparison, so it renders exactly like content with no group id at all. `groupParallelContent` demotes such a group into the sequential flow, and `ContentParts`, `useContentMetadata`, `MultiMessage` and `groupActivityPhases`'s `foldable` all ask the shared predicate. Fixing it client-side repairs persisted history too. Two adjacent bugs the demotion exposed in `ParallelContentRenderer`: a sequential part landing between the lanes' first and last index was dropped from the message entirely, and a section holding only placeholders rendered every part twice. Five existing fixtures asserted the parallel path with a single agent (some with a string `groupId` that never matched `groupId?: number`); they now carry a second agent so they keep testing lanes. * 🧹 refactor: Narrow the Lane Part Instead of Asserting Its Shape `TMessageContentParts` already carries `agentId`, so the assertion was only standing in for the undefined check the optional chain now does. * 🧵 fix: Keep Lane Identity and Transcript Order Across Sections Two P2s from review, both about content that a lane group does not own. **Lane cardinality belongs to the message, not the slice.** A completed server phase marker partitions the transcript, and `renderSegment` hands each slice to its own `ContentPartsBody`. A slice can hold one agent of a genuine two-agent group while its sibling slice holds the other, so counting agents locally demoted both and dropped the `SiblingHeader` that told the reader which agent produced which answer. `parallelLaneGroups` resolves the group ids once over the whole message; every slice and `groupParallelContent` now ask that verdict instead of recounting. **Sequential content between two sections rendered after both.** The before/after split was global: with group 1, an ordinary part, then group 2, the part fell into `after` and the transcript read group 1, group 2, part. Sequential parts are now laid out around EACH section, so the part renders in place. A part landing inside a section's own index range still falls to the next block — it has no column and no slot inside one, which is the tradeoff the earlier `>= minParallelIdx` bound already made to stop dropping it entirely. * 🔢 fix: Count Only Attributed Lanes, and Scan for Them Once Round 2 of review, two findings. **An unattributed part is not a second agent.** `agentId` and `groupId` are independently optional on a run step — `getStepMetadata` builds both from whatever the step carries and the writer sets each only when present — so a group can hold a part the server never attributed. It shares the `unknown` sentinel column, and counting that sentinel let one agent plus one metadata-less part pass the two-lane threshold, leaving exactly the single-agent turn this branch exists to demote in the parallel UI. `attributedLaneCount` discounts the sentinel, `groupParallelContent` counts claimed columns the same way, and the sentinel is now one exported constant instead of a literal on each side. **One lane scan per render, not two.** `groupActivityPhases` was scanning the whole message for lanes to decide `foldable` while `ContentParts` was scanning it again for `parallelLaneGroups`, on a path that re-runs for every streamed delta. The scan is now computed once and handed down; a set built from the same content answers `foldable` by its size. * 🧮 fix: Ignore Handoff Markers in Lanes, and Scan a Message Once Round 3 of review, two findings. **A handoff marker is not a second lane.** `useStepHandler` stamps an `AGENT_UPDATE` part with `{ agentId: <destination>, groupId: 1 }` even though the destination's own run steps carry no group id, so a single-lane graph that later hands off held two agent ids in one group: the run's output became one column and the marker became the other, at the exact point the handoff happened. `isLaneMarkerPart` keeps a marker from claiming a lane, and `groupParallelContent` mirrors it — a column claims its lane only when it holds output, except a placeholder column, which claims with no parts at all so a dual run shows both agents from the first render. **One scan per message, not three.** `MultiMessage`, `useContentMetadata` and `ContentParts` each traverse the same array in a single render pass, allocating a map and a set per call, and `content` is rebuilt on every streamed delta. `laneAgentsByGroup` now memoizes on the content array itself: the three callers collapse to one traversal, and the cache is exactly as fresh as the render, since a delta that kept the array identity would not re-render either. Entries die with the array that keys them. |
||
|
|
fde46a62f9
|
🔙 refactor: Keep Pasted Text Return Action Visible (#15586)
The chip generated from a long paste offers returning its text to the composer on the subtitle line, but the label only swapped in on `group-hover` / `group-focus-within`. At rest the chip read as an inert "Plain Text" subtitle, so the affordance went unfound — and touch devices have no pointer to find it with, which the `[@media(hover:none)]` override was already conceding. The label is now the subtitle: stated at rest, underlined so a permanent line of secondary text reads as a control rather than as a caption. The `aria-label` that shadowed the visible text goes with the swap it existed for, leaving the accessible name equal to what the label says. |
||
|
|
bd31ecd129
|
✨ feat: add morphing state icons across the client (#14697)
* feat(client-ui): add morphing icon support * feat(client-ui): morph shared state icons * feat(chat-ui): morph chat action icons * feat(client-ui): morph remaining action icons * fix(client-ui): type morph icon test factory * test(client): type agent detail fixture * test(client-ui): guard morph icon accessibility defaults * test(chat-ui): assert mermaid view toggle via morph icon * style(chat-ui): sort mermaid header imports * test(api): wait for rebuilt MCP session to finish connecting The SSE conflict recovery test treated a new session id as a finished reconnect. initialize assigns that id before connectClient emits connected, so isConnected() can still be false. Wait for a live connection on the rebuilt session instead. * fix(client): clean up rebase fallout |
||
|
|
f0dfeed2b0
|
🐝 fix: Keep Polling for Owed Agent Successors (#15537)
* 🎯 fix: Ask Because a Successor Is Owed, Not Because One Might Be The handover window guessed at how long admission takes. For a queued turn it never had to: the backend reports the turn as `queued` or `claimed`, which is positive evidence that a run is coming and that this client will not be the one to start it. Declare that outright and keep the active-job list live for exactly as long as it holds. Read from the server's receipts rather than the chip projection, so admission semantics stay in one place — `shouldPollAgentQueuedTurns`, shared with the queue itself — instead of being restated here and drifting. `useSteering` owns that fetch; subscribing with `enabled: false` observes its cache without competing for it, and an unpopulated cache falls back to the window. It also keeps this off Recoil, which the client is migrating away from. The window stays for successors nothing local predicts — a background-tool continuation has no receipt to report itself — and is now documented as the fallback rather than the mechanism. * 🔗 fix: Carry the Owed Successor Across the Receipt Handover Codex found the gap in the deterministic path: the receipt that announces a queued turn reports `admitted` for one fetch at most and is then dropped from the projection — before the active-job list has necessarily observed the run it started. If admission outlasted the handover window, the wall-clock fallback was already spent, and a pane keyed on the receipt alone stopped listening in exactly the window that mattered. Two structural changes, so this is not another edge patched. Owed is held, not read. Once a successor is known to be owed it stays owed until it is delivered — this pane attaches, or the list names the conversation. A bounded expiry backstops the case where neither ever happens, and it starts only once the receipt has gone quiet, so a long wait behind an unadmitted turn does not burn the window before the handover begins. `admitted` now counts as owed: the receipt poll stops there because nothing is left to wait for, but an unattached pane is in the opposite position, and it is the strongest evidence that pane will get. The receipt arms on its own. The arm had one announcement source, the list, which can miss a run that starts and finishes between two polls. An owed turn is a second source, and the status read the arm enables is the authoritative answer either way: active attaches, inactive means the history refetch the arm already performs is the repair. Neither source has to wait on the other. * 🧹 chore: Sort Imports in useResumeOnLoad * 🧭 fix: Deliver an Owed Successor Only When the Successor Itself Is Seen Codex: the latch treated the pane's own live attachment as delivery of the owed successor. But the successor is usually announced while its predecessor is still attached — the turn was queued behind it — so the latch was cleared, or never recorded, in exactly the window it exists for. Once that predecessor closed and the receipt was dropped, a successor that started and finished between two list polls was never seen. Remember which generation was live when the turn became owed. Delivery is then attachment to a different generation, or the list naming the conversation while nothing of ours is live. The predecessor no longer counts. Each half is proved against its own defect: reverting to the old predicate fails the predecessor-attached case; dropping the generation-aware attach fails the different-epoch case; and forgetting which generation was the predecessor livelocks — the latch is set, "delivered" by the very generation it should have excluded, cleared, and set again. * 🧷 fix: Judge Successor Delivery by Generation, Re-Arm on Transitions, Expire Off-Screen Three codex findings on the owed-successor latch, each a way the latch could be cleared, never recorded, or held too long. Delivery by generation only. The active-job list carries no generation identity, so "the conversation is listed" was satisfying delivery while the listed run was the predecessor — running elsewhere, unattached here — and the latch was never recorded. The receipt knows the predecessor better than this pane does: `expectedPredecessorCreatedAt` is stamped from the live epoch at enqueue and `effectivePredecessorCreatedAt` is the boundary admission actually consumed. Delivery is now attachment to a generation other than that boundary; a turn still owed cannot have started, so a generation live when it is first seen is its predecessor and refines the boundary rather than delivering. Re-arm on transitions, not heartbeats. A `queued` receipt is refetched every two seconds during a long wait and advances `dataUpdatedAt` without changing, and the arm was keyed on that stamp — after the throttle it invalidated status and history again and again while nothing had happened. It now keys on a signature of receipt ids and statuses, and refetches history only when a run is listed or the receipts actually transitioned. Expire on an absolute window, off-screen too. The expiry effect skipped when the latched conversation was not the one on screen, so navigating away held the latch indefinitely and returning later reopened a fresh window. The window now starts from `quietSince` — set when the receipt stops reporting or the conversation leaves the screen — and is never pushed back by a remount. Each change is proved against its own defect: re-adding list-based delivery fails the listed-predecessor case; removing the transition gate fails the heartbeat case; skipping expiry off-screen fails the absolute-window case; and forgetting to learn a live predecessor livelocks the latch. * 🧽 test: Restore the Admin Allowlist Override This Spec Leaks Into the Shard The spec writes a per-user `mcpSettings.allowedDomains` override for the shared primary user and never removes it. The list holds only its own fixture's origin, and allowlist matching is protocol- and port-inclusive, so for the rest of the shard every other MCP fixture is blocked: `e2e-oauth` fails inspection, and an agent expecting its tools initializes into AGENT_EXPECTED_MCP_TOOLS_UNAVAILABLE (503) instead of producing its OAuth prompt. Whether that bites depends only on which specs the shard runs afterwards, so it surfaces as a deterministic failure in an unrelated spec — `mcp-oauth-resume` failing an assertion that fires before any resume happens — which passes whenever it runs first. A client-only PR whose path selection reordered the shard hit it three times across two heads. Delete the override in a `finally`, and confirm against the stored config rather than by re-running `reinitialize`: the connection this test established stays live, so reinitialize keeps succeeding once the allowlist is gone. * 🩹 test: Read the Config Wrapper and Treat 404 as Cleared in the Override Teardown `GET /api/admin/config/:principalType/:principalId` returns `{ config }`, and deleting the last override removes the document, so the follow-up read is a 404 — the cleared state, not a read failure. The poll treated both as unreadable and timed out. * 🧷 fix: Remember Delivered Receipts, Restart the Grace on Delivery, Gate Reopening on Newer Data Three more codex findings on the owed-successor latch. Delivered receipts are remembered. An `admitted` receipt stays in the cache for a fetch after the successor attaches, and it still counts as owed — so the latch cleared on attachment and was re-recorded from the same receipt on the next render, synchronously, until the cache moved on. That is React's maximum-update-depth failure, reachable in the ordinary queued-turn handoff. The receipt signature that delivered is recorded, and a receipt set with that signature neither latches nor counts as owing a run; a genuinely new turn can. Delivery restarts the fallback grace. The list may never have seen the run a queued turn produced — it can start and finish between two polls — so its own "recently active" clock is stale, and clearing the latch would have removed the only reason left to poll. An unpredicted continuation after that run (a background-tool dispatch finishing) would then go unnoticed until a focus or reload. Observing the successor live now restarts the handover window. The window reopens only on newer evidence. Returning to a conversation first exposes the receipt cached before the turn went quiet, while the authoritative refetch is still in flight; treating that as "still reporting" reset the start of an expiry meant to be absolute, so repeated navigation could extend it indefinitely. Only a server observation newer than the window's start counts, for reopening and for the reporting check alike. Each is proved against its defect: forgetting delivered receipts livelocks the handoff test; skipping the grace restart fails its assertion; reopening on any report fails the stale-remount case. * 🧷 fix: Track Delivery Per Turn, Ratchet the Boundary, Keep One Latch Per Conversation Three more codex findings on the owed-successor latch, plus a bug the second one's regression test exposed. Delivery is tracked per queued turn. Two turns queued behind the same generation deliver one at a time; marking the whole receipt set on the first would let the still-attached first successor pass as delivery of the second. While any owed turn is still waiting, nothing is delivered at all — a waiting turn cannot have produced the live run, so that run is its predecessor. The boundary ratchets forward. A receipt can name the chain's root long after a sibling's successor became the link the turn actually waits behind, and the latch learns that link while the turn waits. Taking the receipt's boundary first would have "delivered" the second turn on its own predecessor. The predecessor is the latest link known: the max of what the receipt says, what the latch learned, and, while waiting, what is live. With no boundary known at all, a live generation is not delivery; the bounded expiry is the fallback. Latches are keyed by conversation. Navigating to a conversation that also owes a run replaced the previous one's latch, cancelling its expiry and the history repair it performs. Every latch keeps its own absolute window now, and expiry runs for all of them regardless of which conversation is on screen. The cherry-picked allowlist-override teardown is synced to its final form (see #15543): cleanup always runs, only definitive answers end its poll, and `reinitialize` is no longer used as the reverted signal. Proofs: marking the whole receipt set is indistinguishable only because the waiting rule already blocks it; forgetting to learn the live link, or letting the receipt's root outrank it, both fail the two-turn case; a single-slot latch fails the two-conversation case; delivering without a boundary fails its case. |
||
|
|
ac55b5fad4
|
🧼 fix: Clear Model Spec Fields on Configured Selections (#15544) | ||
|
|
f9f1b2fb95
|
✨ v0.8.8-rc2 (#14845)
Some checks failed
Backend Unit Tests / Codegraph select (push) Waiting to run
Backend Unit Tests / TypeScript type checks (push) Blocked by required conditions
Backend Unit Tests / Circular dependency checks (push) Waiting to run
Backend Unit Tests / Tests: api (shard 1/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 2/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 3/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: data-provider (push) Blocked by required conditions
Backend Unit Tests / Tests: data-schemas (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 1/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 2/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 3/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 4/4) (push) Blocked by required conditions
Codegraph E2E Votes / vote (full suite) (push) Waiting to run
Docker Dev Branch Images Build / publish (push) Waiting to run
Frontend Unit Tests / Codegraph select (push) Waiting to run
Frontend Unit Tests / Build packages (push) Waiting to run
Frontend Unit Tests / TypeScript type checks (client) (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/client (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 1/2) (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 2/2) (push) Blocked by required conditions
Frontend Unit Tests / Vite build verification (push) Blocked by required conditions
Publish `@librechat/client` to NPM / pack (push) Has been cancelled
Publish `librechat-data-provider` to NPM / pack (push) Has been cancelled
Publish `@librechat/data-schemas` to NPM / pack (push) Has been cancelled
Docker Dev Images Build / publish (push) Has been cancelled
Sync Helm Chart Tags / Ignore non-main push (push) Has been cancelled
Sync Helm Chart Tags / Sync chart tags (push) Has been cancelled
Publish `@librechat/client` to NPM / publish-npm (push) Has been cancelled
Publish `librechat-data-provider` to NPM / publish-npm (push) Has been cancelled
Publish `@librechat/data-schemas` to NPM / publish-npm (push) Has been cancelled
* chore: prepare v0.8.8-rc2 release * test: satisfy mongo meili static checks * test: avoid unsafe logger spy assertion * chore: refresh v0.8.8-rc2 release * test: restore mongo meili test isolation * chore: normalize v0.8.8-rc2 versions * docs: refresh v0.8.8-rc2 release surfaces |
||
|
|
1c7a172321
|
🕹️ feat: Configure BYOM Tool Permissions (#15504)
* feat: add configurable BYOM permissions * test: cover BYOM permission settings live * fix: harden BYOM permission settings * perf: reuse principals for environment discovery * chore: normalize BYOM settings style * fix: Align BYOM Discovery and Admission * fix: Harden BYOM Permission Boundaries * fix: Align BYOM Skill Approval Routing * fix: Preserve Lazy BYOM Approval Capabilities * perf: Parallelize Cached Environment Reads |
||
|
|
a20048ab2d
|
🫱 fix: Keep Polling Through Queued Run Handoffs (#15509)
Queue a message during a run — queue, not steer — and the row is server-owned: `useQueueDrain` deliberately declines the boundary (`serverOwnsBoundary`) and the backend admits the successor itself. So the client has to hear about that run through the active-job list, exactly like a background-tool continuation. It cannot. Finishing a run empties the list — the client removes its own job optimistically the moment FINAL lands — and the poll is disabled on an empty list, so it goes quiet at precisely the moment the successor is admitted. With the tab already focused there is no focus refetch either, which is why this reproduces on desktop and not only on mobile. The announcement never arrives, so the re-arm never runs and the pane sits on the previous turn until a reload. Keep asking for a bounded window after the last known job ends. The window is module-scoped rather than per-observer because this is one shared query and a component mounting mid-handover should inherit the grace, not restart it. This is the other half of the previous commits: without the re-arm the announcement lands on a pane that still reads its finished submission as an attachment, and without this the announcement never lands at all. Neither half is observable alone. |
||
|
|
29e9d08163
|
🪛 chore: Align Vite Build Config With Native ESM (#15495)
* fix: Resolve Vite build warnings * style: Sort token usage transition classes |
||
|
|
2cf1007f3c
|
🧺 feat: Preserve Partial Work at Tool Call Limits (#15486)
* feat: Handle reaching the agent tool-call limit gracefully When the graph exhausts its per-turn step budget, persist the turn as unfinished with finish_reason tool_call_limit instead of a red error. Warn the model as the budget runs low, and offer Keep going or Answer now. * docs: Add screenshots of the tool-call-limit notice Light and dark captures of the unfinished-turn card for the PR description. * style: Tighten the tool-call-limit notice card Pin dismiss to the top-right with uniform rounding, use a slightly smaller hit target, and round the card to xl. Refresh the PR screenshots. * fix: Address Copilot review findings on the step-budget path Skip empty and subagent-scoped PostToolBatch events when counting rounds. Drop the double-cast in the notice test helper and coerce the tool-call-limit finish reason in the Continue-gate spec. * fix: Address Codex review findings on budget and dismiss Pass the resolved recursion limit into the OpenAI-compatible processStream path so the step-budget hook matches the graph. Reset the notice dismiss state when the displayed message id changes. * fix: Unblock CI typecheck and import sorting Declare recursion_limit on the OpenAI service agent type, sort that file's local imports, and route the notice test context through unknown so tsc accepts the partial ChatContext fixture. * fix: Sort remaining PR imports for static checks * chore: Remove tool-call-limit notice screenshots * fix: Keep recovery actions from consuming composer drafts Pass empty file, skill, and quote overrides on Keep going and Answer now so a staged compose is not attached or drained. |
||
|
|
164f146bdf
|
🛞 feat: Manage Personal Code Environment Lifecycles (#15369)
* feat: add self-service code worker pairing * fix: enforce code worker principal boundaries * fix: separate pairing control planes from execution * fix: preserve principal worker routing * fix: pin artifact traffic to code workers * fix: authenticate code worker selection * test: mock worker-aware artifact headers * fix: harden self-service code worker routing * fix: fail closed for principal code pairing * feat: manage personal code environments * fix: harden personal code environment lifecycle * fix: satisfy backend lifecycle types * fix: harden principal environment lifecycle and quotas * fix: fence environment lifecycle races * fix: reconcile code environment stack * style: format code execution headers * fix: reconcile code environment lifecycle * fix: close self-service pairing gaps * fix: close code environment reconciliation gaps * fix: close code environment UI review findings * fix: satisfy code environment type checks * fix: route code priming to selected worker * fix: harden code environment lifecycle fences * fix: type lease renewal interval * fix: harden environment lifecycle recovery * fix: close lifecycle recovery races * fix: type compensated agent timestamps * fix: fence lifecycle cleanup by tenant and revision * fix: scope environment revision fencing |
||
|
|
aa7539909b
|
🪶 feat: Enable Standalone Skill Authoring (#15480)
* feat: enable standalone skill authoring * test: align skill e2e flow with enable toggle * fix: preserve legacy skill state on version restore |
||
|
|
5b75c79831
|
🫥 fix: Clear Hidden MCP Chat Selections (#14159)
* 🫥 fix: Clear Hidden MCP Chat Selections A server hidden with `chatMenu: false` stayed active in chat when it had been selected while still visible. The selection persists to localStorage, and the guard that clears stale selections tested the *filtered* server list — which is empty precisely when every configured server is hidden, so the guard could never fire and the selection survived every reload. Gate the prune on the unfiltered catalog instead. It is non-empty in exactly the case the old guard missed, and it stays a guard rather than a load flag so an empty catalog — still loading, or a degraded read — is never mistaken for "the admin removed everything" and used to wipe a selection irrecoverably. Clear the ephemeral agent alongside the atom: it is what carries the selection to the server, so a hidden name has to leave it too, not just the dropdown's state. Also label the dropdown badge from the servers the menu actually offers. It counted the raw selection, so a hidden server rendered as "Server Four" or "2 selected" above an empty menu — the symptom that reads as a server you cannot turn off. * 🔧 fix: Keep Spec-Assigned MCP Servers Out of the Hidden-Server Prune A model spec may deliberately assign a server the chat menu hides, and `applyModelSpecEphemeralAgent` seeds it straight into `ephemeralAgent.mcp`. The prune could not tell that apart from a stale selection, so activating such a spec dropped its server — and because the same function re-reads `LAST_MCP_` for existing conversations, the loss persisted across navigation. Exempt whatever the active spec pins. `chatMenu` hides a picker entry; it does not override an admin's spec assignment. * 🔒 fix: Confine the MCP Selection Prune to the Hook Instance That Owns It `useMCPServerManager` has seven call sites, and only `BadgeRowContext` reads the chat selection — the rest mount it for the catalog, the server actions, or the status icons. Every instance keyed to the same conversation shares one atom and one ephemeral agent, so those six were all running the prune too, and the always-mounted `useSideNavLinks` has no spec context to exempt from: it would rewrite the selection the picker's own instance was deliberately keeping. Make managing the selection opt-in, off by default at both layers, and let the badge row alone opt in. The six catalog consumers stop touching chat selection state entirely, which is what they should have been doing all along. Tests now state whether they own the selection rather than inheriting it from a default, so each one exercises the same configuration as the instance it models. * 🔁 fix: Mirror the MCP Selection Everywhere, Prune It Only in the Owner Gating the whole ephemeral-agent sync on selection ownership was too broad. The action paths — `initializeServer`'s OAuth success, the revoke handler — build their next selection from `mcpValues` and write it back through `setMCPValues`, which also rewrites the shared ephemeral agent. An unmirrored instance therefore wrote a stale list: authenticating server B could drop an existing selection of server A, leaving only B. Mirroring and pruning are separate concerns. Every instance mirrors, so each one builds on the current selection; only the owner prunes, because only it knows which servers a spec pins. |
||
|
|
6122d210da
|
🛄 fix: Reclaim Pending MCP OAuth Prompts on Resume (#15471) | ||
|
|
d83958d3b3
|
📎 fix: Keep SharePoint Picker Selections While Navigating (#15389)
The picker never set `selection.enablePersistence`, so it dropped the current selection every time the user opened another folder or switched pivot. A selection could only ever be assembled from a single location — pick three files, open another folder, and the three are gone. One option on the picker configuration; no change to what LibreChat does with the result. Fixes the selection half of #15237. Folder selection — the other half — is a new capability rather than a fix, and is parked on `feat/sharepoint-folder-selection`. |
||
|
|
537ddba6bb
|
🫴 fix: Hand Composer Focus Back After Upload Dialogs (#15469)
Typing a message, pasting an image, then pressing Enter did nothing: the composer held the full draft, the send button was enabled, and Enter was inert until the user clicked back into the textarea — which reads as "the textarea needs a text change before it will submit". The send gating was never at fault. Radix's modal `DialogContent` always cancels its default close-focus restore and focuses `context.triggerRef.current` instead. `DragDropModal` — the "Select Upload Type" dialog a paste or a drop opens — is opened programmatically and so has no `Dialog.Trigger`, leaving that ref null: nothing is focused and focus falls to `document.body` when the dialog unmounts. Enter-to-send is a keydown handler on the textarea, so from `body` it is never reached. `UploadModalProvider` now records the element the upload was started from, captured in `openModal` before the dialog mounts (an effect runs too late — Radix has already moved focus), and restores it once the dialog closes, queued behind Radix's own deferred restore. This covers every close path: picking a destination, Cancel, Escape, and dismissing the overlay. `OGDialog`'s existing `triggerRef` seam does not reach this case, since it only fires through Radix's `onOpenChange` and choosing an upload destination calls `closeModal()` directly. |
||
|
|
c3beae1e18
|
🔌 refactor: Give the Subagent Surface a Host Seam and Its Own Jotai State (#15455)
* 📐 docs: Record Who Owns Which Piece of Client State * 🔌 refactor: Give the Subagent Surface a Host Seam and Its Own Jotai State The subagent chat surface reached up into seven application atoms and could not be lifted anywhere, and the six atoms it owns were still Recoil while its sibling stores had already moved to Jotai. Feature-owned state converts to Jotai and stays where it is: the selection, per-task control receipts, live progress and the parent-stream fence. The control atom keeps its session-storage retry — restored per store rather than per family member, so a reload still sees what the last one persisted. App-global state now arrives through one `ChatSurface` value the host supplies: `enterToSend`, `maximizeChatSpace`, `showScrollButton`, the reader's composer bindings, a `claimForeground` command for the slot the panel and the artifacts panel share, and `handOffComposerText` for a continuation's unsent words. Two hosts mount the same adapter — the conversation view and the shared-link view. Opening the panel was three copies of "clear the artifacts slot, then select"; that is now `useOpenSubagentPanel`, and the three call sites say what they mean. Nothing under `Chat/Subagents/**` imports `~/store` or `recoil` any more, and its whole suite runs with no `RecoilRoot` at all. * 🧹 refactor: Move Subagent State Into the Feature and Free Its Drained Atoms Two review findings, both fair. The selection atom still lived in `~/store`, which handed the supposedly liftable surface an implicit dependency on the application store alongside its declared host interface — and contradicted the ownership rule this branch added to CLAUDE.md two commits ago. The module moves to `components/Chat/Subagents/state.ts`; the hosts that write it (the SSE step handler, the message renderers) now import from the feature, which is the direction that survives an extraction. The conversation-switch drain blanked its two atom-family members but left them cached. Every invocation key is unique, so a long-lived tab accumulated two atom configurations per subagent call it ever saw — exactly what the comment at that boundary says it exists to prevent. `removeSubagentProgressAtoms` releases them after the values are cleared, mirroring `removeUsageAtoms`. The new test fails without the release. * 🔎 fix: Let a Subagent Card Render Where There Is No Panel to Open Search results render the same card through `Part`, and that route is not beneath either chat surface — so a search hit containing a subagent tool call threw on `useChatSurface()` before it could render at all. Rendering the card and opening a panel are different requirements. The host stays required for the panel, the activity view and the event group, all of which only ever mount inside one. `useOpenSubagentPanel` reads the context optionally instead and answers `null` where there is no host, which is also the honest answer for search: there is no panel on that route to open, so the card renders with its details control disabled. The new test renders the card with no surface at all, and throws with the reported error when the hook is put back the way it was. * 🧮 fix: Enrol Read-Created Progress Atoms in the Drain Registry The read is what creates a family member, and only the streaming paths were registering their keys. A card rendering a conversation that finished streaming long ago — or a search result that never streams at all — created one the navigation drain could not see, so browsing history accumulated an atom configuration per card for the life of the tab. `useSubagentProgress` does both halves: it reads the invocation's progress and enrols its key, so every route into the family shares the one cleanup boundary. The panel and the parent card both read through it now. * 🧽 fix: Free a Read-Created Progress Atom at Its Own Card's Unmount Enrolling read-created keys in the drain registry only helps where something runs the drain, and `/search` is a standalone route that never mounts the chat event handlers. Scrolling a virtualised result list therefore kept minting members nothing would ever free. `useSubagentProgress` cleans up after itself instead: on unmount it frees the family members when the read is the only reason they exist. Two guards keep that from taking live history with it — a key the stream registered belongs to the drain, and a member holding folded activity is the record of what the child did, so reopening its card still shows it. * 🔗 fix: Free a Progress Atom Only After Its Last Reader Lets Go Opening a foreground panel before the first event gives one still-empty member two readers: the card that spawned the child and the panel showing it. Closing the panel freed it while the card was still subscribed — and a subscriber does not re-render just because its atom left the family, so the first SSE update landed on the replacement member and the card's ticker stayed dead. `useSubagentProgress` counts its mounted readers and frees only when the last one lets go, alongside the two claims that already blocked it: a key the stream registered, and a member holding folded activity. |
||
|
|
09722f4b16
|
✔️ style: Anchor the Applied Steer Receipt and Name Tool Calls in Its Interrupt Copy (#15450)
* ✔️ style: Anchor the Applied Steer Receipt at the Row's Trailing Edge * 💬 style: Say Tool Calls Are Not Interrupted Either |
||
|
|
1ff4a44b61
|
🩹 fix: Stop the Subagent Composer Unmounting, and Give It Main Chat's Shape (#15448)
* 🩹 fix: Stop the Subagent Composer Unmounting, and Give It Main Chat's Shape Measured with react-scan and a DOM presence probe against the live panel: every external delivery unmounted and remounted the composer inside 10ms, taking focus and any half-typed steer with it. - The composer stays mounted across a delivery. A delivery re-keys the thread query to its new task and the task view blanks for the render or two that takes — deliberately, so task-scoped fields are never misattributed — but presence followed it down. The last mode the thread showed now carries the surface across that gap, holding submission until the new task's own view lands. `dispatched` also counts as live, so a run that has only just started no longer withdraws the field either. - One control, not three labels. Submitting IS the steer; with nothing to send the send button becomes main chat's Stop, which cancels the task. Queue and interrupt keep the chords main chat gives them (⌘/Ctrl+Enter, ⌥/Alt+Enter) instead of spelling themselves out beside the field, and every control says what it is through its tooltip and accessible name rather than a word label. - The two composers line up. The field takes `ChatForm`'s own metrics and the footer clears the viewport floor by the height of main chat's disclaimer, so both textareas now measure top 805 / height 52 and both surfaces end at 910 in a 950px viewport. - The header is main chat's header: a 52px bar that floats over the thread and fades into it, so the conversation scrolls under it instead of starting below a solid bordered bar. Residual re-renders are the per-second timestamp and elapsed tickers plus the 2s poll both queries run while a child is live — shared with main chat, about 2ms of render time across a 14s window, and left alone. * 🎛️ fix: Bind the Chord to Its Own Submission, and Keep Queue Reachable Codex and Copilot, round one. - A refused chord no longer decides a later click. `Composer` hands the submitting event to its host, and the panel keeps the resolved control bound to THAT event — a ⌘/Ctrl or ⌥ chord the composer then refuses (empty field, settling, a command in flight) leaves nothing behind for the next pointer submission to pick up. - The control comes from the reader's own key policy, not from raw modifiers. With Enter-to-send off, ⌘/Ctrl+Enter IS the submit chord, so reading modifiers directly made steering unreachable; the verdict from `resolveComposerKeyDown` decides instead. - Queue and interrupt keep a pointer. Chords alone stranded touch readers, and anyone whose shortcuts are disabled, rebound, or yielded. They are back as icon-only controls that say what they are through their tooltip and accessible name rather than a word label. - Stop cannot render unlabelled. Handler and label travel as one value (`ComposerStopProps`), so the type refuses a Stop without a name. * 🔗 refactor: Hang the Panel's Alternate Submissions Off One Shared Send Control Queue and interrupt had no pointer, then briefly had controls of their own beside the field — which repeats what submitting already does. Main chat never did that: it hangs its during-run actions off the send button. - `SendActions` moves to `@librechat/client`: the hovercard, the rows, the chord chips and their classes, lifted out of `DuringRunSendButton` unchanged. Each host passes its own anchor whole, so main chat keeps its ref (Enter's synthetic click routes through it), its submit type, and its identifying attributes. Its 13 existing tests still cover the rows. - The panel offers steer, queue and interrupt from that same control, and advertises a chord only while it still reaches its action — each hint is read from the decision table that will execute it, so a rebound, yielded or disabled chord advertises nothing. - The send control names what IT does (`com_ui_steer_send`) as distinct from the `Steer` row it offers, exactly as main chat pairs them. Two hosts now share one implementation, which is what the seam wanted. * 🧹 chore: Sort Panel Imports and Drop an Unrelated Reorder The import sort ran before the last edits to this file. Also reverts a Tailwind class reorder `eslint --fix` made to `MultiSearch`, which this change has no business touching. * 🛡️ fix: Only Offer Controls a Dispatched Task Can Actually Take Codex, round two. - A dispatched task is controllable only once the server can address it. `control.ts` answers 404 when the task has no durable input row and no live lease, which this panel reads as an inaccessible task and closes its controls for good — so treating every dispatched task as controllable could brick them. The field still stays (withdrawing it as a run starts is the swap this panel exists to avoid); submission waits for evidence. A task whose controls are definitively closed holds nothing. - Semantic status roles replace `text-amber-500`, `text-cyan-500` and `text-red-500` in the action rows — in main chat's list too, since both now render through the same module. - One popup over the send control. With actions to offer, the tooltip is withheld: both attached to the same button, opened on the same focus, above the same point, and the tooltip's higher z-index covered the list. - Where the pointer cannot hover, the alternate submissions are controls of their own: a tap on the hovercard anchor submits, so touch readers could not reach queue or interrupt at all. * 🚪 fix: Send Every Control Through the Same Addressability Gate Codex, round three — both findings were doors around the gate added last round. - Stop and the inline actions now answer to `controlAvailable`, not just to `composerMode`. A retained surface over a dispatched task the server cannot address yet still offered Stop, and the touch-side queue and interrupt buttons were live too; each is a command, and each 404 closes this task's controls for good. - A trapped panel keeps its actions inside itself. At mobile width with a hover-capable pointer the list still hung off the send control, portaled outside the `aside` the focus trap knows — so Tab never reached it. The actions come inline whenever the panel is a modal, hover or not. |
||
|
|
283aae49b3
|
🖼️ fix: Give a Phase's Files Their Own Media Row (#15435)
Some checks failed
Backend Unit Tests / Tests: api (shard 2/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 3/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: data-provider (push) Blocked by required conditions
Backend Unit Tests / Tests: data-schemas (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 1/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 2/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 3/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 4/4) (push) Blocked by required conditions
Codegraph E2E Votes / vote (full suite) (push) Waiting to run
Docker Dev Branch Images Build / Build lc-dev (linux/amd64) (push) Waiting to run
Docker Dev Branch Images Build / Build lc-dev-api (linux/amd64) (push) Waiting to run
Docker Dev Branch Images Build / Build lc-dev (linux/arm64) (push) Waiting to run
Docker Dev Branch Images Build / Build lc-dev-api (linux/arm64) (push) Waiting to run
Docker Dev Branch Images Build / Merge manifests (lc-dev) (push) Blocked by required conditions
Docker Dev Branch Images Build / Merge manifests (lc-dev-api) (push) Blocked by required conditions
Frontend Unit Tests / Codegraph select (push) Waiting to run
Frontend Unit Tests / Build packages (push) Waiting to run
Frontend Unit Tests / TypeScript type checks (client) (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/client (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 1/2) (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 2/2) (push) Blocked by required conditions
Frontend Unit Tests / Vite build verification (push) Blocked by required conditions
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Blocked by required conditions
Docker Dev Images Build / build (Dockerfile, librechat-dev, node) (push) Waiting to run
Docker Dev Images Build / build (Dockerfile.multi, librechat-dev-api, api-build) (push) Waiting to run
Sync Helm Chart Tags / Ignore non-main push (push) Waiting to run
Sync Helm Chart Tags / Sync chart tags (push) Waiting to run
Publish `@librechat/client` to NPM / pack (push) Has been cancelled
Publish `@librechat/client` to NPM / publish-npm (push) Has been cancelled
* 🖼️ fix: Give a Phase's Files Their Own Media Row * ✂️ refactor: Drop the Inline-Media Dedup Six review rounds produced thirteen findings. The media row accounts for one and inline resolution for five, all fixed — both reason about attachments, and both converged. The dedup accounts for seven, arriving at roughly one per round (code fences, backtick spans of two widths, escapes, indented blocks, invalid title syntax, and raw HTML blocks), because it is the only part that has to know what markdown RENDERS. Each miss claimed a file nothing displayed and took it out of the row, so the standing cost of keeping it was a recurring way to hide content, in exchange for avoiding a duplicate. So it goes. `collectInlineMediaNames`, the fence tracking, the standalone image-line whitelist, and the claim wiring in `ContentParts` are deleted, along with the raw-HTML finding, which no longer has anything to apply to. Both reported problems still ship. The phase card's files ride their own row outside the fold, and a bare `` still resolves to the file the run produced. The only loss is that a chart the model inlines now appears twice — once in the row, once where the model put it — which is noise rather than a defect, and cheap next to a file that appears nowhere. What remains reasons only about attachments: which stored file a name refers to, whether that name is ambiguous, and which paths this app serves. * 🧹 style: Restore import order after the media context import shortened * 🪞 fix: Address Codex Round 7 — Latest Record and Dimension-Free Fallbacks The name map kept the FIRST record of a file while `collectPhaseAttachments` had been changed to keep the latest — the row and the inline reference disagreeing about which record of one file is current. A tool rewriting a path reuses its `file_id` and the later record carries the newer URL, so the inline reference resolved to a stale one. Both surfaces now take the latest, matching the attachment renderer. Resolution was gated on `isImageAttachment`, which additionally demands width and height. Those exist so `<Image>` can reserve layout space; a markdown `<img>` needs neither. The download fallback an oversized output produces carries an image name and a working URL and displays perfectly well, and requiring dimensions dropped it — leaving `` broken for exactly the outputs big enough to matter. The gate is now what an `<img>` actually requires: an image extension and a fetchable path. That predicate also moves INSIDE `buildAttachmentsByName`, where the contract belongs, rather than being a filter the one caller had to remember. Reusing `isImageAttachment` was the wrong kind of DRY — it answers a different question than the one asked here. * 🧬 fix: Address Codex Round 8 — Run-Step Identity and the Recovery Renderer Two of three; the artifact-panel one is deliberately left, see the PR thread. The row's dedup key omitted `stepId`, but `filterAttachmentsForPart` routes records to their owning part BY run step — so two executions that reuse a provider tool-call id and claim the same `file_id` are two artifacts, and collapsing them dropped one from the row that, once the fold hides the parts' own copies, is the only place it appears. `attachmentRenderKey` adds that dimension on top of `attachmentIdentity` rather than changing it: the merge in `useAttachments` reconciles DB rows against live records whose `stepId` may not have arrived, so it must stay tolerant of a field one side can lack. A step-less legacy row keeps the plain identity and never splits from itself. `MarkdownErrorBoundary`'s fallback renderer omitted the attachment-aware `img`, so a generated reference reverted to a page-relative URL precisely in the recovery path — where the media context still holds the file and a broken image is least welcome. |
||
|
|
d3ea6f415d
|
🐆 perf: Build Dev Branch Images on Native ARM and Cheapen Asset Brotli (#15441)
The dev-branch image build takes 20-40 minutes and has hit its 130-minute timeout. Neither cause was in the bundler. Per-step timings from run 33424998112 show QEMU is ~84% of the work: npm ci 52.6s (amd64) vs 333.2s (arm64, QEMU) — 6.3x npm run frontend 90.4s (amd64) vs 442.8s (arm64, QEMU) — 4.9x So build each platform on a runner of its own architecture, push by digest, and stitch the digests into the multi-platform manifest lists in a merge job. The tags consumers pull are unchanged. Layer caching goes to GHCR beside the image rather than `type=gha`: the Actions cache is capped at 10GB repo-wide and is branch-scoped, so `dev` and `main` runs would not share it, while a registry cache has no cap and is reusable by the other four image workflows when this pattern is rolled out to them. Separately, vite-plugin-compression2 defaults to brotli quality 11, which costs ~13s of CPU on this 18.4MB bundle against ~0.47s for gzip-9, and the plugin's scheduler serializes quality >= 10 as a high-memory operation so it cannot use the runner's cores. Quality 5 compresses in ~0.2s and still lands under gzip (4.3MB vs 5.0MB). `.br` is only served when ENABLE_STATIC_ASSET_BROTLI is set, which is off by default, so the 0.5MB the top quality buys is paid for on every build of every platform and rarely collected. The client build goes from ~11s to ~4s; gzip output is unchanged. This is a pilot on the dev-branch workflow only. dev-images, dev-staging-images, main-image-workflow and tag-images still use QEMU and still have no layer cache. |
||
|
|
bd24e45489
|
🧵 refactor: Give the Subagent Panel One Composer and Main Chat's Metrics (#15436)
* 🧵 refactor: Give the Subagent Panel One Composer and Main Chat's Metrics The panel drifted from main chat in the small measurements a reader notices side by side, and its footer swapped controls under the pointer every time a run settled. - One persistent composer. `@librechat/client` gains a `Composer`: the shared composer surface with a field, a height-holding action row, and the main chat send affordance. The panel renders it for the whole life of a run — Enter steers while the child is live, and continues the thread once it has settled — instead of replacing the input with a "Continue this chat" button at completion. Its placeholder is the main chat one (`Message {agent}`), not bespoke guidance copy. - Continuations carry the draft. Child threads are view-only server-side (`CHILD_THREAD_READ_ONLY_ERROR`), so continuing forks into a real conversation; what the reader typed rides along through the same per-conversation draft store the composer restores from, and comes back in the panel if the fork fails. - Main chat's footer metrics. Turn footers use `messageFooterClasses` and hold their height, so the elapsed timer is sized by the `text-xs` its main chat counterpart inherits rather than the panel's body size, and the reading leaving at completion no longer steps the thread. - The author column matches. Turns render `MessageIcon` unconditionally, and the streaming dot is inset onto the header icon's axis with `underHeaderIcon`, as main chat insets it. - Status indicators pin their color. Label first, dot last, so a longer status grows inboard and the color lands on one column in every row; a live row shimmers its label the way a running tool call does, and the dot no longer pulses against it. - The actor picker is the agent builder's. `ControlCombobox` with agent avatars and search, replacing a bespoke bare `Select`. * 🧷 fix: Keep Enter Off an Empty Field and Drop Dead Actor Rows - The shared `Composer` never submits an empty field on Enter. Continuing a settled thread needs no text, so its send button stays live — but a stray Enter must not navigate the reader out of the panel. - The actor picker lists only actors with a task to open. Its list has no disabled state, so a child without one was a row that silently did nothing; the selected thread stays listed regardless. - The header glyph loses its plate, like the `MessageRow` author slot, so an agent avatar reads as an avatar rather than an inset badge. The send glyph matches main chat's at 24px. * 🎚️ fix: Hand Continuation Text Over in Memory, Not Through Saved Drafts Codex review of the first pass, all three findings. - The continuation's text no longer goes through the composer draft store. Draft restoration is gated on the Save Drafts preference, so with drafts off the forked chat opened empty and the words were left sitting in local storage the reader had asked not to use. A new transient `pendingComposerTextByConvoId` carries them in memory instead, keyed by conversation so the handoff survives a navigation that resolves its record before moving the route; `useTextarea` drains it once, after the autosave restore it must not lose a race with. - The draft is read when the fork lands, not when it was requested, so anything typed while the request was in flight travels too. - Actors whose task id has not arrived are left out of the picker rather than offered as rows that cannot open anything (already in the previous commit; the filter keeps the selected thread listed regardless). * ⌨️ fix: Give the Panel Composer Main Chat's Keyboard Contract Codex round two. - The composer honors "Press Enter to send". With the preference off a bare Enter is a line break and never reaches the field's action, so reaching for one cannot steer a live run or leave for a continued chat; ⌘/Ctrl+Enter submits there instead. - The IME guard covers Safari. `isComposing` is already false on the very Enter that commits a candidate there, so tracked composition state and the legacy `Process`/229 signals stand in for it, as the main chat composer's own guard does. - The actor picker renders in the panel rather than a portal. On mobile the panel is a modal whose focus trap only knows its own descendants, so a portaled search field let Tab escape to the page behind it. * 🧭 fix: Bind the Continuation Draft, Contain Escape, Defer to the Key Policy Codex round three. - The continuation draft is bound to the selection that asked for it. The composer is shared across selections, so a fork that lands after the reader moved on was handing over the words now in front of them and clearing the composer they belong to. The live field is still preferred, but only while it is still that continuation's own. - Escape is handled on the panel element instead of through the focus trap's callback. That callback runs on a native listener on the aside, so it fired BEFORE any React handler inside it and closed the whole panel — taking the composer's text — when a nested popover meant to dismiss only itself. As a React handler it bubbles in DOM order, so the actor picker can contain its own Escape; `ControlCombobox` gained an `onOpenChange` so the panel knows when that is. - The composer defers to the host's key policy. `Composer` takes an optional `resolveKeyVerdict`, and the panel routes it through the same `resolveComposerKeyDown`/`useComposerBindings` the main chat form uses, so a rebound or unbound submit shortcut behaves identically here and chords claimed by global shortcuts are left for the window handler. * 🔑 fix: Stop the Trap Eating Escape, Freeze the Actor Mid-Continuation Codex round four. - `useFocusTrap` only consumes Escape when it actually answers it. Its listener is native and sits on the container, so it runs before every React handler inside — and by calling `preventDefault` with no callback it swallowed the key from the host that had taken Escape back, leaving the panel unclosable. Both other callers pass a handler, so nothing else changes. The panel suite now runs the REAL trap: stubbing it is what let the previous Escape assertions pass in both directions. - Nothing swaps the composer while a continuation is out. The panel holds the draft that travels with the fork, so the actor picker is frozen and the newest-task advance defers until the request settles, rather than leaving another actor's words to be discarded with the panel. - The 4 KiB cap applies only in control mode. It bounds a subagent control command's payload; a continuation is ordinary chat text bound for a composer that caps nothing. * 🪢 fix: Hold the Selection While a Failed Continuation's Words Survive Codex round five. The newest-task advance deferred while a continuation was in flight, but the error path released that hold at once — so the advance fired, the control identity changed, and the identity effect wiped the composer. The panel stays open after a failed continuation precisely so the reader can retry with those words, and this threw them away. The hold now covers a failed continuation for as long as its draft is still in the box, and releases itself the moment the draft is sent or cleared. The test asserts both halves, and fails if the hold narrows back to the in-flight case. * 🧹 fix: Hold for Any Unsent Draft, and Let a Cleared One Stay Cleared Codex round six. - Unsent words hold the selection wherever they came from. Protecting the draft only once a request had started or failed left the plainest case open: type a continuation, let a newer task arrive, and the advance changed the control identity and emptied the composer. The hold is now `continuationPending || draft is non-empty`, which subsumes the failed case and lets the extra flag go. - Emptying the field after asking to continue is the reader withdrawing the words. While the composer still belongs to that continuation it IS the draft, verbatim, so the destination no longer reinstates text they deleted; only a composer that has moved to another selection falls back to what was captured at submission. |
||
|
|
47dbcb4910
|
🎯 fix: Keep the Thinking Label on the Lightbulb's Axis While Shimmering (#15437)
The shimmer PR (#15431) nested the label inside a span carrying `.shimmer`, which is `display: inline-block`, alongside `truncate`. An inline-block whose overflow is not visible takes its baseline from its bottom margin edge rather than from its last line box, so the label row's line box grew from 18px to 23px and the text lifted 2px while the lightbulb — pinned to the row's 30px centre by the copy button — stayed put. Every streaming reasoning header sat off its own icon's axis until the label settled back to "Thoughts". The sweep now rides the label row itself. That row is a flex item, so `.shimmer`'s `inline-block` is blockified away and the text lands exactly where the un-shimmered label lands: measured against the real component, both states report an 18px box and the same text centre, where the nested form reported 23px and a 2px offset. The nested span survives only for the generated-label entrance, which cannot share an element with the sweep because both drive `animation-name`. It keeps the entrance outside — the clipped element paints the glyphs itself, so a descendant's opacity cannot fade them — and takes `align-top` so the baseline rule above cannot reopen the gap there. Found by rendering the real component in a browser; a hand-built reproduction of the same classes did not show it, and neither did the DOM assertions, which is why the regression shipped. |
||
|
|
cceb936655
|
🪗 feat: Fold a Live Run's Tool-Call Groups Into the Phase Card (#15434)
* 🪗 feat: Fold a live run's tool-call groups into one phase card A long agent run renders one row per labeled tool block, so a turn that takes twenty steps pushes twenty disclosure rows between the reader and the answer. The parent phase card already solves this — it just does not exist until the server has summarized the phase, which is after the run. Give `groupActivityPhases` the whole partition instead of only the part the server has claimed: an unclaimed run of two or more labeled activity blocks becomes a phase segment with a client-built header. `ContentParts` renders `ActivityPhaseGroup` for it exactly as it does for a real phase, so both cards share one definition of the chrome, the fold animation, the lazy body, and the approval retention — change the styling once and both move. The header carries the newest filled child label, which makes the collapsed row a ticker: it reads as the line that would have been at the bottom of the unfolded list, and the generated summary replaces it verbatim when the marker lands. The fold ends at that newest label, so the reasoning and tool call still streaming stay outside the card where they can be watched, and join on the commit their own label fills. Boundaries mirror the server's own phase rule (steer, existing marker, substantial prose) so the synthesized span and the phase card that replaces it cover the same content. Answer text is always a boundary — `groupSequentialToolCalls` absorbs only `commentary`, and nothing the reader came for may end up behind a disclosure. Toggle memory moves into the message-wide map both cards now share with `ToolCallGroup`, keyed on the span rather than either header, so opening the ticker to watch survives the swap to the summary. The rule is content-derived, so history and a live run partition identically and nothing unfolds at settle — `activityPhaseLabel` is opt-in, and a deployment with child labels but no phase summaries would otherwise drop the whole list back open at the end of every turn. Parallel content stands down: those columns own their layout and a synthesized card would pull them onto the phase path. * 🎞️ fix: Do not replay the entrance fold when a summary claims a fold A server marker landing on a span a synthesized card already covers was reading as an arrival, so the real phase card mounted with the entrance animation — which mounts a card OPEN and folds it shut over the next two painted frames. On a span the reader had already watched fold, that flashes every sub-group back onto the screen before collapsing again. Record the content indices sitting behind a synthesized card and suppress the entrance when the marker's span overlaps them. Indices rather than keys, so a start boundary the server resolves slightly differently from the client still counts as the same span. * 🙋 fix: Never fold a span holding an unresolved approval A fold summarizes work that is done. An approval waiting on the reader is the opposite: the run is blocked until they answer, and burying the request behind a disclosure they have to discover strands the turn. A server marker cannot reach this state — it is emitted after the batch resolves — but a subagent nested inside an already-labeled group can raise an approval long after its parent's label filled, which puts it inside a synthesized span. Render that span exactly as it would render without the feature until the approval clears, then fold. * 🧪 test: Assert the fold header ticks forward without re-opening * 🧷 fix: Tighten what a synthesized fold may claim and hide Four issues from review, each now pinned by a test that fails without its fix. An error, an image, or a summary between two labeled blocks was joining the run and disappearing into the card. Membership is now the allowlist `groupSequentialToolCalls` uses — tool calls, reasoning, commentary, labels — plus AGENT_UPDATE, which the server deliberately keeps inside a phase because a transfer card cannot join a tool group. Anything else is content in its own right and ends the fold. Orphan labels were counting as activities. A label that claims nothing heads no group and renders as a standalone line, so two of them are not two activities — folding them hid the first behind a card whose body was just the pair of lines. Labels now count only when they claim a non-empty block, with the claim closing at every label (blank reservations included) exactly as `claimStart` does, and handoff calls claiming nothing. Card identity was anchored to the span's first part, so it moved when the server extended a phase back across short unphased text the client treats as a boundary — dropping the reader's open card on the swap the shared identity exists to survive. It is an ordinal now: phase cards only ever append in content order. The synthesized entrance is gone. It mounts a card OPEN and folds it shut, and this component remounts mid-run — `messageId` is in the key and changes when the placeholder hydrates to the server id, and a reconnect mounts straight onto existing labeled content — so it would flash the whole fold back open partway through a run. Fold GROWTH was never animated, so formation matching it is the consistent behavior. * 🔑 fix: Key a phase card by its span so the summary reconciles in place Two more from review, and the first one condemns the mechanism rather than the instance. Ordinal card identity was not stable: an earlier server phase can hold a pending marker that yields no segment yet — its activities are handoffs, or no child label has filled — so a later fold takes `phase:1` and is pushed to `phase:2` when that marker fills, handing the reader's override to a card they never opened. Any counter has this shape, so the transfer map is gone entirely. What replaces it needs no state to hand over. Both card kinds now render under one key anchored to the SPAN, so the card that carries the summary is the same element as the fold it replaces and React reconciles it in place — the reader's open card simply stays open. A phase with no children has no span and keeps its marker key. `ActivityPhaseGroup` is byte-identical to dev again: the shared component needed nothing. The honest limit, now pinned by a test: when the server extends its span back across short unphased text the client treats as a boundary, the two spans differ, and a card covering different content is keyed and mounted as a different card. The toggle does not carry there. Keeping the stricter boundary is deliberate — `phase` is only stamped by providers that expose it, so matching the server would let a short final answer hide inside a fold. Second: `tool → transfer_to_* → label` was counting as a claimed batch, while the grouping flushes the block at the non-groupable transfer and then drops the label through `coversTransferCall`. Two such batches built a card over labels that render nowhere. The claim now resets at any part the block cannot hold, matching the flush. * 🗝️ fix: Drop messageId from the card key and let a grown span animate Two more from review; the second deletes a mechanism the span-keying had already made redundant. The assistant streams under a synthetic `${userMessage.messageId}_` for the WHOLE run and only takes its server id at `finalHandler`, so a key carrying `messageId` remounted every phase card at settle and dropped whatever the reader had open — a guaranteed loss at the end of every turn, not a narrow window. The card key is the span alone now, which is how `ToolCallGroup` has always keyed for the same reason. `replacesFold` suppressed the entrance whenever a marker's span merely OVERLAPPED a previous fold. When the server extends its span back across short unphased text the two spans differ, the card is genuinely a new one, and suppressing the entrance made the text the reader was looking at blink out of existence instead of being folded in. The suppression is gone: a same-span replacement is now reconciled rather than remounted, so it cannot animate anyway, and that was the only case worth suppressing. With it goes the `folded` index tracking it was the sole reader of. Anchoring identity to the span turned out to subsume both the expansion map and this set — the diff is smaller than it was two rounds ago. * 👥 fix: Separate a sibling switch from a message taking its server id Dropping messageId from the card key fixed settle but opened the case it had been guarding: MultiMessage renders siblings without a key and reuses this instance, so an index-anchored card carried one response's open state into an unrelated one. Neither prop tells the two apart on its own — setIsSubmitting(false) is batched with the final message swap, so that commit looks exactly like a sibling switch by message identity. `siblingIdx` does: it moves when the reader pages to another response and holds still when the same response takes its real id. * 🪪 fix: Pair the card's position with its first provider id `siblingIdx` was the wrong discriminator. MultiMessage recomputes the viewed response's positional index whenever a sibling is added or dropped around it — its own docblock calls this out — so a key carrying it remounted the card during churn that deliberately PRESERVES the response the reader is on. Its docblock also records why no message id works either: messageId and parentMessageId both move through the SSE lifecycle, which is exactly why that component reconciles positionally. The span's own position was never the problem — it is content-derived, so churn cannot touch it. It only failed to separate two siblings whose cards start at the same index. Pairing it with the first tool call's provider id fixes that and nothing else: settle and churn leave both halves alone, and the pair also keeps repeated provider ids in one message apart, which a bare id would have collided on — the existing `counts repeated legacy provider-id groups` case proved that immediately. * 🧲 fix: Anchor the card to its first tool call and spare hoisted output Anchoring the key to the span's first PART broke at settle whenever a phase opened with an empty TEXT or THINK: preserveStreamedContentIdentity drops those slots and stamps the survivor, so the anchor moved and the card remounted exactly when the run finished. `getToolGroupId` already records the answer — the tool calls themselves do not move — so the anchor is the first tool call's own position now, with its provider id still alongside to keep repeated ids apart. That also closes the limitation this PR had been documenting. A phase the server extends back across short unphased text still shares its first tool call with the fold, so the two now reconcile and the reader's open card rides through. The test that pinned the old degradation asserts the better behavior instead. Second: `ToolCallGroup` renders `groupAttachments` OUTSIDE its own panel so a generated image or file survives collapsing the group. Folding that group into a card put the hoist back inside a disclosure and the output disappeared. These attachments are message-level and never appear in `segment.content`, so the visible-part allowlist could not catch them — a span carrying any takes the same escape as an unresolved approval and renders unfolded. Hoisting them to the card would be better and would fix the same hole for server phases on dev; it is not this PR. * 🎯 fix: Give id-less spans a scope and stop the second streaming cursor Two from review. The card key's no-provider-id fallback was a bare position, which cannot separate two siblings whose cards start at the same index — the exact hole the provider id had just closed, reopened for id-less legacy calls. That branch carries the message-change counter now, which is what `getToolGroupId` does for its own id-less fallback, and it accepts the same tradeoff: the counter advances at settle, so those cards remount then. Spans that have a provider id are unaffected. `showEmptyCursor` never consulted `isLast`, so a trailing empty provider slot rendered the initial waiting state from inside its own segment even though a card was already carrying the cursor — two dots at once. Reusing `isLast` would have been wrong: it means "leaf of the tree", and the existing thinking-dot tests legitimately leave it false while submitting. The phase branch now computes which card owns the cursor and passes that down, alongside the other internal segment signals. It covers real phase markers too, which had the same duplication. |
||
|
|
146664e0d1
|
🔐 fix: Redirect OAuth Browser Navigations Instead of Rendering JSON (#15440)
* 🔐 fix: Redirect OAuth Browser Navigations Instead of Rendering JSON The /oauth/* routes are reached by top-level browser navigation, so a middleware that rejects one with a JSON body makes the browser render that body as the page. Hitting the login rate limit during a social sign-in dropped the user on a blank page showing: {"message": "Too many login attempts, please try again after 5 minutes."} Mark those requests with markOAuthNavigation and have the two middlewares that can reject them answer with a redirect to the login page carrying an error code the client localizes. The login limiter stays a single instance so the attempt budget is still shared with POST /api/auth/login, and that route keeps its JSON 429 for the SPA. * 🧪 fix: Address PR Review Bot Findings chatgpt-codex-connector: - Split the inline `type TranslationKeys` specifier out of the value import, per the standalone `import type` convention in CLAUDE.md. This also clears the Static checks import-sort failure. - Cover the new OAuth error branches in Login.spec.tsx: each mapped `?error=` code raises its localized toast and the query is cleaned, and unmapped codes including prototype members raise nothing. |
||
|
|
6be3f798fc
|
🪩 style: Shimmer Live Reasoning Labels and Timers (#15431)
* ✨ style: Shimmer the Thinking Label and Elapsed Timer While Generating The label above streaming reasoning and the elapsed-time reading beneath a streaming response both sat static while every other in-flight indicator on the row — a running tool call's label, a running skill, a pending question — carried the shimmer. Give them the same treatment so "in flight" reads the same way everywhere. Both are gated on state that is already established: - `Reasoning` shimmers only while `effectiveIsSubmitting && isLast`. Settled thoughts, an older row the reader paged to, and reasoning overtaken by later content all keep the plain label. The legacy `Thinking` component and `ThinkingLabel` (the detached-subagent marker) do not opt in. - `Elapsed` only ever renders under the streaming latest row at the newest sibling position (`shouldShowElapsed`), so there is no settled reading for the animation to misrepresent. Completed tool-call durations go through `getRunStepDurationLabels` and are untouched. `.shimmer` and Tailwind's `animate-in` entrance both drive `animation-name`, and `.shimmer` — plain CSS after `@tailwind utilities`, equal specificity — would win and silently kill the generated-label slide-in. The two therefore sit on nested spans, in the order that is safe for `background-clip: text`: the transform on the ancestor, the clipped background on the descendant. * 🎨 fix: Drive the Shimmer From Theme Roles and Honor Reduced Motion Two review findings, both against the shared `.shimmer` utility rather than this PR's call sites — but this PR adds two more consumers of it, one of which sweeps continuously for the whole generation, so they land here. Theme roles. The gradient hard-coded near-black and near-white and selected the second with `.dark`, so a stored or custom theme that restated its text colors got a shimmer that ignored them. Themes are applied as bare RGB triplets on the document element; the sweep now reads `--shimmer-base` / `--shimmer-dip` (with the established `-alpha` companions the border roles already use) and falls back to `--text-primary` when a theme states no base of its own. The fallback is resolved at the label, not in the `:root` declaration — `var()` substitutes where it is declared, so seeding `--shimmer-base: var(--text-primary)` on `html` would have frozen the default and ignored every theme scope applied further down. Dark still declares its base outright: that value is dimmer than the dark theme's text color, and restating it as `--text-primary` would have brightened every shimmer. Default light and dark are preserved: rendered old against new at a frozen sweep position, 144 of 137,280 pixels differ by a single 1/255 channel step, which is the alpha-syntax rounding path. A theme that sets only `--text-primary` now colors the sweep with no shimmer-specific override. Reduced motion. `.shimmer` was the one custom animation in `style.css` with no `prefers-reduced-motion` guard — `.t-icon-swap`, `.t-avatar`, `.scroll-animation-*` and `[data-lc-fade]` all carry one. Stopping the animation alone is not a fallback: the background settles at position 0 and shows only half the sweep, stranding the tail of the label in the near-invisible dip. The guard drops the gradient and hands the glyphs back to the color they would otherwise have had. * 🎨 fix: Register the Shimmer Stops and Keep the Sweep Whole Codex round 2, on the previous round's fixes. Register the stops. Moving the constants into CSS variables did not make them theme-owned: `applyResolvedTheme` writes only `themeColorTokens`, so nothing a theme declares could reach `--shimmer-base`. Dark was the case that mattered — `style.css` declares a `.dark` base outright, which a theme can only outrank by having the property applied to the document element — so a custom dark theme still got the stock white sweep. `rgb-shimmer-base` and `rgb-shimmer-dip` now sit in the registry beside the text roles, seeded with today's values in both modes; `registry.spec` already enforces light/dark key parity. The opacities stay in CSS as `--shimmer-*-alpha`, the way the border roles keep `--border-*-alpha`. This narrows the earlier claim: a *versioned* theme resolves every default, so it now states its own sweep rather than inheriting `--text-primary`. The `--text-primary` fallback still serves plain CSS and legacy partial `themeRGB` themes, which apply only the keys they name. Keep the sweep whole. `key` remounts the label row so the entrance replays, restarting the sweep with it; reasoning labels revise on a 3s default (`DEFAULT_UPDATE_INTERVAL_MS`) against a 4s sweep, so it never completes a cycle. Keying only when an entrance will actually play leaves an un-animated label — smooth streaming off, or reduced motion — with a stable identity and an unbroken sweep, instead of a bare snap with nothing to cover it. Not adopted: keeping the shimmer element stable and replaying the entrance inside it. The clipped element paints the glyphs itself, so a descendant's opacity cannot fade them — rendered at entrance t=0, the current nesting is correctly invisible while the swapped one sits fully lit through its own fade. The remaining restart happens only underneath a deliberate entrance animation. * 🎨 fix: Carry Legacy Themes Onto the Registered Shimmer Stops Codex round 3. Registering the stops migrated versioned themes but not stored or environment `themeRGB` ones: `ThemeProvider` routes those to the legacy `applyTheme` adapter, which bypasses `resolveTheme` and applies only the keys a theme names. A stored theme has no shimmer keys, so it kept the stock sweep while the rest of its palette moved — and in dark the CSS cannot recover on its own, because `.dark` declares a base outright and the `--text-primary` fallback never runs. `mapColors` already carries legacy themes across a token they predate: `--surface-composer-hover` derives from `rgb-surface-hover` when absent. The shimmer base follows the same shape, deriving from `rgb-text-primary` — which is what it already resolves to in light, so only dark changes. The dip has no legacy counterpart and stays at its default; it is the faded half of the sweep, carried at low alpha, so it reads as dimmed against any base. Not a regression being fixed but an improvement being extended: before this branch, every theme got the same hard-coded sweep. This is the last path that still did. * 🎨 fix: Mirror the Shimmer Fallback Onto Versioned Theme Resolution Codex round 4. The compat fallback added last round covered only the legacy adapter, but this codebase carries these fallbacks on both paths: the `rgb-surface-composer-hover` derivation exists in `mapColors` AND in `resolveTheme`. Adding the shimmer stop to just one left the halves disagreeing. The versioned path is the one where the omission actually hurts. A definition written before these keys existed cannot name them, so `resolveTheme` filled the gap from the bundled base and pinned that theme's in-flight labels to LibreChat's own sweep — a theme restating its text as white would light every label in the stock near-black. Omission there means "not written yet", not "wants the bundled sweep"; a theme that does want it still says so by naming the stop, exactly as it opts out of the composer-hover fallback. Both paths now behave the same: a theme that restates its text and names no shimmer base gets its sweep from that text color, whichever way it is applied. |
||
|
|
982a9a5141
|
🧴 fix: Strip LangChain URLs From Provider Errors (#15421)
Some checks are pending
Backend Unit Tests / Build packages (push) Waiting to run
Backend Unit Tests / Codegraph select (push) Waiting to run
Backend Unit Tests / TypeScript type checks (push) Blocked by required conditions
Backend Unit Tests / Circular dependency checks (push) Waiting to run
Backend Unit Tests / Tests: api (shard 1/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 2/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 3/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: data-provider (push) Blocked by required conditions
Backend Unit Tests / Tests: data-schemas (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 1/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 2/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 3/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 4/4) (push) Blocked by required conditions
Codegraph E2E Votes / vote (full suite) (push) Waiting to run
Docker Dev Branch Images Build / build (Dockerfile, lc-dev, node) (push) Waiting to run
Docker Dev Branch Images Build / build (Dockerfile.multi, lc-dev-api, api-build) (push) Waiting to run
Frontend Unit Tests / Codegraph select (push) Waiting to run
Frontend Unit Tests / Build packages (push) Waiting to run
Frontend Unit Tests / TypeScript type checks (client) (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/client (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 1/2) (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 2/2) (push) Blocked by required conditions
Frontend Unit Tests / Vite build verification (push) Blocked by required conditions
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Blocked by required conditions
* 🧹 fix: Strip LangChain Attribution From User-Facing Provider Errors LangChain classifies provider failures by mutating `error.message` with a docs URL, and that message is forwarded verbatim into the error content part we persist, so users saw `docs.langchain.com/...` credited for a provider's own 429. The client only intercepted `MODEL_NOT_FOUND`, leaving every other code to render raw. Resolve the classification server-side instead: codes with localized copy become the typed payload the client already knows how to localize, and every other message keeps the provider's wording with the docs URL removed before it reaches the database. The untouched error still reaches the logs through `getSafeErrorMetadata`. The client keeps a code-driven lookup for messages persisted before this, and gains `com_error_model_rate_limit` alongside the existing not-found copy. The OpenAI-compatible and Responses controllers now share one provider-error helper rather than three copies of it, so the strip applies on those surfaces too. * 🛡️ fix: Harden Error Sanitization For Non-String Messages And Legacy Text Codex review follow-up. `stripLangChainTroubleshootingUrl` assumed a string, so an error-like object with a truthy non-string `message` threw `.replace is not a function` inside the error handler that was meant to report it — the template interpolation it replaced had coerced such values safely. It now coerces at the boundary, as does the code lookup. Legacy messages whose LangChain code has no localized copy still rendered the docs URL, which is exactly the historical case the client-side path exists to clean up. The rendered fallback is now stripped too. Both helpers move to `librechat-data-provider`, which is shared by the client and the backend, so one implementation serves both instead of a second regex drifting in the component. |
||
|
|
f0f82ec5fa
|
🧷 fix: Fence Server-Admitted Queue Boundaries (#15393)
* fix: fence server-admitted queue boundaries * fix: preserve effective queue admission boundaries * fix: fence queue recovery predecessor * fix: unify queued boundary reconciliation * fix: make queued turn receipt settlement monotonic * fix: narrow queued receipt projection status * fix: close queued turn settlement races * fix: make queued admission lineage clock independent * fix: centralize queued turn admission ownership * test: type queued admission outcomes * fix: make queued admission identity durable * fix: carry queued admission identity end to end * style: sort queued turn test imports * fix: unify indeterminate admission ownership * fix: migrate queued admission fence state * fix: migrate every queued admission owner * fix: surface queued admission reconciliation * fix: preserve queued receipt evidence * test: type queued receipt regression * fix: stabilize queued receipt authority * fix: supersede initial receipt fetches |
||
|
|
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. |
||
|
|
ccd673bf05
|
🧰 fix: Keep File-Backed Agent Capabilities and Their Saved Tools in Agreement (#15418)
An agent with knowledge files showed File Search as selected in the builder while the save omitted `file_search` from its tools. At runtime the tool was gone, the row still looked selected so re-adding it changed nothing, and the next save re-confirmed the broken state. Recovery needed a MongoDB write. The builder's model for file-backed capabilities is stated in ToolsSection: they stay selected while they hold files, and removal is routed to the file manager rather than the capability flag — mirroring the file-only `context` built-in. Three places implemented that model separately and drifted: - display resolved it from the flag OR the file count, - persistence resolved it from the flag alone, - the removal guard lived inline in the tools list and was missing entirely from the marketplace dialog. That last gap is how the bad state was reached. `ToolsMarketplaceDialog` toggled a selected File Search straight to `file_search: false` with no file check, producing flag-off-with-files — a state display cannot show and persistence silently drops. `items/capabilities.ts` now owns the capability table and the one rule, and display, removal and persistence all derive from it: - persistence resolves the same way display does, so a file-holding capability keeps its tool (this also heals already-broken agents on their next save), - both toggle paths route removal of a file-holding built-in to the file dialog, - the removal guard takes file counts rather than the agent, so a component can pass the hydrated entries it already watches while submit reads the form — the rule is shared, the source of the count need not be. Submission also stops mutating `data.tools` in place and dedupes the result. Supersedes the persistence half of #15380, which fixed the save but left the marketplace path able to recreate the state and kept the rule in a third copy. Fixes #15368 |
||
|
|
7b0b145159
|
🪁 fix: Keep Tool Flyouts in View (#15404)
* fix: keep tools menu submenus within the viewport * fix: let the viewport cap override the submenu min-width |
||
|
|
52f7251ef7
|
📦 chore: Bump Packages from LibreChat SCA Audit (#15410) | ||
|
|
e9e77a4b33
|
🧜♀️ chore: Bump mermaid to v11.17.2 and dompurify to v3.4.14 (#15405)
Bumps mermaid 11.16.1 -> 11.17.2, and raises the dompurify override from 3.4.12 to 3.4.14 to clear GHSA-55q2-fjhq-7xh7 (XSS: IN_PLACE hook removal leaves a detached subtree executable). The dompurify pin lives under the `monaco-editor` override because monaco depends on an exact 3.4.8; the override lifts it to match what the rest of the tree resolves for `^3.4.0`, so a single copy stays hoisted. Bumping it to 3.4.14 (current latest) keeps that single-copy property — pinning 3.4.13 would have left `^3.4.0` on 3.4.14 and installed two copies. The mermaid floor moves to ^11.17.2 rather than staying ^11.16.1 because 11.17.0/11.17.1 dropped the `edgePaths` class from rendered SVG, breaking the flowchart, block and user-journey stylesheets. Restored in 11.17.2. Lockfile delta is limited to mermaid 11.16.1 -> 11.17.2, @mermaid-js/parser 1.2.0 -> 1.2.1, dompurify 3.4.12 -> 3.4.14, plus new fastdom + strictdom. katex is unaffected: mermaid raised its floor to ^0.16.47, but the global `katex: ^0.16.21` override supersedes it, and mermaid only ever calls `katex.renderToString()`, which 0.16.28 provides. |
||
|
|
044894e8bb
|
🎛️ fix: Settle New Turns at the Bottom, Steady Status Dots, and Elapsed Time in the Panel (#15394)
Some checks are pending
Backend Unit Tests / Build packages (push) Waiting to run
Backend Unit Tests / Codegraph select (push) Waiting to run
Backend Unit Tests / TypeScript type checks (push) Blocked by required conditions
Backend Unit Tests / Circular dependency checks (push) Waiting to run
Backend Unit Tests / Tests: api (shard 1/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 2/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 3/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: data-provider (push) Blocked by required conditions
Backend Unit Tests / Tests: data-schemas (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 1/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 2/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 3/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 4/4) (push) Blocked by required conditions
Codegraph E2E Votes / vote (full suite) (push) Waiting to run
Docker Dev Branch Images Build / build (Dockerfile, lc-dev, node) (push) Waiting to run
Docker Dev Branch Images Build / build (Dockerfile.multi, lc-dev-api, api-build) (push) Waiting to run
Frontend Unit Tests / Codegraph select (push) Waiting to run
Frontend Unit Tests / Build packages (push) Waiting to run
Frontend Unit Tests / TypeScript type checks (client) (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/client (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 1/2) (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 2/2) (push) Blocked by required conditions
Frontend Unit Tests / Vite build verification (push) Blocked by required conditions
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Blocked by required conditions
* 🎛️ fix: Settle New Turns at the Bottom, Steady Status Dots, and Elapsed Time in the Panel * 🎛️ fix: Anchor Panel Timers, Order Turns by Trigger Time, Keep a Non-Color Status Cue |
||
|
|
c93bd7ec9d
|
🪟 fix: Keep the Subagent Panel Steady and Honest Across Event Deliveries (#15387)
* 🪟 fix: Keep the Subagent Panel Steady and Honest Across Event Deliveries * 🧮 fix: Budget the Activity Projection at the Database Seam and Scope Retained Views * 🧮 fix: Charge Label Associations to the Budget and Scope History Flags * 🧮 fix: Gate Mixed Activity Metadata and Keep the Budgeted Suffix Contiguous * 🧵 fix: Render Only the Active Thread's Retained Turns |