Add a 'Fix' affordance on AI-generated images (hover pill on the message
thumbnail and an action in the fullscreen dialog) that attaches the image
to the composer as a reference file and seeds a 'Fix this image: ' prompt,
so the user only describes the fix.
Three attach paths, all reusing the existing file pipeline:
- Fix: attaches the generated image by reference (file_id, no re-upload) via
useAttachImage, injecting a completed ExtendedFile (attached: true) into the
composer file map — the send path forwards it verbatim as multimodal content.
- Drag-and-drop: plain image/file drops with no tool-resource choice now attach
straight into the current conversation instead of a single-option dead-end modal.
- Attach a previous image: new attach-menu item opens a picker of the current
conversation's images (collectConversationImages) and attaches by reference.
Pure helper collectConversationImages/resolveImageUrl unit-tested (10 cases).
i18n keys added to the default locale. No backend changes.
The content-free router-training feedback transport now lives once, in
`@hanzo/ai` `sendFeedback` (v0.2.1). `client/src/utils/rewardSignal.ts` becomes
a THIN adapter: it keeps the exact public `sendRewardSignal(requestId, signal,
rating?)` the message-actions and model-selector surfaces wire to, plus the
local `VITE_HANZO_FEEDBACK` opt-out, and delegates emission to the SDK with the
chat-specific `baseUrl` (VITE_HANZO_API_URL, cross-origin gateway) and the
end-user bearer lifted from axios defaults. The SDK owns the whitelisted
`{request_id, signal, rating?}` body, the dedupe, and the fire-and-forget
transport — so no prompt/response/code can transit, exactly as before.
The existing spec passes untouched (behavior preserved end-to-end through the
SDK; jsdom has no sendBeacon, so the SDK falls back to the same keepalive fetch
with the same headers).
Tests: client/src/utils/rewardSignal.spec.ts — 13/13 passed.
Claude-Session: https://claude.ai/code/session_015Z1iLf7QBrq1LhignJrzDw
Co-authored-by: hanzo-dev <dev@hanzo.ai>
Client-side product analytics via @hanzo/capture: pageviews, identify(user.id), and CHAT_STARTED/CHAT_MESSAGE_SENT with endpoint+model identifiers only — no message content or PII. Lockfile + tsconfig subpath mapping included.
Emit CONTENT-FREE reward signals to `POST {VITE_HANZO_API_URL}/v1/feedback` so
the router training loop gets production feedback. Payload carries ONLY
{request_id, signal, rating?} — never any prompt/response/tag/text/filename/code.
Fire-and-forget: never blocks UX, silent no-op on any failure.
The routing ledger keys each RoutingEvent on the upstream gateway response id
(chatcmpl-…/msg_…). The chat client previously held only locally-minted UUIDs,
so capture the REAL id server-side and thread it to the client as one field:
- server: ModelEndHandler captures `data.output.response_metadata.id ?? .id`
(the last CHAT_MODEL_END = the visible answer) into a shared `runMetadata`;
AgentClient surfaces it via `this.metadata` → `feedbackRequestId` on the saved
response message, riding the SSE final event + DB save to the client.
- schema: add optional `feedbackRequestId` to tMessageSchema (zod), IMessage
(mongo type) and the mongoose message schema (persists; SQLite keeps it in its
JSON doc blob automatically). Absent id ⇒ signal no-ops (never fabricated).
Client signals wired via new `client/src/utils/rewardSignal.ts`:
- thumbs up/down → up/down; regenerate → regenerate; copy → up (weak positive);
model-switch right after a response → switch (last assistant msg's id).
Dedicated cross-origin credentialed fetch (keepalive) to the Hanzo API — NOT the
same-origin chat backend — forwarding the end-user bearer for per-org attribution.
Honors local opt-out `VITE_HANZO_FEEDBACK=0|false|off` (server-side org/user
training opt-in is the preferred enforcement). 13 unit tests, all green.
Claude-Session: https://claude.ai/code/session_015Z1iLf7QBrq1LhignJrzDw
Co-authored-by: hanzo-dev <dev@hanzo.ai>
The controller required '@librechat/data-schemas', but this fork renames all
internal packages to @hanzochat/* (214 other files use @hanzochat/data-schemas;
that upstream name resolves to nothing). Runtime-only failure (require-time), so
the green build hid it and 0.9.21 CrashLooped at CloudUsage.js:1 MODULE_NOT_FOUND
— AFTER clearing the 0.9.21 zod/v4 fix. One-line name fix; all other requires in
the usage backend already resolve.
Any fresh chat image built after 74954c3f8 (@hanzo/iam 0.13 lockfile regen,
which pulled openai@6.46.0) crashes on boot:
ERR_PACKAGE_PATH_NOT_EXPORTED: subpath './v4' is not defined by
"exports" in openai/node_modules/zod/package.json
openai@6.46.0 declares zod '^3.25 || ^4.0' and imports zod/v4, but pnpm
mis-resolved its peer to the older zod@3.24.4 (which has no ./v4 subpath).
The deployed 0.9.19 image predates openai@6 entering the tree, so it never
hit this — 0.9.20 was simply the first rebuild to trip the latent landmine.
Fix: a single pnpm override zod@3.24.4 → 3.25.76 (already in-tree, a
backward-compatible superset that ships the zod/v4 compat subpath),
collapsing to ONE zod. Verified: no other package floated; openai@6.46.0
now pairs zod@3.25.76. Unblocks the whole chat build pipeline, not just
the 0.9.20 usage panel.
Adds the shared Hanzo usage read to LibreChat's Usage tab, beside (not
replacing) the Mongo token-credit view. Backend CloudUsage.js proxies
cloud's GET /v1/get-cloud-usages on-behalf-of (hanzo.id bearer resolved
server-side, never to browser); client renders the CloudUsageOverview
with @hanzo/usage's headless normalizeCloudUsage over native Tailwind.
Honest when unavailable: 200 {enabled:false} hides the section.
Brings the fork completion (de-librechat, @hanzochat scope rename, @hanzo/iam
0.13 API) and the org/project/user switcher (validated active-org -> X-Org-Id
on both cloud seams) onto main for release.
The account menu shows user -> org -> project and lets a multi-org member
switch their working org. The switch pins hanzo_active_org (httpOnly),
validated server-side against the caller's own membership set (owner + groups)
via POST /v1/chat/user/active-org. resolveActiveOrg() forwards it as X-Org-Id
on both on-behalf-of seams — the inference path (custom/initialize.ts) and
cloud agents (CloudAgentsClient) — where the gateway re-validates it in the
member's set (HIP-0026), so the header is a validated selection, never a trust
assertion. Adds Account/Console/Billing links. openidStrategy persists
organization/project/groups from the JWT claims; the user schema + TUser carry
them and getUserController serves them.
The static/IAM SPA path (client/src/utils/iam.ts, OAuthCallback.tsx) imported
BrowserIamSdk, removed when @hanzo/iam bumped 0.4->0.13 (HIP-0111); the class is
now IAM with an identical constructor config. pnpm-lock.yaml regenerated for the
@hanzochat rename. Fork now builds 5/5 tasks green.
- @librechat/agents -> @hanzochat/agents@^3.2.63 (published fork of
danny-avila/agents at github.com/hanzochat/agents; upstream remote kept
so agent-runtime fixes stay pullable)
- final sweep: zero @librechat/* package refs (chat internals + runtime)
- remove dead packages/agents residue (stale dist, no package.json)
- drop stale npm/bun lockfiles; pnpm-lock.yaml is the canonical lockfile
librechat-data-provider → @hanzochat/data-provider
@librechat/data-schemas → @hanzochat/data-schemas
@librechat/client → @hanzochat/client
(@hanzochat/api already forked; external @librechat/agents fork follows)
All imports, package.json names/deps, tsconfig path aliases, jest
moduleNameMapper, and rollup/vite build aliases updated. The data-provider
react-query subpath resolves via the exports map. Lockfiles regenerated in a
follow-on once the canonical package manager is confirmed.
True-black (client/src/style.css, client/tailwind.config.cjs):
- Converge the off-scale #0a0a0a onto the token scale. --gray-925 (consumed by
--presentation / --surface-primary-alt / --surface-dialog) and --green-950,
plus the Tailwind mono ramp's 950, now resolve to #050505, so inner panels /
dialogs match the elevated-surface value instead of reading as a lighter grey.
Verified in-browser: --gray-925/#050505, dark --surface-primary-alt/-dialog =
#050505, --surface-primary/-chat = #000.
- Root.tsx auth-loading fallback and LandingPage.tsx local tokens (bg #000 /
card #050505 / muted #171717) converged off #0a0a0a onto the same scale.
Overlay cap (client/src/mobile.css):
- Cap .nav-mask and .sidenav-mask at max-width:420px (anchored to the drawer's
own edge — left for nav, right for sidenav) instead of a full-width scrim, so
on a tablet the dim covers only the drawer footprint, not the whole viewport.
Align the nav-mask media query to 768px to match Nav.tsx's
useMediaQuery('(max-width: 768px)') so the cap also covers the tablet-portrait
boundary where the drawer is active. Verified: at 768px the scrim renders 420px
(55% of viewport), not 100%.
Touch targets (client/src/mobile.css, client/src/components/Chat/Input/ChatForm.tsx):
- Add a `composer-actions` marker on the composer action row and bump its round
action buttons (attach / tools / mic / send-stop, previously size-9 = 36px) to
a 44px min touch target on touch viewports. Verified 44x44 at 375px, unchanged
36px at desktop.
Build unblock (pre-existing dependency drift that hard-crashed the client):
- NetworkWallet.tsx: @hanzo/ui 5.x dropped ./network and ./wallet exports, whose
named imports failed the Vite dep-scan and Rollup build; render null with a
re-enable recipe (mirrors hanzo/app).
- utils/iam.ts: @hanzo/iam 0.4.x exports the SPA client as BrowserIamSdk, not
IAM; the wrong name crashed the app at mount and failed the build. Same
constructor config; swap to BrowserIamSdk.
Verified: `vite build` passes; Playwright at 375/768/1280 confirms true-black
surfaces, the 420px overlay cap, and 44px composer targets.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The SQLite DocModel (the Mongo replacement chat migrated onto) exposed
`distinct()` only on the model (static call sites like
`PromptGroup.distinct('category', filter)` worked), but `find()` returns a
`QueryBuilder` that lacked it. Every query-chain call site —
`AclEntry.find(q).distinct('resourceId')` (findAccessibleResources,
findPubliclyAccessibleResources) and `AgentCategory.find(q).distinct('value')`
— threw "find(...).distinct is not a function", crashing permission
resolution.
One-place DRY fix mirroring mongoose's `Query.prototype.distinct(field)`:
QueryBuilder.distinct(field) is chainable (so a trailing `.lean()` still
works) and delegates to the existing DocModel.distinct, keeping filter/tenant
scoping identical to `.find()`. No mongoose reintroduced.
Tests: added ACL `$or`+`$bitsAllSet` distinct + AgentCategory
`.distinct().lean()` cases to DocModel.spec.ts (14/14 pass).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Neutralize the per-tool accent hues on the composer's active
CheckboxButton chips so the shell chrome recedes and stays true-black
monochrome (matching hanzo.ai). Each tool's "on" state painted itself a
distinct color — Search=blue, Code=purple, FileSearch=green,
Skills=cyan, Artifacts=amber (+ its split-menu button) — reading as a
rainbow in the composer. Unify to one neutral active treatment via the
existing semantic tokens (border-border-heavy + bg-surface-active-alt),
which already track the dark/true-black theme.
Also drops the stray text-cyan-500 on the queued-skills chip icon →
text-text-secondary.
Shell top-left (H mark alone + brand right-click menu) and bottom-left
(consolidated AccountSettings cluster) are already correct via the
shared @hanzo/ui HanzoHeader (v5.5.1) + AccountSettings — no fork.
No org switcher exists in chat (org is server-derived from the hanzo.id
owner claim); none fabricated. Semantic hues (balance status, errors,
online dots) left intact. Message content / syntax highlighting
untouched.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A rejected gateway key or an out-of-credits balance can end a `stream:true`
completion with NO content and WITHOUT throwing — api.hanzo.ai answers as a
200 event-stream that yields zero deltas — so the agent run "succeeds" with an
empty response and the client renders an EMPTY assistant bubble. This is the
exact silent failure behind the dead-guest-key GA blocker (a dead key -> 401 ->
{"msg":"invalid API key"} that the SSE client rendered as an empty reply).
Add a backstop in ResumableAgentController: right after `client.sendMessage`,
if the response carries no user-visible content and the run was not aborted,
throw. The throw lands in the existing catch -> `GenerationJobManager.emitError`
-> the `event: error` SSE frame the client already renders as an error bubble.
No new SSE plumbing — it reuses the one error path, so a dead key or exhausted
balance can never again be invisible.
The emptiness decision is a pure, unit-tested helper (`isEmptyAgentResponse`):
non-empty iff there is non-whitespace `text`, a non-blank text/think part, or
any non-text content part (error, tool_call, image, ...). An ERROR part still
renders, so the gateway-threw path is untouched.
Tests:
- emptyResponse.spec.js: 8 cases pinning the predicate (empty content array,
blank-text-only, error/tool_call/text parts non-empty).
- emptyResponseController.spec.js: drives the real controller — empty response
emits `error` (not a silent `done`); a response with content emits `done`.
Claude-Session: https://claude.ai/code/session_016yg7GPhYdWCh9vpp4HEwLZ
Co-authored-by: hanzo-dev <dev@hanzo.ai>
Model selector now surfaces the house family as "Zen": custom endpoints honor
their configured modelDisplayLabel as the group label, so the endpoint VALUE
stays "Hanzo" (existing conversations + pinned guest endpoint unaffected) while
the picker group reads "Zen". Config bumps the third-party providers to
customOrder 2+ so the built-in Agents endpoint (order 1) sits alone between Zen
(0) and the providers — Zen first, Agents second, other providers after. Does
not conflate Hanzo (agents) with Zen (models).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Accept ?project=<slug> (the org-unique key of the ONE cloud /v1/projects store,
org from the IAM JWT). A slim ProjectBanner shows the active project and links
the same slug back to the hanzo.app builder and console.hanzo.ai; a new
conversation opened for a project seeds the composer with a short opener so the
assistant has project context. Slug validated against the store's grammar and
persisted for the session so the scope survives the /c/new -> /c/:id navigation.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(chat): shared NetworkSwitcher + WalletMenu in the HanzoHeader
Puts hanzo.chat on the ONE hanzo.network standard (same model as the
hanzo CLI, console, desktop, app): @hanzo/ui/network + @hanzo/ui/wallet
via the npm alias @hanzo/ui -> @hanzo/ui-shadcn@^5.7.3 (the 5.x line
continued under its post-v8-rename name; existing imports untouched).
- Nav/NetworkWallet: the surface adapter — injected EIP-1193 wallet
(non-custodial, zero key material) pinned to the selected network env
(mainnet 36963 / testnet 36964 / devnet 36965 / local / custom).
- Mounted via the HanzoHeader headerRight slot; dark-scoped to match the
monochrome bar.
- tailwind: scan the shared components in node_modules; add the missing
popover/destructive tokens (fallback to background/foreground vars).
vite build green; tsc baseline unchanged (1014 pre-existing errors on
clean main, zero added — upstream CI gates vite build only).
* chore(chat): bump @hanzo/ui-shadcn 5.7.3 -> 5.7.4 (genesis-canonical chain IDs)
Picks up the corrected network set (testnet 36962, devnet 36964, local
1337). vite build green.
---------
Co-authored-by: Hanzo Dev <dev@hanzo.ai>
Mirror the web client's server-driven Smart Routing onto the mobile
surface. On boot (authed), fetch the SAME backend route the web client
uses — GET /v1/chat/routing-defaults — fail-soft to { available: false }
so any error keeps today's local-toggle-only behavior.
- lib/routing.ts: mirror of web resolveSmartRouting (pure) plus org
derivation helpers and a module cache for the non-React api layer.
- lib/settings.ts: smart-routing pref is now nullable (null === follow
org default; true/false === explicit user choice that wins).
- lib/api.ts: fetchRoutingDefaults() boot fetch; chat() resolves the
effective model from pref + cached org defaults.
- App.tsx: authed AppShell fetches defaults once, caches + holds state.
- Usage.tsx: toggle uses resolveSmartRouting; locks off with copy
'Disabled for your organization' when auto_routing_active is false.
Resolver is mirrored (not imported) across app boundaries, matching the
three web apps; web copy carries the jest coverage. Typecheck + build
green.
Co-authored-by: Hanzo AI <ai@hanzo.ai>
New conversations resolve smart routing from the org's server-driven
defaults (GET /v1/chat/routing-defaults proxying cloud's
/v1/get-routing-defaults on-behalf-of) with the local toggle as a
nullable user override (null = follow org default). Fail-soft: an older
cloud-api (404), network error, or non-ok wrapper behaves exactly as
today (local preference only). When auto_routing_active is false the
toggle is locked with honest copy.
Effective state is one pure function, resolveSmartRouting
(client/src/utils/endpoints.ts), unit-tested in endpoints.spec.ts.
Co-authored-by: Hanzo AI <ai@hanzo.ai>
Web: 'Smart routing' toggle in the Usage settings tab, persisted via the
smartRouting localStorage recoil atom. When on, new conversations on the
Hanzo endpoint default to model "auto" (gateway routes each prompt to the
best/cheapest capable model; billed as whatever serves it). Scoped to the
Hanzo house endpoint and only applied to defaults — an explicit model pick
or a non-Hanzo provider family is never rewritten. Message header surfaces
the served model (msg.model) when a routed convo echoes it. Docs link +
en localization strings.
Mobile: same toggle on the Usage screen, persisted to localStorage via a
small settings helper; flips chat between VITE_CHAT_MODEL and "auto" in
lib/api.ts.
Backend: GET /api/usage (requireJwtAuth) aggregates this user's prompt+
completion Transaction spend over today/7d/30d plus a per-model breakdown,
enriched with the org tier from CommerceClient. Response mirrors the
@hanzo/usage UsageSnapshot shape (providerId 'hanzo', totals, providerCost)
for one wire format across Hanzo products.
Frontend: new Usage settings tab beside Balance, reusing the UsageBar idiom;
useGetUserUsage hook follows useGetUserBalance; en localization strings added.
The api jest winston mock returned the raw transform fn from
`winston.format(fn)`, so any `redactFormat()` call ran `fn(undefined)` and
crashed at `info.level`. `@librechat/data-schemas`'s own `config/winston`
calls `redactFormat()` at import time, so every backend suite that pulls in
`createModels`/`logger` failed to run ("Cannot read properties of undefined
(reading 'level')" at data-schemas parsers.ts:63).
Make the mock faithful to winston's contract: `format(fn)` returns a factory
that yields a Format instance (`{ transform: fn }`) — it never invokes the
transform at construction. On the models/strategies/Config slice this turns
20 fail-to-run suites into 20 passing (tests running 174 -> 681); the
level-throw is fully gone. Remaining failures are unrelated pre-existing
issues (DB-backed model tests, azureOpenAI config, role permissions).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The node:sqlite → better-sqlite3-multiple-ciphers driver swap made the store's
public type surface (SqliteHandle.db, DocModel.db, openDatabase) reference the
driver's shipped `Database.Database` type. That type is large and conditional-
generic-heavy (`prepare<...>` → `Statement<...>`). Because @hanzochat/api imports
@librechat/data-schemas' public types (253 files), the driver types entered api's
TS program and the checker's structural-relation pass exploded (recursiveTypeRelatedTo
/ instantiateType depth-limit storm): api's rollup type-check ran >27 min and CI
canceled it. Pre-swap, node:sqlite's DatabaseSync was absent from @types/node@20 so
it resolved to `any` — trivial surface, build completed in ~3 min.
Fix: declare the minimal better-sqlite3 surface the store actually uses
(exec/prepare/pragma/close, run/get/all) as a local `SqliteDatabase`/`SqliteStatement`
interface and use it in place of `Database.Database`; cast the lazy require to the
minimal ctor. Runtime is unchanged — the native handle satisfies the contract
structurally. Rebuilt data-schemas dist.
Local proof (Node 20):
- api tsc --noEmit: >27min/canceled -> 151s
- api rollup build (--max-old-space-size=6144, as Dockerfile): 98s, emits dist
- pnpm run frontend: completes end-to-end, exit 0
The prod hand-written model layer (api/models/*, separate from the data-schemas
methods) still constructed mongoose documents, which throw under the CHAT_STORE_SQLITE
flip where these models resolve to the SQLite DocModel/DualWriteModel:
- api/models/Transaction.js (createTransaction / createStructuredTransaction /
createAutoRefillTransaction): 'new Transaction(txData); ...; await transaction.save()'
-> a persistTransaction(txData, calculate) helper that runs the calculator FIRST
(it mutates rate/tokenValue/rateDetail in place, so ordering matters), strips the
non-schema calculator inputs (endpointTokenConfig/inputTokenCount/rateDetail) to
match mongoose's on-save strip, then Transaction.create(). Balance math, the
returned {rate,user,balance,[tokenType]} and result.transaction are unchanged.
- api/models/Role.js getRoleByName: 'new Role(defaults).save()' -> Role.create();
'.toObject()' is present on the created doc across all backends. The name-required
guard is untouched. Prevents 'Role is not a constructor' breaking RBAC self-heal.
Same bug class as the session P1; these are the actual prod paths (a DRY smell vs
the data-schemas methods — consolidation deferred). api-only; no data-schemas dist
change. The existing api Transaction/Role specs cannot run in this env due to a
PRE-EXISTING logger-mock harness break (reproduced on clean origin/main); the
identical persistTransaction pattern is proven green in data-schemas on both the
mongoose and SQLite/DualWrite stores.
Typing the store-resolved model as Model<IUser>/Model<ITransaction> (matching the
28 migrated domains) ballooned the inferred return of the methods that had NO
explicit return type — searchUsers, and getTransactions/deleteTransactions/
deleteBalances/createAutoRefillTransaction — past TS's serialization limit
(TS7056), so their factory .d.ts stopped emitting. Add explicit return types to
exactly those methods (pure type annotations + two no-op .lean() casts; zero
runtime change). Declaration emit is restored.
Rebuild the shipped dist (npm run build, exit 0): bundles + session/token/user
type declarations now carry the store-aware DataHandle signatures. Transaction
methods are internal (not in AllMethods), so they are tree-shaken from the bundle
and their .d.ts is not part of the shipped surface.
Adds authStore.sqlite.spec.ts (isolated native-sqlite spec): the REAL production
factories run against both served shapes the flip produces —
1) DualWriteModel (SQLite primary + SQLite mirror), and
2) the real createModels() wiring under CHAT_STORE_SQLITE (DocModel served).
Covers the exact regression (createSession no longer throws 'Session is not a
constructor'): createSession → findSession(refreshToken|sessionId) →
updateExpiration → generateRefreshToken(rotate) → deleteSession →
deleteAllUserSessions → countActiveSessions; createToken → findToken →
updateToken → deleteTokens (verify/reset + email normalization); createUser →
findUser → getUserById → updateUser → deleteUserById + Balance seeding;
createTransaction (debit + non-schema-field stripping) / createStructuredTransaction
/ createAutoRefillTransaction → getTransactions / findBalanceByUser /
deleteTransactions. Asserts refresh tokens stay hashed and the served model is
never a mongoose Model. Registered in test/ci.mjs ISOLATED (native driver).
14/14 green; the 101 pre-existing mongoose specs for the touched files still pass.
Same store-bypass class as Session: transaction.ts constructed documents with
new Transaction() + .save() (latent P1 — breaks identically once Transaction is
SQLite-served); user.ts + transaction.ts resolved their model via mongoose.models.
Refactor both factories to take a DataHandle and resolve via handle.models.<Name>.
Transaction create/auto-refill/structured now persist via the bounded .create()
(persistTransaction), stripping the non-schema calculator inputs
(endpointTokenConfig/inputTokenCount/rateDetail) so the persisted document is
byte-identical to the mongoose path (which strips non-schema paths on save);
balance math + returned TransactionResult unchanged. User already used .create()/
.findByIdAndUpdate(); only its model resolution moves.
createMethods now hands the real DataHandle to all four (User/Session/Token) —
the storeHandle mongoose-cast hack is removed; every domain resolves the store
uniformly.
Cold logins have been failing since Session was flipped to the SQLite store
(CHAT_STORE_SQLITE): createSession threw 'Session is not a constructor' because
session.ts used the mongoose-document constructor (new Session()) + doc.save(),
which the DocModel/DualWriteModel served under the flip do not implement.
Refactor createSessionMethods + createTokenMethods to take a DataHandle (the same
seam the 28 migrated domains use) and resolve their model via handle.models.<Name>.
Session create/rotate now use the bounded Model API: createSession generates the
_id up front (handle.Types.ObjectId), signs the refresh token bound to it, and
persists via .create(); generateRefreshToken (rotation) persists via .updateOne();
updateExpiration via .findByIdAndUpdate(). Refresh tokens stay hashed (hashToken),
JWT claims + expiry math unchanged, no session fixation. Token methods already used
the bounded API; only their model resolution moves off mongoose.models.
storeHandle (mongoose-cast) in createMethods still feeds these factories unchanged
(it is structurally a DataHandle); the caller cleanup follows in the next commit.
The 15 specs that instantiate the native better-sqlite3 driver corrupt each
other under a shared jest worker: jest gives each spec file its own JS module
realm while the native addon is process-cached per worker, so cross-file state
breaks sibling in-memory databases (driver-agnostic — reproduces with mainstream
better-sqlite3; a compound json_extract UNIQUE stops firing). Prod is unaffected
(one realm, one shared handle for the process lifetime).
test:ci now runs test/ci.mjs: the normal coverage pass for everything except the
native-driver set (via testPathIgnorePatterns), then each of those 15 specs in
its own jest process, exiting non-zero on any failure. NOT --runInBand /
maxWorkers=1 (a single shared worker still corrupts). No test weakening, no skips.
Bump chat 0.9.15 -> 0.9.16 (patch).
sharedSqliteHandle() reassigned sharedHandle on a collection-key change without
closing the prior connection — a latent native-handle leak on any rekey. Close
it before replacing, and export closeSharedSqliteHandle() so storeRegistry.spec
(rekeys twice) and tenantIsolation.coverage.spec tear the handle down instead of
leaking it past the file.
NOTE: this fixes the real leak the review identified, but does NOT resolve the
cross-file store-spec flake. That flake is a separate, deeper issue (see report):
driver-agnostic (reproduces with mainstream better-sqlite3 too), isolated to the
store's create path, timing/heap-sensitive (any probe masks it), and NOT fixed by
closing handles/GC/statement-cache/wrapper-pinning. Every store suite passes in
its own process; production (single long-lived handle, one module realm) is
unaffected.
node:sqlite (DatabaseSync) is a Node 22+ builtin; prod runs Node 20 (Alpine),
so require('node:sqlite') threw ERR_UNKNOWN_BUILTIN_MODULE, cascading through
createModels → applySqliteOverrides → openDatabase and breaking the built dist
("createModels is not a function"). Swap to better-sqlite3-multiple-ciphers
12.11.1 (engines include 20.x, synchronous drop-in, SQLCipher AES-256 at rest —
the Node embodiment of the hanzoai/sqlite contract).
- data-schemas dep + root pnpm.onlyBuiltDependencies allowlist (native addon);
rollup externalizes the driver.
- openDatabase(): lazy require of the driver, identical WAL/synchronous/
busy_timeout/foreign_keys pragmas. Wire the CHAT_SQLITE_KEY encryption seam
(SQLCipher cipher/legacy/key pragmas applied before any page-touching
statement; 64-hex validated, fail-closed; key/path never logged). KMS/CEK
derivation is Milestone 2.
- DocModel: retype db to the driver's Database instance; binding/return parity
already correct (booleans→1/0, dates→ISO, TEXT reads only). engine untouched
(27/27 held).
- parsers: restore the structured-logging-context impl dropped in an upstream
merge (spec #13110 landed without its parsers.ts) — appendRequestContext for
non-debug lines and drop the __SYSTEM__ tenant sentinel from debug traversal.
- models: register the SystemGrant model in createModels (schema/model/methods/
SQLite-spec + coverage guard all existed; only the registration was dangling).
Scrub all node:sqlite/DatabaseSync references from src (comments + spec names).
The SQLite store's update path feeds attacker-influenced keys ($set/$unset/
$inc/$push/$addToSet — conversation import, saveConvo, agent metadata) straight
into setPath, which walked cur['__proto__'] / cur['constructor'] and could mutate
a shared prototype (global prototype pollution). Reject any dotted path whose
segments include __proto__/prototype/constructor (and the single-segment own-key
case a JSON.parse'd body produces). Legitimate nested writes are unaffected.
engine.spec: +5 guard cases (dotted $set, constructor.prototype, JSON-sourced
own __proto__, $setOnInsert/$inc, legit nested still writes). 27/27 green on
Node 20 (pure-JS engine, no node:sqlite dependency).
The pnpm workspace does not hoist a bare @librechat/data-schemas symlink to
the app root where the backfill runs (node config/backfill-sqlite.js), so a
bare require throws MODULE_NOT_FOUND in the pod. Fall back to the workspace
path (packages/data-schemas). Verified: require('/app/packages/data-schemas')
resolves in the chat pod.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The Mongo→SQLite cutover, completed so chat-docdb can be DELETED with zero
data loss and an instant revert at every step.
- DualWriteModel: wraps a primary (served) + mirror model; reads/props fall
through to primary, the 10 write methods run on primary then replicate the
affected docs to the mirror KEYED BY THE PRIMARY'S _id (upsert if present,
delete if gone). Symmetric — same code mirrors mongoose->sqlite (pre-flip)
and sqlite->mongoose (post-flip escape hatch). Mirror failures are logged,
never thrown, so the served path can't break; gaps are caught by the
pre-flip count reconcile + the idempotent backfill.
- DocModel.upsertRaw: exact by-_id upsert (verbatim, no timestamp stamping) —
the shared primitive for the mirror AND the backfill, so live mirroring and
the one-shot copy converge on one keyspace without duplicating.
- Seam: applySqliteOverrides now honors TWO flags — CHAT_STORE_SQLITE (served)
+ CHAT_STORE_DUALWRITE (mirrored) — yielding the four cutover states. One
shared node:sqlite connection per process (was per-createModels-call).
- Route User/Session/Token through the handle (methods/index.ts) and add the
auth+billing CollectionSpecs (User/Session/Token/Balance/Transaction). These
are the collections actually populated in chat-docdb outside the 24 already
wired; User is the hot-path record every request loads and every conversation
references by _id, so it MUST move for a lossless Mongo delete.
- connectDb() is now Mongo-optional: unset MONGO_URI => SQLite-only mode, skip
the connection (final state, chat-docdb gone) with bufferCommands off so a
stray mongoose query fails fast instead of hanging.
- Dockerfile{,.multi,.static}: node:20/22-alpine -> ghcr.io/hanzoai/nodejs
:v24.18.0 (Node 24; node:sqlite built in, better-sqlite3 compiles).
- config/backfill-sqlite.js: one-shot Mongo->SQLite copy + count reconcile.
Tests: DualWriteModel.spec (10) green — mirror-by-primary-_id both directions,
read passthrough, bulkWrite, idempotent backfill, all 29 specs build.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(agents): raise cloud-agent run timeout 30s→180s (env CLOUD_AGENT_TIMEOUT)
A cloud agent run is a real chat completion — a zen5-mini answer routinely
takes ~25-30s (measured 28s), larger models/prompts longer. The hardcoded 30s
client timeout aborted long runs mid-flight, surfacing in the UI as a 502 even
though the cloud run finished and was recorded. Bump the default to 180s and
make it env-configurable (CLOUD_AGENT_TIMEOUT), matching the existing
CLOUD_AGENT_MAX_CONCURRENT knob. List/get are fast; this headroom only affects
/run.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* test(agents): lock cloud-agent run timeout contract (180s default + env override)
Adds coverage the timeout bump lacked: asserts the 180s default (the fix for
the 30s -> in-UI 502), that an explicit constructor timeout wins, and that
CLOUD_AGENT_TIMEOUT overrides the module-load default (isolated re-require).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
The unpinned depcheck (workflow installs latest each run) shifts which
@opentelemetry/* packages it reports: it flagged only @opentelemetry/core
before, now also exporter-trace-otlp-http and sdk-trace-base. All three are
transitive deps of @opentelemetry/sdk-node (imported/driven via NodeSDK in
packages/api/src/telemetry/sdk.ts), pinned top-level for otel version
alignment, none imported by name. Ignore the complete set so ROOT_UNUSED is
empty regardless of depcheck's version-dependent otel detection. Only
@opentelemetry/api is imported directly and stays checked.
Verified locally: with the three ignored, depcheck's root output contains only
@opentelemetry/api, which the workflow's used-in-code list subtracts -> empty.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
detect-unused-packages and detect-unused-i18next-strings each hard-fail on the
comment step because the ARC runners have no `gh` CLI (`gh api` -> exit 127), and
detect-unused-packages additionally flags @opentelemetry/core.
- Add .depcheckrc.yml ignoring @opentelemetry/core: it is a transitive
requirement of the otel stack in use (sdk-node / sdk-trace-base /
exporter-trace-otlp-http), intentionally version-pinned at the top level and
never imported by name, so depcheck reports a false positive. Verified locally:
with the ignore, depcheck no longer lists it (it was the sole ROOT_UNUSED item).
- Move both workflows' "post comment" step from `gh api` to
actions/github-script@v7 (Octokit + built-in token; jobs already grant
pull-requests: write). No dependency on a gh binary that isn't on the runner.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Genuinely unused: defined only in en/translation.json, referenced nowhere in
code (the sibling com_agents_cloud_* keys are all used; this section-header
string never shipped a consumer). Its presence was the sole finding of the
detect-unused-i18next-strings workflow, which hard-fails on any unused key.
Removing it makes that check pass without weakening it.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Two pre-existing, repo-wide CI failures that reddened main and every PR:
1. test.yml / e2e.yml OOM'd building packages/api (rollup peaks ~5 GiB RSS;
Node's default ~2 GiB old-space heap => "heap out of memory", exit 134).
Add the same NODE_OPTIONS heap knob backend-review.yml/frontend-review.yml
already use (6144, well under the 8 GiB runner limit). Verified: build:api
completes in ~54s at 6144 (peak RSS 4.98 GiB); it OOMs at 3072.
2. test-linting.yml ("LiteLLM Linting") lints a litellm/ Python dir that does
not exist in this repo and runs `poetry install` with no pyproject.toml, so
it always failed at "Install dependencies". Pure upstream LibreChat/LiteLLM
residue — the real JS lint is eslint-ci.yml ("Run ESLint Linting"), which
passes. Remove the dead workflow.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Node >= 22.5 ships `node:sqlite` (DatabaseSync), which the SQLite document
store requires once CHAT_STORE_SQLITE / CHAT_STORE_DUALWRITE is enabled.
Dockerfile.static was already node:22-alpine; this brings the runtime image
to parity. The store lazy-requires node:sqlite (stores/sqlite/index.ts), so
with the flag unset the runtime boots unchanged — this is a pure Node bump,
no SQLite enabled.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(mcp): restore drifted ~/auth SSRF/allowedAddresses helpers
The tests + callers (hardenedFetch, MCPOAuthHandler, MCP connection) already
expected the port-scoped allowedAddresses SSRF surface (LibreChat #12933/#13022),
but domain.ts/agent.ts had been reduced to the pre-#12933 versions while their
specs were trimmed to match — a tests-without-impl drift babel hid at test time.
Restore the upstream pair (matched impl + spec):
- domain.ts: isAddressAllowed; 3-arg resolveHostnameSSRF/isSSRFTarget (allowed
host:port exemption); isOAuthUrlAllowed; validateEndpointURL; port-scoped
isMCPDomainAllowed fail-closed on unparseable allowlisted URLs.
- agent.ts: createSSRFSafeUndiciConnect(allowedAddresses, port) + allowedAddresses
connect-time exemption (fixes the dead 2-arg call in hardenedFetch.ts).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(mcp): restore circuit-breaker config + OAuth reconnection cooldown
mcpConfig gains the CB_* connect/disconnect circuit-breaker knobs and
OAuthReconnectionTracker regains its progressive cooldown (5m/10m/20m/30m capped)
that reconnection-storm.test.ts asserts. Both were trimmed while their tests
stayed at the upstream version.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(mcp): finish connection.ts transport port — proxy, response caps, WS SSRF
Completes the half-ported MCP connection/transport layer (LibreChat
#13076/#13219/#13224/#13274). The test suite (MCPConnectionSSRF,
MCPConnectionAgentLifecycle, reconnection-storm) was byte-identical to upstream
but the implementation stopped at the redirect-SSRF guard, leaving 22
tests-without-impl in MCPConnectionSSRF alone.
- Proxy support: serverConfig.proxy + PROXY/HTTP(S)_PROXY env with full NO_PROXY
semantics (wildcard, CIDR, IP-range, IPv6, host-suffix, port scoping); per-URL
ProxyAgent/Agent dispatcher selection tracked in this.agents; recomputed across
redirects; proxied-target SSRF preflight (IP literal -> resolveHostnameSSRF,
hostname -> allowedAddresses exemption or reject).
- Response-size caps: guardStreamableHTTPResponses opt-in wraps the body stream
with MCP_STREAMABLE_HTTP_MAX_RESPONSE_BYTES + MCP_STREAMABLE_HTTP_MAX_LINE_BYTES,
emitting a JSON-RPC error SSE frame instead of unbounded buffering.
- WS SSRF: resolveHostnameSSRF(host, allowedAddresses, port) now runs regardless
of useSSRFProtection (allowlist deployments), closing DNS-rebind to private IPs.
- Connect-lifecycle circuit breaker + agent cleanup (closeAgents) on disconnect.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(mcp): accept proxy + sseReadTimeout in MCP server config schema
Adds ProxyUrlSchema (http/https/socks, env-var resolved) to SSE/streamable-http
options and sseReadTimeout to the base schema so connection.ts's proxy/idle-read
support is reachable from real config. proxy is admin-only: z.never() in the
UI/API user-input schema.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* ci(chat): gate MCP connection/transport suite in the primary test workflow
Root cause of the drift: test.yml (the Hanzo-active CI) only ran 'test:api'
(the api/ Express dir) and 'test:client' — packages/api tests never ran here, so
the connection.ts port could drift from its byte-identical tests unnoticed.
Add packages/api 'test:transport' (MCPConnection*, MCPRedirectSSRFGuard,
reconnection-storm, MCPManager, auth domain/agent SSRF specs, hardenedFetch,
OAuthReconnection*) and run it in test.yml. A future half-port of the transport
layer now fails CI loudly. No .skip's exist in these suites; nothing un-skipped.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Root cause of new chats never titling: the title path invokes the model
NON-streaming (stream:false). The Hanzo Cloud gateway returns a valid
{choices:[{message}]} body, but the pinned langchain ChatOpenAI parses that
non-streaming body to ZERO generations, so invoke() throws
'Cannot read properties of undefined (reading \'message\')' and no title is
saved. Every agent RUN already streams (SSE), which parses the same gateway
correctly — that is why generation works but titles did not.
Force clientOptions.streaming = true in #titleConvo (after the omitTitleOptions
filter, which strips 'streaming'). Verified against the live gateway with Dave's
per-user key: streaming=true -> clean title; streaming=false -> the crash.
Pairs with the zen5-flash repoint (fast, non-reasoning): streaming fixes the
parse for all models; zen5-flash keeps the call under the 45s title timeout
(zen3-nano/qwen3-8b took ~60s).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
New chats didn't reliably auto-title: zen3-nano maps to the reasoning model
qwen3-8b (live upstream), which took 16-31s per title — routinely near the
45s #titleConvo timeout. The other 6 families pointed titleModel at
third-party names (llama-3.1-8b, qwen3-coder-flash, ...) that are NOT in the
live gateway catalog, so they returned a 200 error-envelope.
Repoint every family's titleModel (and the Hanzo summaryModel) to zen5-flash:
a fast, NON-reasoning, in-catalog model (live upstream deepseek-4-flash) that
returns a clean single-line title in ~1-2s. Picked by direct api.hanzo.ai/v1
probes: zen5-flash ~1.5s clean; zen3-nano 16-31s; zen5-mini 10-20s; zen5 /
zen3-vl >40s; zen5-nano not servable.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Hanzo Cloud gateway answers some failures with HTTP 200 + a JSON
error-envelope ({status:"error", msg}) that has no `choices`. On the
title path the OpenAI client parsed that 200 to `undefined` and
#titleConvo threw `Cannot read properties of undefined (reading 'message')`,
so new conversations never got a title.
Apply the same wrapHanzoGatewayFetch rewrite agent runs use, now explicitly
on the title client's fetch, so the envelope becomes a clean 402 the outer
try/catch skips gracefully. Export the wrapper from @hanzochat/api; the
re-wrap is idempotent (a second pass sees a 402, not a 200 envelope) and
response-only, so per-user hk- billing and normal completions are untouched.
Adds an idempotency unit test (7/7 pass).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The #titleConvo path no longer 404s (zen5-nano was off-catalog), but full
auto-title still needs a follow-up: zen3-nano reasons past the 45s title timeout,
and off-title-path models (e.g. llama-3.1-8b) return a 200 error-envelope the
title client mis-parses. Needs the gateway-envelope rewrite on #titleConvo + a
fast non-reasoning title model. librechat.yaml is the source the chat-config
ConfigMap is generated from (not used at runtime; CONFIG_PATH=/app/chat.yaml).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Custom endpoints resolve their icon via getIconKey -> 'unknown' -> UnknownIcon
(by endpoint NAME), not icons[custom] — so the earlier icons[custom] remap was
inert (reverted). The Hanzo house endpoint had no asset/iconURL match and fell
through to the generic lucide "bot". Now:
- 'hanzo'/'zen' -> ZenLogoIcon (ensō), matching the assistant message avatar,
on the welcome screen + model pill + picker menu.
- qwen/google-gemma/openai-gpt-oss -> real provider marks by name (the
KnownEndpoints enum lacks those keys). DeepSeek/Mistral logos unchanged.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Welcome heading: tracking-tight for crisp large-display type (Linear/Vercel).
- Code blocks: hairline-bordered true-black surface (rounded-lg, border-medium,
#0a0a0a) with a subtle bottom-bordered header instead of the heavier grey bar;
reads calm + monochrome now that code renders in Geist Mono.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Zen ensō (円相) replaces the generic lucide "bot" for the custom Zen endpoint:
welcome screen, model pill and menu icon now match the assistant avatar.
- Monochrome avatars: collapse the colorful DiceBear palette to a neutral grey
ramp (the green "GU" guest chip is gone), and neutralize the periwinkle
no-seed fallback in Icon/Avatar.
- Kill the stray "(" glyph: the right control-panel NavToggle handle was floating
mid-edge at 0.25 opacity; now invisible until hover (header controls remain).
- Model-picker menu separator used cool border-slate-*; now neutral border-light.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Hard-default to dark (true-black) unless the user explicitly picks light:
ThemeProvider getInitialTheme + index.html no-flash script now default dark,
and the loading canvas is true #000 (was blue-tinted #070b13). theme-color #000.
- Crisp type: font-synthesis:none + antialiased. Basel ships 400/500 only, so
faux-bold was blurring headings; hierarchy now comes from size + the real
Medium face. Code now renders Geist Mono (was forced to Consolas via !important).
- Auto-title: repoint titleModel/summaryModel zen5-nano -> zen3-nano (zen5-nano
isn't in the live /v1/models catalog, so #titleConvo 404'd and new chats never
auto-titled). zen3-nano is the known-good guest/test model.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Root cause: commit 46b636c8c0 (server-side anonymous guest chat) added
GUEST to the SystemRoles enum and stamped guest JWTs with role=GUEST, but
never added a roleDefaults[GUEST] entry nor seeded the role. Every guest
generation ran checkAccess -> getRoleByName('GUEST'), which missed the DB,
fell into the self-heal branch `if (!role && SystemRoles['GUEST'])`
(truthy) and called `new Role(roleDefaults['GUEST']).save()` ===
`new Role(undefined)` -> "Role validation failed: name: Path `name` is
required" -> the whole generation threw. Since the logged-out landing IS
the guest composer (0.9.3), nearly every visitor hit this.
Fix (three orthogonal parts):
- data-provider/roles.ts: add the missing roleDefaults[GUEST] (named,
mirrors USER's minimal grant; guest scope is enforced by
enforceGuestScope middleware, not by these permissions).
- data-schemas initializeRoles: seed GUEST at boot alongside ADMIN/USER so
it is deterministic, not lazily created.
- models/Role.js: gate the self-heal create on roleDefaults[roleName]
(possessing the canonical defaults) instead of SystemRoles[roleName]
(mere enum membership). roleDefaults entries always carry a name, so a
nameless create is now structurally impossible.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Uniform "build an app" entry across chat -> app -> console. One pure module
(utils/buildApp.ts) is the single source of the hanzo.app builder wire
(hanzo.app/dev?prompt=) and the `/build [prompt]` command grammar; every
surface funnels through it (DRY).
Phase 1 (ships): the hanzo.app handoff, reachable three ways —
- `/build [prompt]` slash command, intercepted in ChatForm.onSubmit
- "Build this as an app" action on assistant messages (HoverButtons)
- the inline preview pane's "Open in App" CTA
All open https://hanzo.app/dev?prompt=<encoded> in a new tab (noopener).
Phase 2 (scaffold): inline build mode. A `buildMode` recoil flag toggled by the
composer "Build an app" button (BuildAppButton) makes ChatView render a
stripped-down split — chat thread on the left + a side preview pane
(BuildApp/BuildPreviewPane) on the right. The pane is a placeholder whose CTA is
the Phase 1 handoff, seeded live from the composer text. A `/build` route
deep-links into build mode (seeds the composer from ?prompt=/?q=). When buildMode
is off, ChatView renders byte-identical to before (zero regression to normal chat
or the guest landing). Phase 3 (real inline codegen/preview) is documented inline.
9 unit tests for buildApp (url + command grammar). Guest flow untouched.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The SQLite DocModel store statically `import`s `DatabaseSync` from
`node:sqlite` at the top of `stores/sqlite/{index,DocModel}.ts`. That module
is re-exported by the data-schemas package index, which the API server loads
at boot — so the eager `require('node:sqlite')` in the bundled dist runs
unconditionally. `node:sqlite` only exists on Node >= 22.5; the runtime image
is node:20-alpine, so boot dies with
`ERR_UNKNOWN_BUILTIN_MODULE: No such built-in module: node:sqlite`
(crashloop) — independent of the store's inert-by-default flag.
The store is only ever exercised when `CHAT_STORE_SQLITE` is set (a CSV of
collections), via `createSqliteHandle` -> `openDatabase`. Make the import
lazy: `import type` for the erased type references, and a single
function-scoped `require('node:sqlite')` inside `openDatabase`. Module load
no longer touches the builtin, so the server boots on Node 20 with the store
inert; when the flag is set (on a Node >= 22.5 runtime) it works verbatim.
Proven: rebuilt dist has no module-scope require; loading dist/index.cjs with
`node:sqlite` blocked (simulated Node 20) succeeds, and openDatabase() still
defers to the builtin only when actually opening a database.
Unblocks deploying any main-based image (incl. the 0.9.5 guest-chat fix).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Two anonymous-guest client bugs, both proven with live Playwright.
BUG A — guest can't SEND ("Unknown endpoint: Hanzo"):
`new QueryClient()` was built in App's render body, so every re-render
minted a fresh EMPTY client. A guest's expected 401s (mcp/servers,
files/config, keys?name=Hanzo, …) fire the queryCache `onError` →
`setError` → App re-render → the provider swaps in an empty client. The
lazy chat-form's `useChatFunctions` then reads `getQueryData([endpoints])`
off an endpoints-less client, so the custom `Hanzo` endpoint resolves with
`endpointType === undefined` and `parseCompactConvo` throws
"Unknown endpoint: Hanzo" — the completion POST never happens. Backend is
correct: guest token → /v1/chat/endpoints={Hanzo:{type:custom}},
/v1/chat/models={Hanzo:[zen3-nano]}. Fix: stabilize the client with
`useState(() => new QueryClient(...))` — one client, one cache, every
consumer (incl. the lazy chunk) shares the populated store.
BUG B — intermittent first-load /login redirect:
The axios 401 interceptor hard-`window.location.href`'d to /login whenever
a one-shot refresh yielded no token. On a cold visit the guest bearer is
still in flight (`isGuestSession()` false because there's no bearer yet),
so an early expected 401 bounced the visitor to /login, racing the
guest-acquire. Fix: only hard-redirect when a real *session* bearer is
actually present (`currentBearer() != null && !isGuestSession()`); an
anonymous cold-start with no bearer is left to routing/the login gate.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The axios 401 interceptor hard-redirected to /login whenever a one-shot
refresh yielded no token. A guest (anonymous preview) session carries a
{guest:true} JWT that is valid ONLY on the chat-completion route; every
other endpoint (/api/mcp/servers, /api/files/config, ...) answers 401 by
design. Those expected 401s bounced the guest to /login, wiping the guest
session in an infinite loop, so the landing never rendered the composer.
Derive guest-ness from the active bearer (isGuestSession) and skip the
hard redirect for guests — real users with a truly-expired session still
redirect. Fixes anonymous-guest landing on hanzo.chat.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Enables 'generate an image of X' to render a real image inline through the
DALLE3 agent tool pointed at the Hanzo gateway (/v1/images/generations):
- DALLE3.js: model is configurable (DALLE3_MODEL, e.g. zen3-image); DALL-E-3-only
knobs (quality/style) are sent ONLY for a dall-e model so the Hanzo image
backend never sees a param it would reject. Agent path already fetches the
result server-side and returns it inline (upstream host never reaches client).
- handleTools.js: dalle is now a custom constructor that injects the signed-in
user's PER-USER hk- key (resolveHanzoCloudKey) so image generation is metered
to them — mirroring the chat per-user key path. Guests keep the shared key;
an authed user whose key can't be resolved FAILS CLOSED (no shared-org spend).
Deploy also sets env DALLE_REVERSE_PROXY=https://api.hanzo.ai/v1/images/generations
and DALLE3_MODEL=zen3-image. Zen-brand model id only; upstream never surfaced.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(data-schemas): pure Mongo-shaped query/update engine for SQLite store
Correctness core of the mongoose->SQLite migration seam: pure, I/O-free
matchesFilter / applyUpdate / projectDoc / sortDocs implementing the exact
Mongo operator subset the chat data methods use ($eq $ne $in $nin $gt/$gte
$lt/$lte $exists $regex $not $and $or $nor; $set $unset $setOnInsert $inc
$push $pull $addToSet). Date-aware comparison, mongo null/absent semantics.
21 unit tests green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(data-schemas): SQLite DocModel + handle backing the Model API on node:sqlite
DocModel presents the Mongoose Model-API subset the chat data methods use
(findOne/find/findOneAndUpdate/updateOne/updateMany/deleteMany/deleteOne/
countDocuments/distinct/create/insertMany/bulkWrite + chainable QueryBuilder
with select/sort/limit/skip/lean/deleteMany). Docs stored as JSON via node:sqlite
(stdlib, zero new dep); JSON1 expression indexes on unique/anchor fields; exact
mongo semantics delegated to the pure engine; date rehydration on read; no
mongoose, no tenant middleware (Conversation/Message are not tenant-plugged
upstream). createSqliteHandle() returns a mongoose-shaped handle the unchanged
method factories run against. 7 adapter tests green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(data-schemas): prove conversations+messages fully off mongoose on SQLite
- Decouple message.ts + conversation.ts from the mongoose package: factories now
take a structural DataHandle ({models}) satisfied by BOTH mongoose and the
SQLite handle. Only type-only imports from 'mongoose' remain; zero runtime
mongoose in the data path for this domain.
- engine: type-aware operand coercion so cursor pagination (String(Date) operand
vs Date field) compares chronologically, mirroring mongoose schema casting.
- convoMessage.sqlite.spec: 14 tests running the REAL createMessageMethods /
createConversationMethods against createSqliteHandle — save/upsert, get,
update, delete, deleteMessagesSince, cursor pagination, bulk, archived +
retention-visibility filtering, getConvosQueried, cross-collection deleteConvos,
deleteNullOrEmptyConversations, searchConversation. All green.
Isolates one unrelated pre-existing fork gap via jest mock: this tree's
librechat-data-provider never synced the RetentionMode enum (upstream #13049),
so message.ts/conversation.ts reference an undefined export on the mongoose path
too. Documented for separate fix.
42/42 store tests green (engine 21 + DocModel 7 + contract 14).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(data-schemas): registry-aware createModels + store exports (the seam)
createModels now applies per-domain backend selection via CHAT_STORE_SQLITE
(CSV of collection names -> SQLite DocModel). Unset default = pure mongoose,
live path unchanged; only collections with a CollectionSpec are overridable
(fails closed otherwise). Exports createSqliteHandle/DocModel/CollectionSpec/
DataHandle from the package index. node:sqlite + node:crypto added to rollup
externals. Package builds clean (rollup, EXIT=0); 45/45 store+registry tests green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* chore(data-schemas): drop local build artifacts + shared-deps symlink from branch
Revert dist/* to base (CI rebuilds bundles deterministically — no local builds)
and untrack the packages/data-schemas/node_modules dev symlink. Source-only branch.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(data-schemas): Batch 2 — Preset, ConversationTag, SharedLink on SQLite
Migrate three self-contained, non-tenant-plugged chat-document domains onto the
DocModel store behind the same seam. Decouple their factories to DataHandle;
createMethods now passes a registry-aware handle to createShareMethods so the
CHAT_STORE_SQLITE flag flips Share (pattern-2) in the live path too.
DocModel extensions (all reusable for later batches):
- compound unique indexes (ConversationTag {tag,user})
- ObjectId-ref casting on write + cross-collection .populate() (SharedLink.messages -> Message)
- findByIdAndUpdate / findOneAndDelete; findOneAndUpdate is now a chainable
QueryBuilder (mutate mode) so .lean()/.select()/.populate() chain after a write
- schema defaults on insert (SharedLink.isPublic:true)
engine: mixed-update semantics (top-level fields fold into $set) + $pullAll.
Contract specs run the REAL createPreset/ConversationTag/Share methods against
createSqliteHandle. 60/60 store+contract+registry tests green; rollup build EXIT=0.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(data-schemas): Batch 3 — Project on SQLite + realtime-vs-storage finding
Project migrated (pattern-1, registry-aware): add DocModel.findById; CollectionSpec
with array defaults; contract spec mirrors api/models/Project.js exact ops
(getProjectByName upsert, $addToSet $each, $pull $in, updateMany $pull).
Prompt/PromptGroup deferred with rationale: they construct mongoose.Types.ObjectId,
use an aggregate $lookup/$unwind pipeline + populate + manual tenant/ACL
(accessibleIds: ObjectId[]) — need an aggregate primitive, not the mechanical
recipe. Categories read-path is already mongoose-free (getCategories is static).
REALTIME finding (verified codebase-wide): chat has ZERO Mongo change-streams /
tailable cursors / .watch(). Its realtime is SSE token streaming (sendEvent /
agent GenerationJobManager) tied to the generation request — application layer,
DB-independent. So NO migrated domain needs a DB-subscription replacement; plain
node:sqlite is correct for all. Hanzo Base realtime is reserved for future
DB-driven push (multi-device live sync, presence, collab sessions) — none today.
Documented at the storage-decision source (collections.ts).
63/63 store+contract+registry green; rollup build EXIT=0.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(data-schemas): Batch 4 — File, Key, PluginAuth, Banner on SQLite
Migrate four non-tenant storage domains onto the DocModel store. Decouple their
factories to DataHandle; createMethods passes the registry-aware handle to
File/Key/PluginAuth (pattern-2); Banner is pattern-1 (~/db/models).
- Key: encrypted roundtrip proven (updateUserKey encrypt -> getUserKey decrypt)
against SQLite; CREDS_KEY/IV set via jest setupFiles (runs before module load).
- PluginAuth: replaced a redundant `new Model().save()` else-branch with
Model.create (equivalent on mongoose, part of the shared Model API — DocModel
supports it). No behavior change.
- Realtime directive recorded: Conversation+Message are the Base-realtime cutover
targets ("Base for realtime, SQLite for storage"); all other migrated domains
are pure storage. Empirically chat has zero Mongo change-streams (realtime=SSE),
so the SQLite store is correct in the interim; Base swap is backend-only.
MCPServer deferred (constructs mongoose.Types.ObjectId + _id ObjectId cursor).
70/70 store+contract+registry tests green; rollup build EXIT=0.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(data-schemas): Batch 5 — tenant-aware DocModel variant + Config on SQLite
Add tenant isolation to the store, mirroring the mongoose applyTenantIsolation
plugin, gated by CollectionSpec.tenantIsolated (unlocks Config/Skill/SkillFile/
SystemGrant):
- scopeFilter: every read/write filter scoped to getTenantId() (SYSTEM bypasses;
no-tenant + TENANT_ISOLATION_STRICT=true fails closed) — wired at the single
candidates() chokepoint.
- stampTenant: inserts stamped with tenantId (create/insertMany/upsert).
- sanitizeTenantUpdate: update payloads cannot mutate tenantId (throws cross-tenant;
strips from $set/$setOnInsert/$unset/top-level) — wired into
mutateOne/updateOne/updateMany/bulkWrite.
Config migrated (compound unique {principalType,principalId,tenantId}); decouple
createConfigMethods to DataHandle; QueryBuilder.session() no-op (single connection).
Fix: anchorWhere binds booleans as 1/0 (node:sqlite rejects JS booleans; json_extract
returns 1/0) — hardens every boolean-filtered collection.
batch5 contract spec proves cross-tenant isolation with REAL createConfigMethods:
per-tenant stamping, identical principals isolated across tenants, tenant-scoped
list/find, no cross-tenant delete. 74/74 green; rollup build EXIT=0.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(data-schemas): Batch 6 — SystemGrant on SQLite + ObjectId read-coercion
SystemGrant migrated (tenant-plugged, same recipe as Config): CollectionSpec with
compound unique {principalType,principalId,capability,tenantId} + tenantIsolated;
add DocModel.exists(); decouple createSystemGrantMethods to DataHandle.
Add ObjectId read-coercion to the engine (coerceId): filters carrying real
mongoose ObjectId operands (SystemGrant.normalizePrincipalId casts USER ids to
Types.ObjectId) now compare against the hex strings the store persists (docs
stringify ObjectIds to hex; _ids are ObjectId-hex). Applied in comparable /
valueEquals / anchorWhere. This is the shared primitive that unblocks the
ObjectId-coupled domains (Skill/SkillFile, MCPServer, Prompt/PromptGroup).
Contract spec runs REAL createSystemGrantMethods with USER principals
(ObjectId path exercised end-to-end): grant/has(exists)/revoke, idempotent upsert,
platform-vs-tenant isolation. 77/77 green; rollup build EXIT=0.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(data-schemas): Batch 7a — ObjectId shim + MCPServer, Skill, SkillFile
Add handle.Types.ObjectId shim (thin: store _ids are already ObjectId-hex,
coerceId resolves comparison/storage): a 24-hex ObjectId class with toHexString/
toString/toJSON/equals/isValid, exposed as SqliteHandle.Types and typed on
DataHandle.Types. createMethods' dbHandle now carries mongoose.Types (real
ObjectIds coerce too).
- MCPServer (pattern-2): full real-method spec — create / findByServerName /
findByObjectId (findById + ObjectId operand) / byAuthor / update / delete +
unique serverName. Decouple models + Types to handle; wired via dbHandle.
- Skill/SkillFile (tenant-plugged): decouple models + Types to handle; storage
contract proven — compound unique, ACL _id-in-accessibleIds ObjectId filtering
via coercion, SkillFile upsert. Their 800-line ACL/validation method layer
rides on these ops (full harness = follow-up).
81/81 green across 10 suites; rollup build EXIT=0.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(data-schemas): Batch 7b — aggregate primitive + Prompt, PromptGroup
Add DocModel.aggregate supporting the bounded stage set the chat methods use
($match / $lookup / $unwind / $sort / $limit / $project), run in JS over
candidate docs; $lookup resolves the mongo collection name to a sibling model
(prompts -> Prompt) and joins via the shared engine. Fix deepCoerceIds: coerce
ObjectId-like values to hex BEFORE structuredClone in create/insertOne (clone
was stripping the shim's methods, serializing productionId as an object husk).
Prompt / PromptGroup migrated (pattern-1): decouple models + Types to handle;
CollectionSpecs with productionId/prompts refs. Contract spec proves the
aggregate primitive directly AND the REAL getPromptGroup end-to-end (casts _id
-> ObjectId, $lookup productionId -> Prompt, $unwind preserveNullAndEmptyArrays).
All storage-tier domains are now on the DocModel. 85/85 green across 11 suites;
rollup build EXIT=0.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(data-schemas): Skill/SkillFile full-method harness + findOneAndUpdate(new:false) fix
Close the Skill/SkillFile proof gap: real createSkillMethods with stub ACL deps
(PermissionService injected) — createSkill (validation + uniqueness), getSkillById,
getSkillByName(accessibleIds ObjectId ACL), updateSkill optimistic version bump,
deleteSkill (+ removeAllPermissions), and SkillFile upsert (new-vs-replace) /
getByPath / list. Skill + SkillFile now fully proven, not just storage-proven.
Fix mutateOne: findOneAndUpdate(new:false, upsert:true) now returns null on an
insert (no pre-image) and the old doc on update — mongoose semantics that
upsertSkillFile's atomic new-vs-replace fileCount detection depends on. Locked
with a direct DocModel.spec test. All prior findOneAndUpdate upserts use new:true
(unaffected).
89/89 green across 12 suites; rollup build EXIT=0.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(data-schemas): Batch 8a — 7 chat-native domains on SQLite
Migrate MemoryEntry, ToolCall, Assistant, Action, AccessRole, Role, AgentApiKey
onto the DocModel store (mechanical: no external subsystem owns them — cloud
/v1/agents is additive, there is no /v1/memory, and app-domain authz has no IAM
equivalent). Decouple all 7 factories to DataHandle; createMethods passes the
registry-aware handle to Role/Memory/AgentApiKey/AccessRole (pattern-2).
Adapt role.initializeRoles off the `new Role().save()` mongoose-document pattern
to the shared Model API (findOne/create/updateOne) — equivalent on both backends.
Contract spec runs the REAL methods: memory set/create(dup-throws)/list/delete,
toolcall create/get/byConvo/delete, assistant/action upsert+get+delete, accessRole
create/find/list/delete, role initializeRoles seeds + listRoles, agentApiKey
create/validate(hash)/list. 96/96 SQLite-spec tests green; rollup build EXIT=0.
(Pre-existing mongoose specs fail identically on base — fork gaps, out of scope.)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(data-schemas): Batch 8b — Agent, AgentCategory, AclEntry, Group on SQLite
Migrate the ObjectId/aggregate/ACL chat-native domains. Decouple factories to
DataHandle (models + Types); wire AgentCategory/AclEntry/UserGroup through the
registry handle. Agent uses the ObjectId shim (version tracking, _id cursor);
AgentCategory uses the aggregate primitive; AclEntry uses bitwise permission
queries; Group links members by id.
Store primitives added/fixed (all reusable):
- aggregate $group (with $sum/$first/$last/$max/$min/$push/$addToSet) — powers
AgentCategory.getCategoriesWithCounts.
- bitwise operators $bitsAllSet/$bitsAnySet/$bitsAllClear/$bitsAnyClear — powers
AclEntry.hasPermission.
- applyUpdate deepCoerceIds the upsert seed (ObjectId shims survived to storage
as hex, fixing findOneAndUpdate-upsert with ObjectId filter fields).
- array-safe index anchor: json_each(...) EXISTS replaces json_extract= so
{field: value} over an ARRAY field (Mongo array-contains, e.g. Group.memberIds,
tags, projectIds) hits the index instead of being excluded by the prefilter.
Contract spec runs REAL methods: agent create/get/update/delete, category $group
counts, acl grant/has(bitwise)/revoke, group create/find/addMember/getUserGroups.
100/100 SQLite-spec tests green across 14 suites; rollup build EXIT=0.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(billing): chat→commerce debit wiring behind COMMERCE_WRITES (default OFF)
Step 2 of the money migration. Default OFF = current local-Mongo billing path
runs byte-for-byte; the Commerce-first fail-closed READ gate is unchanged.
CommerceClient (the previously-dead write methods, now correct):
- recordUsage now debits the billing SUBJECT (billingSubject(owner,email)) — not
the Mongo user id — with amountMicros (lossless micro-USD; commerce rounds to
nearest cent + records exact micros) + requestId (stable per-spend idempotency
key → no double-debit) + totalTokens/provider.
- _flushUsageQueue now passes X-Hanzo-Org per entry (was omitted → debits hit the
wrong tenant and never netted the balance the gate reads). Fixed.
- add deposit() for credits (POST /v1/billing/deposit).
Wiring (flag-gated, additive, fail-open):
- commerceWrites.js: COMMERCE_WRITES gate + recordCommerceDebit (never throws
into the spend path; local Mongo authoritative until cutover).
- createTransaction: after the local debit, ALSO record to commerce when the
flag is ON and the request threaded `subject` (tokenValue is micro-USD;
transaction _id is the idempotency key). Inert until subject is threaded + the
flag flipped.
Tests (executed, PASS): CommerceClient.spec — recordUsage builds the right body
(subject/amountMicros/requestId/totalTokens) + X-Hanzo-Org header, no _namespace
leak; the flag gate is OFF by default.
REMAINING (gated): thread `subject` into txMetadata at the spendTokens call
sites; wire credits (deposit/grantStarter); Step-3 live-verify; then retire local
writes behind the flag. Local Balance/Transaction writes are NOT retired.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(billing): revert chat→commerce debit — the gateway is the single debit authority
The COMMERCE_WRITES chat-debit hook (bf6302a72c, today) is a double-debit
footgun and is reverted. It contradicts the established, LIVE architecture:
- hanzoCloudKey.ts (module doc): every IAM user has one hk- Cloud key; "the
cloud gateway (api.hanzo.ai) debits that key's org commerce balance and
returns 402 when the org runs out. Forwarding the right per-user key ===
correct per-user billing automatically." initialize.ts forwards that key on
every authed request (baseURL api.hanzo.ai/v1).
- packages/api usage.ts (NOTE, 2026-06-27): a prior chat→commerce write in
recordCollectedUsage was a SECOND debit to a mis-keyed account; it was
REMOVED. "Chat must NOT also record usage to Commerce."
- prod CR universe/.../crs/chat.yaml: HANZO_PER_USER_KEY=true, balance gate
off, and in its own words "chat records NO usage to commerce (that write was
removed); the single debit is still cloud's, per the user's hk- key."
Two writers to one ledger for one spend = double charge. The gateway is the ONE
debit authority for AI spend across every product (chat/code/agents/API); a
per-client debit path is the wrong DRY seam. So chat stays a READER of Commerce.
Removed (the whole unused chat→commerce WRITE surface):
- api/models/commerceWrites.js (the COMMERCE_WRITES gate + recordCommerceDebit)
- the recordCommerceDebit call + import in Transaction.js (now a comment
stating the single-debit invariant)
- CommerceClient.recordUsage (the debit) + its now-dead _usageQueue /
_flushUsageQueue machinery + interval; deposit/grantStarter (unused credit
helpers — the real first-chat grant is resolveHanzoCloudKey's direct POST
/v1/billing/grant-starter in packages/api, the correct layer)
- CommerceClient.spec.js (only tested the removed surface)
Kept (CommerceClient is now purely read-only, one responsibility):
checkBalance (fail-closed money gate), getTierConfig, isModelAllowed,
getCreditBreakdown — all live (balanceMethods.js, Balance.js).
Verify: node --check clean on both edited files; zero dangling references to the
removed symbols repo-wide; balanceMethods.spec mocks only the kept READ surface.
Money domain off-Mongo status after this: Commerce (via the gateway) is the
balance/debit authority — no Mongo Balance/Transaction WRITE is authoritative in
prod (gate off). The local Transaction doc remains an in-app usage log only;
retiring/relocating it to the SQLite store is tracked with the cutover.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(identity): User is a thin IAM projection — drop the local password credential (step a)
Identity migration step (a): IAM (hanzo.id) owns identity; chat's User doc is a
thin OIDC-keyed projection (provider='openid', openidId=userinfo.sub, org from
userinfo), never a second credential store.
Confirmed no OIDC path writes a password: openidStrategy.js (508-523) and
process.js createSocialUser build the User with NO password; createUser
(packages/data-schemas) writes no default; the schema field was select:false.
The ONLY writers were two local-email flows, both gated OFF in prod
(ALLOW_REGISTRATION=false, ALLOW_EMAIL_LOGIN=false).
Changes (source only — Docker rebuilds packages/data-schemas dist via
`pnpm run frontend`):
- schema/user.ts: remove the `password` field. The User projection carries no
local secret. (IUser keeps `password?: string` — always undefined — so the
disabled local strategy / comparePassword still compile; the full
local-strategy teardown lands with the cutover.)
- AuthService.registerUser: stop writing password (local signup stores no
credential).
- AuthService.resetPassword: reject — "Password reset is managed by Hanzo IAM
(hanzo.id)." Nothing to reset locally.
Login-safety: the authed OIDC flow (openidStrategy) references `password` ZERO
times — provably untouched by this change. comparePassword/localStrategy run
only when local login is enabled (off in prod), so removing the field is inert
for the live path.
Verify: data-schemas builds clean; store-registry + convo/message + user-schema
specs green (17/17 targeted); full suite identical to clean tree
(1210 pass / 250 pre-existing mongo-env fails / 100 skip — my change adds zero
failures). LIVE Dave-login verification is the deploy-time gate in the cutover
runbook — this branch is not deployed, so prod is untouched (default path stays
pure-mongoose + password field until the cutover deploy).
STOP before step (b): OPENID_REUSE_TOKENS is the documented login-breaker
(chat.yaml: =true → /api/auth/refresh 403 at hanzo.id → login dead). Do NOT flip
until the IAM refresh-token fix lands and is live-verified.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Two regex-form OUR-route references the string-based sweep couldn't reach:
- api metrics.ts PATH_NORMALIZATIONS: matcher regexes still /^\\/api\\/...
while replacements were /v1/chat/... — a half-migration. Real request
paths (/v1/chat/*) never matched -> high-cardinality routes (stream/status/
files/messages/convos/agents/tags/tools/sessions with IDs) unnormalized ->
Prometheus label cardinality blowup. Matchers -> /^\\/v1\\/chat\\/.
(Aligns with metrics.spec's already-migrated /v1/chat/X/#id expectations.)
- client ToolCall.tsx: regex extracting actionId from the Action OAuth
redirect_uri matched /api/actions/:id/oauth/callback; callback is now
/v1/chat/actions/... -> actionId parse failed -> Action OAuth UI broken.
OUR-route /api now ZERO in all forms (string, template, regex, cookie-path).
Blue's transform anchored on '/api/' (trailing slash) and missed 4 places
where the path ends exactly at '/api':
- client MarkdownComponents.tsx: chat-message file links built as
${origin}/api/files/... -> BROKEN (files now at /v1/chat/files).
Fixed base -> /v1/chat. [user-facing regression: file downloads]
- data-provider getDomainServerBaseUrl(): same ${origin}/api -> /v1/chat.
- api oauth/csrf.ts OAUTH_SESSION_COOKIE_PATH '/api' -> '/v1/chat': the
OAuth session cookie (24h CSRF fallback) was never sent to the relocated
/v1/chat/{actions,mcp} callbacks. [vector-6 miss]
- api metrics.ts path normalization '=== /api' -> '=== /v1/chat' (matches
sibling /images,/avatars pattern).
OUR-route /api/ now ZERO across mounts, fetches, base-URLs, cookie paths,
redirect_uris.
Red-team review of the /api/ -> /v1/chat/* migration found the sweep
over-reached into paths that are NOT the chat mount prefix:
- client/src/utils/resources.ts: REMOTE_AGENT 'copy API endpoint' URL was
mangled /api/v1/responses -> /v1/chat/v1/responses (double-prefix, no
route serves it). Canonicalize to /v1/responses (OpenAI-compat Responses
API). User-facing.
- data-provider actions.spec + openapiSpecs (scholar-ai.net, swapi.dev) +
api mcp.spec wss template: third-party API path fixtures wrongly swept to
/v1/chat/*. Reverted to /api/* (they represent EXTERNAL APIs, not chat
routes). Fixes 5 failing createURL/executor tests.
- Stale doc comments: useFavorites (/v1/user -> /v1/chat/user), tokens.ts
typedef ref.
OUR-route /api/ remains ZERO. Login/OAuth/SSE/CSRF paths unaffected.
ChatGPT-style anonymous preview: when ALLOW_GUEST_CHAT is on, a logged-out
visitor renders the real chat view (composer + starter cards + model picker)
and can send a message as a guest on the free Zen model, WITHOUT logging in.
Sign-in is only prompted after the free per-IP quota (402 GUEST_LIMIT).
Client (the missing wiring — server guest path was already complete):
- ChatRoute now renders ChatView for canChat = isAuthenticated || isGuest;
/api/models + /api/endpoints queries run for guests (guest-scoped config),
and the roles gate treats a guest as loaded (no agent access). Previously
ChatRoute hard-returned null for !isAuthenticated, so a guest got the shell
but no composer.
- useAuthRedirect now surfaces isGuest.
Abuse control (airtight, server-enforced):
- guestMessageLimiter + guestTokenLimiter now key on the REAL client IP via
utils/guestClientIp (Cloudflare CF-Connecting-IP, falls back to req.ip), NOT
the guest token — clearing cookies / incognito / minting a fresh token can't
reset the count. Shared Redis limiterCache holds it across replicas.
- guestLimiters env parsed as positive ints.
Prod runs GUEST_MESSAGE_MAX=2. Guests always use the shared capped HANZO_API_KEY
(per-user hk- billing is skipped for guest principals).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(mcp): block private IPs when the connector resolves all addresses
undici's connect-time DNS lookup calls the SSRF-safe wrapper with
{ all: true }, so dns.lookup returns a LookupAddress[] rather than a
single string. The previous guard only inspected `typeof address ===
'string'`, silently failing open on the array shape — a hostname
resolving to a private/reserved IP would pass unchecked.
Normalize both shapes to a flat address list and reject if ANY resolved
address is private, mirroring upstream LibreChat's getBlockedLookupAddress.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(mcp): re-check SSRF on every redirect hop, strip cross-origin creds
An MCP server URL is server-controlled. Our customFetch issued the
request with undici's default redirect:'follow', so a public MCP server
(which passes the add-time isMCPDomainAllowed check) could 301/302/307/
308-redirect the connection to an internal IP literal (169.254.169.254
cloud metadata, 127.0.0.1, in-cluster 10.x/172.16-31/192.168 services).
undici skips its connect-time DNS lookup for IP literals, so the
redirect hop reached the internal target unguarded — a live SSRF on the
multi-tenant chat surface (proven: a 301 to 127.0.0.1/latest/meta-data/
was followed).
Harden createFetchFunction to follow redirects manually (redirect:
'manual'):
- Only 307/308 are followed, up to MAX_REDIRECTS=5; 301/302/303 are
returned unfollowed (the MCP SDK rejects a bare 3xx).
- Every hop's target is re-validated with isSSRFTarget (catches IP
literals the connect lookup skips) + resolveHostnameSSRF (catches
hostnames resolving to private IPs); a blocked hop is not followed.
- Cross-origin hops strip credential headers (Authorization, cookie,
mcp-session-id, plus runtime/config secret header keys) so a bearer
token / session id never leaks to a redirect target's origin.
- Cross-origin hops pin an SSRF-safe connect dispatcher for the rest of
the chain, closing the allowlist-mode DNS-rebinding gap.
Mirrors upstream LibreChat MCP redirect SSRF hardening (PR #12931).
Redirect targets get no allowlist exemption by design.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* test(mcp): prove redirect SSRF guard rejects internal-IP targets
End-to-end test using the REAL isSSRFTarget/resolveHostnameSSRF
classifiers (the sibling MCPConnectionSSRF suite mocks ~/auth). Stands
up loopback HTTP servers and asserts a 302/307/308 redirect to an
internal IP literal is never followed — the redirect is issued
(entryHit) but the internal metadata endpoint is never reached
(internalHit stays false). Also pins the classifier: 169.254.169.254,
127.0.0.1, RFC1918, localhost, ::1 are SSRF targets; a public hostname
is not.
Reverting the connection.ts guard makes all three redirect cases fail
(internal endpoint reached), confirming the test exercises the fix.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Converge hanzo.chat onto the shared @hanzo/ui design language:
- Sidebar toggle glyph: replace the custom filled panel SVG with the
canonical lucide PanelLeft geometry (stroke-2, 24x24). Kept as the shared
`Sidebar` export so OpenSidebar/NewChat/ExpandedPanel all get the one
canonical icon with zero call-site churn.
- Typography: Basel Grotesk (UI/body/display/heading, self-hosted woff2/woff,
Book 400 + Medium 500) as tailwind `sans`; Geist Mono (code/data) as
tailwind `mono` via CDN. Replaces Inter / Roboto Mono.
Dark aesthetic already matches the target (true-black OLED #000 / #0a0a0a).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Mirror the live chat-config CM: house-brand Zen (default zen5-mini) plus the
independent third-party families the gateway serves, current-gen models only
(no sunset zen4). Same api.hanzo.ai/v1 gateway + per-user key → identical
Commerce metering across all families.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Elevate the empty-state starters from flat chips to a refined 2-col card grid:
lucide icon in a rounded well, hover lift (-translate-y) + soft shadow + border
lightening, smooth 200ms ease-out, focus-visible ring, reduced-motion safe.
Uses existing theme tokens (surface-primary-alt / border-light / text-secondary)
so it tracks light+dark + the monochrome brand. Agent starters render in the
same grid (default icon).
Proper semver: 0.9.0 -> 0.9.1 (patch, visual refinement of the 0.9.0 feature).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Brings the true-black OLED dark theme (style.css), the Zen ensō avatar
(ZenLogoIcon replacing the generic robot on the Zen/custom endpoint), the
chat→api.hanzo.ai/v1 unification, and the multi-provider picker (Zen house
brand + open families) onto main for a published build.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Plain-model chats (e.g. zen5-mini) showed a bare empty state — LibreChat only
rendered conversation starters for agents/assistants. Add 4 curated default
starters as the fallback so every empty chat gets ChatGPT/Claude-style
suggestion chips, wired through the existing useSubmitMessage path (landing-only;
agents that intentionally omit starters are untouched).
Proper semver: v0.8.3-rc1 (rc, non-standard v-prefix) -> 0.9.0 (minor, feature).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Qwen3 and DeepSeek are the upstreams behind Zen's flagship tiers
(zen5-max→qwen3.5-397b, zen5-pro/flash→deepseek-v4-pro/deepseek-4-flash).
Listing a Qwen or DeepSeek family next to Hanzo/Zen reveals the Zen mapping —
the single most forbidden thing in the brand policy. Keep only genuinely
independent open-weight families Zen's flagships don't build on: Meta Llama
and Mistral. Final picker: Hanzo (Zen, default zen5-mini) + Meta Llama +
Mistral. Every model is served by api.hanzo.ai/v1/models and its DO upstream
is verified invocable.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Mirror librechat.yaml to the LIVE chat-config CM (v1.3.4) and add per-family
custom endpoints alongside Hanzo/Zen. Every endpoint is the same
api.hanzo.ai/v1 gateway carrying the per-user HANZO_API_KEY, so metering is
identical across families (the cloud billing gate). Hanzo stays customOrder:0
with the zen5-mini default.
Families listed are the ones the gateway can genuinely invoke today via
DigitalOcean GenAI (funded): Meta Llama, Mistral, DeepSeek, Qwen. OpenAI and
Anthropic branded resale is intentionally omitted — no funded key path exists
yet (direct OPENAI/ANTHROPIC keys unfunded; DO account lacks proprietary
access), so listing them would surface non-invocable models. Documented inline
for a one-block-each add once a funded key/enablement lands.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Dark theme pushed toward black per brand: main canvas #000, panels/sidebar
#050505/#0a0a0a, elevated controls (input, cards) #171717 — remapped the `.dark`
--surface-* + shadcn HSL block onto new near-black gray steps (--gray-925/950/975)
in one place (DRY; the scale, not per-component overrides).
Zen avatar: the custom endpoint (hanzo.chat is Zen-only — Hanzo AI zen* models)
rendered the generic LibreChat "custom" robot glyph because the custom branch
hardcodes CustomMinimalIcon and ignores the endpoint iconURL. Replaced with a
proper ZenLogoIcon (ensō — the single-brushstroke Zen circle, monochrome
currentColor so it reads on true-black), named 'Zen'.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The logged-out landing page listed Zen's upstream families (DeepSeek R1,
Qwen3, Llama 4, Phi-4) in the "third-party models" grid and named DeepSeek/
Qwen in the 100+ Models blurb — a brand-policy leak (Zen must present as our
own family; no raw Qwen/DeepSeek/Kimi/Llama/HuggingFace names). Keep only the
genuine independent providers offered via the gateway (GPT-5, Claude Opus 4,
Gemini 2.5, Grok, Mistral Large, Command R+) and lead the blurb with the Zen
family. Ships on next chat image build.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Investigate-before-ripping map of hanzo.chat as the cloud "chat view":
- Documents the ONE inference path (POST /api/agents/chat/Hanzo →
api.hanzo.ai/v1/chat/completions, per-user hk- key, SSE) plus code-exec →
/v1/exec, websearch → /v1/websearch, cloud agents → /v1/agents. No shadow
LLM backend; config.yaml/litellm is dead upstream residue.
- Flags the ONE real parallel store: LibreChat Mongo (convos/messages/presets/
prompts/users/balances/files/sessions). Go backend has casibase-named
persistence (/v1/get-chats,/v1/add-message) + a speced-but-unimplemented
chat/openapi.yaml (/v1/chat/convos|messages|presets). Kill path documented;
do NOT rip Mongo (data loss + dead chat) — coordinate with openapi.
- IAM-native status: prod passport OIDC → hanzo.id (client hanzo-chat), LIVE;
static SPA mode uses client app-chat (align) on dormant @hanzo/iam ^0.4.0.
- @hanzo/ui (Tailwind/shadcn, chat's stack) vs @hanzo/gui (Tamagui/Next15,
console's stack): unify via @hanzo/ui, not a framework-swap rewrite.
librechat.yaml: drop gpt-4o/claude from the Hanzo endpoint default so the repo
reference mirrors the authoritative prod ConfigMap — zen-only picker, no raw
upstream names (brand policy). One way.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Red-team hardening of the on-behalf-of decouple:
- cloud.js getUserCloudBearer: bind EVERY forwarded token (id_token AND the
access_token fallback, session or cookie) via isForwardableToken. Principal
binding is now MANDATORY (sub === req.user.openidId) with no fail-open when
openidId/sub is absent, and the access_token fallback is bound too — closes
the unbound-access_token and null-binding confused-deputy paths.
- AuthService.persistOpenIDTokensToSession: take the OIDC refresh credential
EXPLICITLY (not from the tokenset). The decoupled default persists only the
on-behalf-of bearer (id_token/access_token), NOT the OIDC refresh_token, so
logout keeps using the local cookie -> findSession matches -> the server-side
session is invalidated (was silently skipped once openidTokens landed in the
decoupled session). REUSE path unchanged (passes the resolved credential).
Tests: cloud.spec + AuthService.spec green (bound-access, opaque-401,
foreign-401, null-openidId-401, cookie-injection-401, decoupled-omits-refresh).
Pre-existing oauth admin-exchange arity failures untouched (out of scope).
/api/agents/cloud returned 401 "cloud agents require hanzo.id sign-in" for
EVERY signed-in user: getUserCloudBearer forwarded the id_token read from
req.session.openidTokens, which is only populated by setOpenIDAuthTokens —
called at login solely when OPENID_REUSE_TOKENS=true. The live deploy runs
OPENID_REUSE_TOKENS=false on purpose (true makes /api/auth/refresh use the OIDC
refresh-grant, which 403s against hanzo.id and breaks login), so the id_token
was never persisted and the cloud-agent run was dead on arrival. One flag
braided two orthogonal concerns: (a) persist the id_token for downstream
on-behalf-of calls, (b) use the OIDC refresh-grant on token refresh.
Decouple:
- AuthService: new persistOpenIDTokensToSession(req, tokenset) — the one writer
of req.session.openidTokens (server-side only, never a cookie). setOpenIDAuth-
Tokens now delegates its session write to it (DRY, behavior-preserving).
- oauth login: an OpenID login ALWAYS persists the id_token to the session,
regardless of OPENID_REUSE_TOKENS. With REUSE disabled the login still runs
setAuthTokens (local-JWT refresh) so login/refresh cookies are byte-identical;
only server-side session state is added. Persist is wrapped so it can never
break the login redirect. OPENID_REUSE_TOKENS now SOLELY gates the refresh-grant.
- cloud proxy: getUserCloudBearer keys off the VALIDATED principal
(req.user.provider === 'openid'), not the mutable token_provider cookie, so the
on-behalf-of decision is tied to identity. The forwarded id_token must also name
req.user (sub === openidId) and be unexpired — expired/absent yields an honest
401, never a fabricated run. Confused deputy denied at the identity layer.
Durable refresh of the ~1h id_token (hanzo.id/Casdoor OIDC refresh, or an
RFC-8693 token-exchange from the chat session) is a tracked FOLLOW-UP; the
login-breaking refresh-grant is NOT enabled.
Tests (jest): cloud proxy re-keyed to the principal + honest expiry/binding/
confused-deputy (20); oauth persists id_token when REUSE=false, uses the OIDC
writer when true, local user never persists, login survives a persist failure
(4); persistOpenIDTokensToSession session/expiry/no-session/no-tokenset (4).
Refresh path unchanged.
Note: oauth.spec's 2 admin-exchange tests are pre-existing red on origin/main
(spec expects a 7-arg generateAdminExchangeCode; source passes 4) — orthogonal
to this change, proven by a stashed baseline.
Red review of the cloud /v1/agents run proxy: core security (SSRF, CSRF,
token-exfil, wrong-principal, mount-order, injection) confirmed closed; three
gaps fixed:
- MEDIUM: the run proxy (a real billable cloud completion) escaped the throttle
guarding the sibling chat-completion path. Add per-user cloudAgentLimiter on
the whole /cloud router (CLOUD_AGENT_USER_MAX/_WINDOW), a process-wide in-flight
ceiling with fail-fast 503 (CLOUD_AGENT_MAX_CONCURRENT), and a 4 MiB buffered-
response cap (Content-Length fast path + streamed abort) so no single call can
pin the shared backend's memory.
- LOW: only forward OpenID tokens when the request itself is an OpenID login
(token_provider==='openid'); a local-JWT user with a stale OpenID session can
no longer run as that prior identity (confused deputy).
- LOW: cap input by UTF-8 BYTE length, not UTF-16 units, matching cloud's maxInput.
Tests: api 34 passed (was 25; +9: principal-guard, cookie-read, byte-cap,
response-cap x3, concurrency-cap x2). eslint clean.
Move the cloud handle-grammar guard to the route boundary via router.param,
not only inside CloudAgentsClient. A malformed/decoded :name (traversal,
null byte, CRLF, backslash, space) is now rejected with 400 before any client
call is constructed — defense at the boundary. Production was already safe
(the client rejects the same names), but the guard belongs at the entry point.
Adds boundary-validation tests proving decoded smuggles (../etc, ../admin,
..\evil, %00, %0d, %20) 400 without reaching the client. cloud route 14/14,
CloudAgentsClient 11/11 green.
Add cloud-agent RUN alongside the existing LibreChat-legacy agent builder
(which is untouched). The canonical registry is cloud /v1/agents; chat now
lets a signed-in user run their OWN cloud agents from the thread via a
/agent <name> [prompt] slash command and via the @mention picker.
Backend (server-side proxy, token never reaches the browser):
- CloudAgentsClient forwards the user's hanzo.id id_token as a Bearer to
cloud; cloud's SanitizeIdentity (HIP-0026) validates it and pins X-Org-Id
from the owner claim, so a user only reaches their own org. Not an open
proxy: fixed host from HANZO_CLOUD_URL (falls back to OPENAI_BASE_URL host),
three fixed endpoints, agent name validated against cloud's handle grammar
(traversal/SSRF guard), 128KB input cap, 30s timeout, fail-secure 401 on
missing token (no service-token fallback).
- /api/agents/cloud/{,:name,:name/run} router, requireJwtAuth (guests rejected),
honest error passthrough. Mounted before the legacy /:id route.
Frontend (DRY, one run path, reuses Mention/MentionItem):
- useRunCloudAgent renders the run in-thread; parseAgentCommand is the single
command grammar; /agent and @mention both funnel through it.
- Cloud agents surface in @mention (cloudAgent type) and a /agent popover.
Mobile: AgentConfig responsive padding + full-width wrapping error text +
stacked tool/action buttons; AgentPanel form min-w-0 to stop overflow <768px.
Convergence of chat's /api/agents CRUD onto /v1/agents is a later step.
Tests: CloudAgentsClient (11) + cloud route (7) + parseAgentCommand (8) green.
The index.html tracker tag uses %VITE_ANALYTICS_SITE_ID%, substituted by
Vite at build time. The var was never set at build, so the placeholder
shipped literally and the browser POSTed website id '%VITE_ANALYTICS_SITE_ID%'
to analytics.hanzo.ai/api/send -> 400. The CR only set NEXT_PUBLIC_ANALYTICS_SITE_ID
(runtime, wrong prefix + phase for a Vite build). Default the real registered
Hanzo Chat site id as a Docker ARG/ENV so the frontend build bakes it in.
vite-plugin-pwa's default navigateFallback is 'index.html', so the SW
binds createHandlerBoundToURL('index.html'). index.html was in globIgnores
(not precached) -> 'non-precached-url: index.html' -> the service worker
breaks and strands users on a stale shell after each deploy (they see
/api/* 401s until a manual SW clear). Precache it; registerType:autoUpdate
keeps it fresh on release.
Both Agent Builder capabilities were 🔑-gated because nothing was wired.
- librechat.yaml: add webSearch{} pinned to Hanzo's own /v1/websearch surface
— searchProvider=searxng (Hanzo metasearch), scraperProvider=firecrawl
(Hanzo Crawl), no reranker. NO external Serper/Tavily/Jina/Cohere. Add
endpoints.agents.capabilities so execute_code + web_search show active.
- .env.hanzo-cloud: the old CODE_EXECUTION_ENDPOINT/RUNTIME_API_KEY were DEAD
(LibreChat never reads them, and the path was /execute not /exec). Replace
with the real vars: LIBRECHAT_CODE_BASEURL=https://api.hanzo.ai/v1 +
LIBRECHAT_CODE_API_KEY (KMS). Add SEARXNG_INSTANCE_URL / FIRECRAWL_API_URL /
WEBSEARCH_API_KEY -> api.hanzo.ai/v1/websearch.
- .env.example: document the Hanzo-backend vars as the one way; note external
providers are intentionally disabled.
Validated against the LibreChat Zod configSchema: CONFIG VALID (searxng +
firecrawl + execute_code/web_search capabilities).
Co-authored-by: Hanzo AI <ai@hanzo.ai>
In the agents-centric chat UI ('My Agents'), sending a message with no agent
created/selected POSTed to the agents completion endpoint without an agent_id,
which canAccessAgentFromBody rejected with 400 'agent_id is required in request
body'. A missing agent_id on the agents endpoint is an ad-hoc (ephemeral) chat,
not an error — isEphemeralAgentId(undefined) is already true.
- canAccessAgentFromBody: drop the 400 branch; a missing id falls through the
existing ephemeral path (no per-agent ACL) to plain chat.
- agents/build.buildOptions: resolve a missing agent_id to EPHEMERAL_AGENT_ID so
loadAgent builds an ephemeral plain-model agent instead of returning null.
- Hermetic regression specs for both fix points (no Mongo/winston); update the
stale middleware test that codified the 400.
Logged-in user types 'hi' -> ephemeral agent on the configured default model ->
reply, with no agent build required first.
Co-authored-by: Hanzo AI <ai@hanzo.ai>
The Hanzo Cloud gateway (api.hanzo.ai) answers some failures -- most importantly a request for a premium model (e.g. zen5-mini) when the caller's balance is only the $5 starter credit -- with HTTP 200 and a JSON error envelope ({status:"error", msg}) that carries no `choices`. The OpenAI client treated the 200 as success and parsed the choices-less body to `undefined`, so the agent run threw the opaque "Cannot read properties of undefined (reading 'role')" (and the title call died on reading 'message') -- no AI reply rendered, the generation job expired, and the resume stream 404'd.
Wrap the custom-endpoint OpenAI client fetch (scoped to the Hanzo gateway) so that envelope is rewritten into a clean 402 carrying the gateway's actionable message. Successful SSE streams and normal completions pass through untouched; the request is never inspected, so per-user hk- billing is unaffected.
- packages/api: hanzoGatewayFetch response-only wrapper + wire into initializeCustom + unit tests
A fresh /c/new defaulted to the built-in `agents` endpoint with no agent
selected. All chat routes through POST /api/agents/chat/:endpoint; with
endpoint=agents and no agent_id the access middleware (canAccessAgentFromBody)
returns 400 "agent_id is required in request body" and the SSE stream never
starts — every first message failed with no AI response.
Root cause: orderEndpointsConfig gives built-in `agents` order 1 but defaults
every custom endpoint to order 9999, so the client's getDefaultEndpoint picked
`agents` first. The intended override — a custom endpoint's `customOrder` — was
silently dropped by loadCustomEndpointsConfig (it never emitted `order`), even
though orderEndpointsConfig already types the custom spread as `& { order?: number }`.
Fix: loadCustomEndpointsConfig now honors `customOrder` -> `order`, and the Hanzo
endpoint sets `customOrder: 0` so it outranks `agents`. A new conversation now
defaults to Hanzo, which routes as an ephemeral agent (provider=Hanzo) through
the proven per-user hk- key path (resolveHanzoCloudKey) — real AI response,
metered, no agent_id 400. Agents endpoint stays available for explicit selection.
- packages/api: honor customOrder, widen TCustomEndpointsConfig, + unit test
- librechat.yaml: customOrder: 0 on Hanzo (mirrored in universe chat-config)
New-account chat now works end to end, fail-closed, no shared-org bleed:
- resolveHanzoCloudKey computes the canonical per-user billing subject
(object.BillingSubject parity: 'owner/name' for the shared hanzo catch-all),
stamps it on req.user, and ensures the one-time $5 Commerce starter credit on
THAT subject (POST /v1/billing/grant-starter) BEFORE forwarding the user's
hk- key — so the gateway's first balance check sees $5 instead of 402-ing.
Idempotent (in-process + commerce tag-dedupe), best-effort (gateway enforces).
- CommerceClient: checkBalance/tier/breakdown key on the subject and derive the
X-Hanzo-Org namespace from it; replace the wrong-ledger createTrialGrant
(credit-grants, invisible to /billing/balance) with grantStarter (Deposit).
- balanceMethods gate keys on the per-user subject (req.user.billingSubject).
- Drop chat-side Commerce usage write (single debit = the gateway).
- Remove the dead createTrialGrant call in user.ts (never fired for SSO users,
wrong ledger).
The prior HEAD (4233c8760) was reverted in the preceding commit: it rewrote the
gate to forward the user's IAM JWT to commerce AND added a chat-side
spendTokens -> /v1/billing/usage decrement. With per-user hk- forwarding ON,
that double-debits (cloud gateway debits the org via the user's hk- key, AND
chat debits the same org via spendTokens). One money authority only: the cloud
gateway debits via the per-user hk- key; chat's balanceMethods is a READ-ONLY,
fail-closed pre-flight gate (service token + X-Hanzo-Org, the proven pattern).
This commit adds the one missing piece for the anon free tier: guests are
exempt from the balance gate. Guests hit checkBalance via BaseClient
(supportsBalanceCheck[custom]=true) with no billing org; under startBalance:0
the legacy local gate would block the free tier entirely. Their spend is
bounded instead by (1) the per-IP guest message limiter and (2) the separate,
small-capped, NON-exempt guest key (HANZO_API_KEY) the gateway 402s when empty.
Tests: fail-closed decision matrix (funded/insufficient/unavailable/
model_not_allowed/no-org) + guest exemption. 8/8 green.
Commerce is already IAM-native + multi-tenant; chat was sending a static
service token (not a JWT) so commerce 401'd and the balance check fell open =
unmetered AI. Rewire to forward the logged-in user's hanzo.id IAM JWT per
request and fail CLOSED.
- CommerceClient: drop the static COMMERCE_TOKEN singleton; every call carries
the user's IAM JWT (Authorization: Bearer). getMyBalance (fail-closed read),
grantWelcome ($5 idempotent), recordUsage (decrement). getIamToken/
getBillingOrg/computeUsageCents/recordCommerceSpend helpers.
- balanceMethods.checkBalance: IAM-native money gate, FAIL CLOSED — no token /
commerce-unreachable / below-min => refuse. Funded user passes. Self-heals a
new account by granting the idempotent $5 once and re-reading (a spent wallet
stays blocked — grant is tag-deduped).
- spendTokens / spendStructuredTokens: decrement the user's per-org commerce
balance, mirroring the local ledger cost; threaded from the agent spend sites.
- openidStrategy: grant the $5 welcome credit on new-account signup under the
user's IAM identity (synchronous, best-effort).
- Balance controller: surface the authoritative commerce balance (display).
- Tests: fail-closed/fail-open decision matrix + cost mirror (12 cases).
Requires OPENID_REUSE_TOKENS=true (chat CR) so the IAM JWT is on the request,
and COMMERCE_EDGE_AUTH=true + hanzo-chat audience (commerce CR).
hanzo.chat money path. Previously every authenticated chat ran on z's shared
hk- key (hanzo/z) against the shared 'hanzo' commerce org, plus a $5 local
startBalance per user and a fail-OPEN balance gate -> unbounded free spend.
- Per-user billing: resolve (mint on first chat) each authenticated user's OWN
hk- key from IAM by org+email and forward it to the gateway, which debits
THEIR org. New packages/api/src/endpoints/custom/hanzoCloudKey.ts; injected at
the single apiKey chokepoint in custom/initialize.ts. FAIL CLOSED: an authed
user whose key cannot be resolved is blocked, never falls back to the shared
key. The resolver also stamps the authoritative billing org back onto req.user
(OIDC 'owner' can be the Casdoor super-org 'admin', not the real billing org).
- Balance gate commerce-first + FAIL CLOSED + decisive (balanceMethods.js):
when commerce is configured and the user's org is known, the org's commerce
balance is authoritative (>= HANZO_MIN_BALANCE); insufficient/unreachable ->
block. No fall-through to local tokenCredits, so startBalance:0 cannot
false-block a funded user. CommerceClient balance read is now fail-closed
(throws on cold error) and per-org scoped (X-Hanzo-Org).
- startBalance: 0 (librechat.yaml): no free local credits; new users claim $5
at billing.hanzo.ai. Client shows a claim-credit link on empty balance.
Gated by HANZO_PER_USER_KEY=true (reuses OPENID_* client creds for IAM).
The dark theme tinted all panels/sidebar blue via --background/--card/--border/
--input/--muted/--accent at hue 222 (and ring #2563eb). Neutralized to 0%
saturation (grayscale) to match the Hanzo monochrome brand.
The monochrome rebrand changed the LandingPage `colors` object + login CTAs
but left 8 inline rgba(253,68,68,…) (#fd4444) accents — hero gradient,
"AI Chat Platform" badge border, Zen-models card border/bg + hover, and the
"Free credit" pricing tier border/bg/label. Convert all to rgba(255,255,255,…)
(preserving alpha), matching the existing white monochrome accents. The
terminal traffic-light dots (bg-red/yellow/green-500) already render grey via
the tailwind color-scale remap. Landing is now fully black/white/grey.
Replace the upstream LibreChat feather/quill brand fallback with the
official Hanzo ▼/H mark (currentColor, monochrome) across every agent and
endpoint icon path (Landing welcome via ConvoIcon→AgentAvatar, agent
avatars, message + minimal icons).
Collapse all Tailwind color scales (green/red/blue/sky/…/rose) to a single
neutral grey ramp so UI chrome is black/white/grey only; destructive
semantics keep one muted red via --text-destructive. Convert the green
Create/Save CTAs (Add-MCP-Server dialog, Agent + Assistant builders,
preset and API-key dialogs) and .btn-primary to the adaptive
white-on-dark primary button.
Set favicon/PWA assets to the canonical hanzo.app ▼/H set (favicon.ico
byte-identical to hanzo.app) and the manifest theme_color to monochrome.
Tests: 34 passed — Hanzo-mark fallback assertions updated.
client/package.json: ^0.4.0 -> ^0.13.1 (npm latest). 0.13.x moves the PKCE tx (state+verifier) from sessionStorage to localStorage so it survives the OAuth redirect, fixing login.
iam.ts: BrowserIamSdk class renamed to IAM. Import bare '@hanzo/iam' (not the '/browser' subpath): the client tsconfig uses moduleResolution=node, which cannot resolve the exports subpath for types; the bare entry (dist/index.d.ts) re-exports IAM and Vite still bundles dist/browser.js via the browser export condition. Constructor config (IAMConfig) is unchanged.
OAuthCallback.tsx: IAMToken fields camelCased in 0.13 (access_token -> accessToken); without this the callback never set the auth header.
Lockfile: pnpm-lock.yaml regenerated (authoritative per packageManager=pnpm@10.27.0 + Dockerfile 'pnpm install --frozen-lockfile'). package-lock.json/bun.lock left untouched (not consumed by any build or CI).
The CSP script-src was 'self' only, blocking the app's own
analytics.hanzo.ai/script.js and static.cloudflareinsights.com beacon, plus a
data: font and assets/silence.mp3 (console errors + broken assets on every
page load). Allow-list the two external script hosts in script-src/connect-src
and add font-src/media-src for data:/blob:.
The OIDC/model iconURL and OPENID_IMAGE_URL point at hanzo.chat/assets/logo.svg;
that asset was still a made-up 24x24 single-path H. Replace with the canonical
64x64 blocky-H (5 paths) byte-matching @hanzo/brand — matches what the live
0.7.12 image serves.
The composer hard-requires a handful of read-only bootstrap calls. Switch
exactly those to requireGuestOrJwtAuth and add a guest branch that returns
safe, scoped data — never a DB lookup, never another user's data:
- GET /api/endpoints → ONLY the guest endpoint (Hanzo)
- GET /api/models → ONLY the single guest model
- GET /api/user → ephemeral guest principal (no email)
- GET /api/convos → empty conversation page
- GET /api/user/settings/favorites → []
- GET /api/agents/chat/active → { activeJobIds: [] }
Every mutation and read-by-id route stays JWT-only and rejects guests with
a clean 401 (post jwt-strategy fix). Banner (optionalJwtAuth) now resolves
with no user for guests. Adds controller + full-chain integration tests.
Single source of truth in guestConfig.js for the ephemeral guest shape:
- buildGuestPrincipal(id): plain GUEST req.user (no DB id/email)
- buildGuestUser: safe /api/user payload (name 'Guest', no email)
- buildGuestEndpointsConfig: ONLY the configured guest endpoint
- buildGuestModelsConfig: ONLY the single configured guest model
requireGuestOrJwtAuth now builds its principal from buildGuestPrincipal
(adds name 'Guest'), keeping the guest shape DRY across auth and bootstrap.
The guest JWT carries a synthetic `guest_<uuid>` id that is not a Mongo
ObjectId. On any requireJwtAuth route the 'jwt' passport strategy called
getUserById(guest_id) → Mongoose CastError → done(err) → HTTP 500.
Detect the `guest: true` claim at the top of the verify callback and
return done(null, false) before any DB lookup. Guest tokens now fail the
strict strategy with a clean 401, and reach their scoped routes only via
requireGuestOrJwtAuth. Fail closed by construction.
The chat route guard redirected any !isAuthenticated user to /login on a
300ms timer, ignoring isGuest/allowGuestChat and beating startup-config
load — so logged-out guests never reached the composer. Wait for config,
and skip the redirect when guest chat is enabled or the user is a guest.
silentRefresh's guest fallback could run before startupConfig loaded
(allowGuestChat undefined) and was never retried, leaving logged-out
visitors on the landing page instead of the guest composer. Add a
dedicated effect that acquires the guest token once the flag is true.
When unauthenticated and startupConfig.allowGuestChat is set, acquire a
guest token on load and render the chat composer instead of the landing
gate. On a 402 GUEST_LIMIT response, surface GuestLimitDialog which
triggers the existing OpenID/hanzo.id login flow.
- useGuestAuth: acquires an ephemeral guest session via dataService.
- AuthContext: isGuest state; guest fallback in silentRefresh; userQuery
and silentRefresh disabled for guests (capability-scoped).
- Root: render chat for guests (auth-gated hooks stay disabled); mount
GuestLimitDialog.
- useResumableSSE: dispatch guestLimitReached on 402 GUEST_LIMIT.
Add an opt-in anonymous preview mode gated behind ALLOW_GUEST_CHAT
(default off). Guests get a per-IP free quota (GUEST_MESSAGE_MAX,
default 3) on the free Zen model via the Hanzo gateway endpoint.
- POST /api/auth/guest issues a short-lived guest JWT ({guest:true},
per-token random id) signed with JWT_SECRET; rate-limited per IP.
- requireGuestOrJwtAuth accepts guest tokens ONLY on the chat-completion
router; the standard jwt strategy rejects them everywhere else.
- enforceGuestScope pins endpoint+model to the free Zen endpoint and
strips agents/tools/files/spec/preset server-side.
- guestMessageLimiter enforces the per-IP quota via the shared Redis
limiterCache; returns 402 {type:'GUEST_LIMIT'} on exhaustion.
- Reserved chat subpaths (stream/active/status/abort) stay JWT-only.
- Expose allowGuestChat/guestMessageMax in /api/config; add GUEST role.
Tests: 27 unit/integration tests covering config, guest auth wrapper,
scope enforcement, quota, and the router chain.
run.processStream (@librechat/agents >= 3.1.52) treats the passed config as
owned and, in its post-stream cleanup, sets config.configurable = undefined to
break the AsyncLocalStorage -> LangGraph reference chain that keeps heavy graph
state (base64 images/PDFs) alive (agents dist/esm/run.mjs:239). Reading
config.configurable.hide_sequential_outputs AFTER runAgents() therefore threw
"Cannot read properties of undefined (reading 'hide_sequential_outputs')",
caught by chatCompletion and pushed as an ERROR content part -- the red
post-reply banner. The same throw aborted the post-stream finalize, which is
why auto-titling also stopped.
Hoist the read to before runAgents() (the value is a static agent property only
needed afterward by the deprecated Agent Chain output filter), so it no longer
depends on post-run config state. Matches upstream LibreChat's fix
(PR #11942, a0f9782e6).
Adds a regression test that reproduces the mutation (processStream nulls
config.configurable) and asserts no ERROR content part is produced, plus
coverage for the hide_sequential_outputs true/false filter behavior.
Co-authored-by: Antje Worring <worringantje@gmail.com>
2026-06-21 10:28:01 -07:00
2122 changed files with 37466 additions and 80945 deletions
@@ -38,7 +38,7 @@ Project maintainers have the right and responsibility to remove, edit, or reject
- Install [MongoDB Community Edition](https://www.mongodb.com/docs/manual/administration/install-community/), ensure that `mongosh` connects to your local instance.
- Run: `npx install playwright`, then `npx playwright install`.
<textx="378"y="322"font-family="Inter,system-ui,sans-serif"font-size="30"fill="#ffffff"opacity=".66">AI chat with MCP integration and multi-provider support</text>
@@ -11,41 +11,41 @@ All notable changes to this project will be documented in this file.
### ✨ New Features
- ✨ feat: implement search parameter updates by **@mawburn** in [#7151](https://github.com/danny-avila/LibreChat/pull/7151)
- 🎏 feat: Add MCP support for Streamable HTTP Transport by **@benverhees** in [#7353](https://github.com/danny-avila/LibreChat/pull/7353)
- 🔒 feat: Add Content Security Policy using Helmet middleware by **@rubentalstra** in [#7377](https://github.com/danny-avila/LibreChat/pull/7377)
- ✨ feat: Add Normalization for MCP Server Names by **@danny-avila** in [#7421](https://github.com/danny-avila/LibreChat/pull/7421)
- 📊 feat: Improve Helm Chart by **@hofq** in [#3638](https://github.com/danny-avila/LibreChat/pull/3638)
- 🦾 feat: Claude-4 Support by **@danny-avila** in [#7509](https://github.com/danny-avila/LibreChat/pull/7509)
- 🪨 feat: Bedrock Support for Claude-4 Reasoning by **@danny-avila** in [#7517](https://github.com/danny-avila/LibreChat/pull/7517)
- ✨ feat: implement search parameter updates by **@mawburn** in [#7151](https://github.com/danny-avila/Chat/pull/7151)
- 🎏 feat: Add MCP support for Streamable HTTP Transport by **@benverhees** in [#7353](https://github.com/danny-avila/Chat/pull/7353)
- 🔒 feat: Add Content Security Policy using Helmet middleware by **@rubentalstra** in [#7377](https://github.com/danny-avila/Chat/pull/7377)
- ✨ feat: Add Normalization for MCP Server Names by **@danny-avila** in [#7421](https://github.com/danny-avila/Chat/pull/7421)
- 📊 feat: Improve Helm Chart by **@hofq** in [#3638](https://github.com/danny-avila/Chat/pull/3638)
- 🦾 feat: Claude-4 Support by **@danny-avila** in [#7509](https://github.com/danny-avila/Chat/pull/7509)
- 🪨 feat: Bedrock Support for Claude-4 Reasoning by **@danny-avila** in [#7517](https://github.com/danny-avila/Chat/pull/7517)
### 🌍 Internationalization
- 🌍 i18n: Add `Danish` and `Czech` and `Catalan` localization support by **@rubentalstra** in [#7373](https://github.com/danny-avila/LibreChat/pull/7373)
- 🌍 i18n: Update translation.json with latest translations by **@github-actions[bot]** in [#7375](https://github.com/danny-avila/LibreChat/pull/7375)
- 🌍 i18n: Update translation.json with latest translations by **@github-actions[bot]** in [#7468](https://github.com/danny-avila/LibreChat/pull/7468)
- 🌍 i18n: Add `Danish` and `Czech` and `Catalan` localization support by **@rubentalstra** in [#7373](https://github.com/danny-avila/Chat/pull/7373)
- 🌍 i18n: Update translation.json with latest translations by **@github-actions[bot]** in [#7375](https://github.com/danny-avila/Chat/pull/7375)
- 🌍 i18n: Update translation.json with latest translations by **@github-actions[bot]** in [#7468](https://github.com/danny-avila/Chat/pull/7468)
### 🔧 Fixes
- 💬 fix: update aria-label for accessibility in ConvoLink component by **@berry-13** in [#7320](https://github.com/danny-avila/LibreChat/pull/7320)
- 🔑 fix: use `apiKey` instead of `openAIApiKey` in OpenAI-like Config by **@danny-avila** in [#7337](https://github.com/danny-avila/LibreChat/pull/7337)
- 🔄 fix: update navigation logic in `useFocusChatEffect` to ensure correct search parameters are used by **@mawburn** in [#7340](https://github.com/danny-avila/LibreChat/pull/7340)
- 🔄 fix: Improve MCP Connection Cleanup by **@danny-avila** in [#7400](https://github.com/danny-avila/LibreChat/pull/7400)
- 🛡️ fix: Preset and Validation Logic for URL Query Params by **@danny-avila** in [#7407](https://github.com/danny-avila/LibreChat/pull/7407)
- 🌘 fix: artifact of preview text is illegible in dark mode by **@nhtruong** in [#7405](https://github.com/danny-avila/LibreChat/pull/7405)
- 🛡️ fix: Temporarily Remove CSP until Configurable by **@danny-avila** in [#7419](https://github.com/danny-avila/LibreChat/pull/7419)
- 💽 fix: Exclude index page `/` from static cache settings by **@sbruel** in [#7382](https://github.com/danny-avila/LibreChat/pull/7382)
- 💬 fix: update aria-label for accessibility in ConvoLink component by **@berry-13** in [#7320](https://github.com/danny-avila/Chat/pull/7320)
- 🔑 fix: use `apiKey` instead of `openAIApiKey` in OpenAI-like Config by **@danny-avila** in [#7337](https://github.com/danny-avila/Chat/pull/7337)
- 🔄 fix: update navigation logic in `useFocusChatEffect` to ensure correct search parameters are used by **@mawburn** in [#7340](https://github.com/danny-avila/Chat/pull/7340)
- 🔄 fix: Improve MCP Connection Cleanup by **@danny-avila** in [#7400](https://github.com/danny-avila/Chat/pull/7400)
- 🛡️ fix: Preset and Validation Logic for URL Query Params by **@danny-avila** in [#7407](https://github.com/danny-avila/Chat/pull/7407)
- 🌘 fix: artifact of preview text is illegible in dark mode by **@nhtruong** in [#7405](https://github.com/danny-avila/Chat/pull/7405)
- 🛡️ fix: Temporarily Remove CSP until Configurable by **@danny-avila** in [#7419](https://github.com/danny-avila/Chat/pull/7419)
- 💽 fix: Exclude index page `/` from static cache settings by **@sbruel** in [#7382](https://github.com/danny-avila/Chat/pull/7382)
### ⚙️ Other Changes
- 📜 docs: CHANGELOG for release v0.7.8 by **@github-actions[bot]** in [#7290](https://github.com/danny-avila/LibreChat/pull/7290)
- 📦 chore: Update API Package Dependencies by **@danny-avila** in [#7359](https://github.com/danny-avila/LibreChat/pull/7359)
- 📜 docs: Unreleased Changelog by **@github-actions[bot]** in [#7321](https://github.com/danny-avila/LibreChat/pull/7321)
- 📜 docs: Unreleased Changelog by **@github-actions[bot]** in [#7434](https://github.com/danny-avila/LibreChat/pull/7434)
- 🛡️ chore: `multer` v2.0.0 for CVE-2025-47935 and CVE-2025-47944 by **@danny-avila** in [#7454](https://github.com/danny-avila/LibreChat/pull/7454)
- 📂 refactor: Improve `FileAttachment` & File Form Deletion by **@danny-avila** in [#7471](https://github.com/danny-avila/LibreChat/pull/7471)
- 📊 chore: Remove Old Helm Chart by **@hofq** in [#7512](https://github.com/danny-avila/LibreChat/pull/7512)
- 🪖 chore: bump helm app version to v0.7.8 by **@austin-barrington** in [#7524](https://github.com/danny-avila/LibreChat/pull/7524)
- 📜 docs: CHANGELOG for release v0.7.8 by **@github-actions[bot]** in [#7290](https://github.com/danny-avila/Chat/pull/7290)
- 📦 chore: Update API Package Dependencies by **@danny-avila** in [#7359](https://github.com/danny-avila/Chat/pull/7359)
- 📜 docs: Unreleased Changelog by **@github-actions[bot]** in [#7321](https://github.com/danny-avila/Chat/pull/7321)
- 📜 docs: Unreleased Changelog by **@github-actions[bot]** in [#7434](https://github.com/danny-avila/Chat/pull/7434)
- 🛡️ chore: `multer` v2.0.0 for CVE-2025-47935 and CVE-2025-47944 by **@danny-avila** in [#7454](https://github.com/danny-avila/Chat/pull/7454)
- 📂 refactor: Improve `FileAttachment` & File Form Deletion by **@danny-avila** in [#7471](https://github.com/danny-avila/Chat/pull/7471)
- 📊 chore: Remove Old Helm Chart by **@hofq** in [#7512](https://github.com/danny-avila/Chat/pull/7512)
- 🪖 chore: bump helm app version to v0.7.8 by **@austin-barrington** in [#7524](https://github.com/danny-avila/Chat/pull/7524)
@@ -56,38 +56,38 @@ Changes from v0.7.8-rc1 to v0.7.8.
### ✨ New Features
- ✨ feat: Enhance form submission for touch screens by **@berry-13** in [#7198](https://github.com/danny-avila/LibreChat/pull/7198)
- 🔍 feat: Additional Tavily API Tool Parameters by **@glowforge-opensource** in [#7232](https://github.com/danny-avila/LibreChat/pull/7232)
- 🐋 feat: Add python to Dockerfile for increased MCP compatibility by **@technicalpickles** in [#7270](https://github.com/danny-avila/LibreChat/pull/7270)
- ✨ feat: Enhance form submission for touch screens by **@berry-13** in [#7198](https://github.com/danny-avila/Chat/pull/7198)
- 🔍 feat: Additional Tavily API Tool Parameters by **@glowforge-opensource** in [#7232](https://github.com/danny-avila/Chat/pull/7232)
- 🐋 feat: Add python to Dockerfile for increased MCP compatibility by **@technicalpickles** in [#7270](https://github.com/danny-avila/Chat/pull/7270)
### 🔧 Fixes
- 🔧 fix: Google Gemma Support & OpenAI Reasoning Instructions by **@danny-avila** in [#7196](https://github.com/danny-avila/LibreChat/pull/7196)
- 🛠️ fix: Conversation Navigation State by **@danny-avila** in [#7210](https://github.com/danny-avila/LibreChat/pull/7210)
- 🔄 fix: o-Series Model Regex for System Messages by **@danny-avila** in [#7245](https://github.com/danny-avila/LibreChat/pull/7245)
- 🔖 fix: Custom Headers for Initial MCP SSE Connection by **@danny-avila** in [#7246](https://github.com/danny-avila/LibreChat/pull/7246)
- 🛡️ fix: Deep Clone `MCPOptions` for User MCP Connections by **@danny-avila** in [#7247](https://github.com/danny-avila/LibreChat/pull/7247)
- 🔄 fix: URL Param Race Condition and File Draft Persistence by **@danny-avila** in [#7257](https://github.com/danny-avila/LibreChat/pull/7257)
- 🔄 fix: Assistants Endpoint & Minor Issues by **@danny-avila** in [#7274](https://github.com/danny-avila/LibreChat/pull/7274)
- 🔄 fix: Ollama Think Tag Edge Case with Tools by **@danny-avila** in [#7275](https://github.com/danny-avila/LibreChat/pull/7275)
- 🔧 fix: Google Gemma Support & OpenAI Reasoning Instructions by **@danny-avila** in [#7196](https://github.com/danny-avila/Chat/pull/7196)
- 🛠️ fix: Conversation Navigation State by **@danny-avila** in [#7210](https://github.com/danny-avila/Chat/pull/7210)
- 🔄 fix: o-Series Model Regex for System Messages by **@danny-avila** in [#7245](https://github.com/danny-avila/Chat/pull/7245)
- 🔖 fix: Custom Headers for Initial MCP SSE Connection by **@danny-avila** in [#7246](https://github.com/danny-avila/Chat/pull/7246)
- 🛡️ fix: Deep Clone `MCPOptions` for User MCP Connections by **@danny-avila** in [#7247](https://github.com/danny-avila/Chat/pull/7247)
- 🔄 fix: URL Param Race Condition and File Draft Persistence by **@danny-avila** in [#7257](https://github.com/danny-avila/Chat/pull/7257)
- 🔄 fix: Assistants Endpoint & Minor Issues by **@danny-avila** in [#7274](https://github.com/danny-avila/Chat/pull/7274)
- 🔄 fix: Ollama Think Tag Edge Case with Tools by **@danny-avila** in [#7275](https://github.com/danny-avila/Chat/pull/7275)
### ⚙️ Other Changes
- 📜 docs: CHANGELOG for release v0.7.8-rc1 by **@github-actions[bot]** in [#7153](https://github.com/danny-avila/LibreChat/pull/7153)
- 🔄 refactor: Artifact Visibility Management by **@danny-avila** in [#7181](https://github.com/danny-avila/LibreChat/pull/7181)
- 📦 chore: Bump Package Security by **@danny-avila** in [#7183](https://github.com/danny-avila/LibreChat/pull/7183)
- 🌿 refactor: Unmount Fork Popover on Hide for Better Performance by **@danny-avila** in [#7189](https://github.com/danny-avila/LibreChat/pull/7189)
- 🧰 chore: ESLint configuration to enforce Prettier formatting rules by **@mawburn** in [#7186](https://github.com/danny-avila/LibreChat/pull/7186)
- 🎨 style: Improve KaTeX Rendering for LaTeX Equations by **@andresgit** in [#7223](https://github.com/danny-avila/LibreChat/pull/7223)
- 📝 docs: Update `.env.example` Google models by **@marlonka** in [#7254](https://github.com/danny-avila/LibreChat/pull/7254)
- 💬 refactor: MCP Chat Visibility Option, Google Rates, Remove OpenAPI Plugins by **@danny-avila** in [#7286](https://github.com/danny-avila/LibreChat/pull/7286)
- 📜 docs: Unreleased Changelog by **@github-actions[bot]** in [#7214](https://github.com/danny-avila/LibreChat/pull/7214)
- 📜 docs: CHANGELOG for release v0.7.8-rc1 by **@github-actions[bot]** in [#7153](https://github.com/danny-avila/Chat/pull/7153)
- 🔄 refactor: Artifact Visibility Management by **@danny-avila** in [#7181](https://github.com/danny-avila/Chat/pull/7181)
- 📦 chore: Bump Package Security by **@danny-avila** in [#7183](https://github.com/danny-avila/Chat/pull/7183)
- 🌿 refactor: Unmount Fork Popover on Hide for Better Performance by **@danny-avila** in [#7189](https://github.com/danny-avila/Chat/pull/7189)
- 🧰 chore: ESLint configuration to enforce Prettier formatting rules by **@mawburn** in [#7186](https://github.com/danny-avila/Chat/pull/7186)
- 🎨 style: Improve KaTeX Rendering for LaTeX Equations by **@andresgit** in [#7223](https://github.com/danny-avila/Chat/pull/7223)
- 📝 docs: Update `.env.example` Google models by **@marlonka** in [#7254](https://github.com/danny-avila/Chat/pull/7254)
- 💬 refactor: MCP Chat Visibility Option, Google Rates, Remove OpenAPI Plugins by **@danny-avila** in [#7286](https://github.com/danny-avila/Chat/pull/7286)
- 📜 docs: Unreleased Changelog by **@github-actions[bot]** in [#7214](https://github.com/danny-avila/Chat/pull/7214)
@@ -96,141 +96,141 @@ Changes from v0.7.7 to v0.7.8-rc1.
### ✨ New Features
- 🔍 feat: Mistral OCR API / Upload Files as Text by **@danny-avila** in [#6274](https://github.com/danny-avila/LibreChat/pull/6274)
- 🤖 feat: Support OpenAI Web Search models by **@danny-avila** in [#6313](https://github.com/danny-avila/LibreChat/pull/6313)
- 🔗 feat: Agent Chain (Mixture-of-Agents) by **@danny-avila** in [#6374](https://github.com/danny-avila/LibreChat/pull/6374)
- ⌛ feat: `initTimeout` for Slow Starting MCP Servers by **@perweij** in [#6383](https://github.com/danny-avila/LibreChat/pull/6383)
- 🚀 feat: `S3` Integration for File handling and Image uploads by **@rubentalstra** in [#6142](https://github.com/danny-avila/LibreChat/pull/6142)
- 🔒feat: Enable OpenID Auto-Redirect by **@leondape** in [#6066](https://github.com/danny-avila/LibreChat/pull/6066)
- 🚀 feat: Integrate `Azure Blob Storage` for file handling and image uploads by **@rubentalstra** in [#6153](https://github.com/danny-avila/LibreChat/pull/6153)
- 🚀 feat: Add support for custom `AWS` endpoint in `S3` by **@rubentalstra** in [#6431](https://github.com/danny-avila/LibreChat/pull/6431)
- 🚀 feat: Add support for LDAP STARTTLS in LDAP authentication by **@rubentalstra** in [#6438](https://github.com/danny-avila/LibreChat/pull/6438)
- 🚀 feat: Refactor schema exports and update package version to 0.0.4 by **@rubentalstra** in [#6455](https://github.com/danny-avila/LibreChat/pull/6455)
- 🔼 feat: Add Auto Submit For URL Query Params by **@mjaverto** in [#6440](https://github.com/danny-avila/LibreChat/pull/6440)
- 🛠 feat: Enhance Redis Integration, Rate Limiters & Log Headers by **@danny-avila** in [#6462](https://github.com/danny-avila/LibreChat/pull/6462)
- 💵 feat: Add Automatic Balance Refill by **@rubentalstra** in [#6452](https://github.com/danny-avila/LibreChat/pull/6452)
- 🗣️ feat: add support for gpt-4o-transcribe models by **@berry-13** in [#6483](https://github.com/danny-avila/LibreChat/pull/6483)
- 🎨 feat: UI Refresh for Enhanced UX by **@berry-13** in [#6346](https://github.com/danny-avila/LibreChat/pull/6346)
- 🌍 feat: Add support for Hungarian language localization by **@rubentalstra** in [#6508](https://github.com/danny-avila/LibreChat/pull/6508)
- 🚀 feat: Add Gemini 2.5 Token/Context Values, Increase Max Possible Output to 64k by **@danny-avila** in [#6563](https://github.com/danny-avila/LibreChat/pull/6563)
- 🚀 feat: Enhance MCP Connections For Multi-User Support by **@danny-avila** in [#6610](https://github.com/danny-avila/LibreChat/pull/6610)
- 🚀 feat: Enhance S3 URL Expiry with Refresh; fix: S3 File Deletion by **@danny-avila** in [#6647](https://github.com/danny-avila/LibreChat/pull/6647)
- 🚀 feat: enhance UI components and refactor settings by **@berry-13** in [#6625](https://github.com/danny-avila/LibreChat/pull/6625)
- 💬 feat: move TemporaryChat to the Header by **@berry-13** in [#6646](https://github.com/danny-avila/LibreChat/pull/6646)
- 🚀 feat: Use Model Specs + Specific Endpoints, Limit Providers for Agents by **@danny-avila** in [#6650](https://github.com/danny-avila/LibreChat/pull/6650)
- 🪙 feat: Sync Balance Config on Login by **@danny-avila** in [#6671](https://github.com/danny-avila/LibreChat/pull/6671)
- 🔦 feat: MCP Support for Non-Agent Endpoints by **@danny-avila** in [#6775](https://github.com/danny-avila/LibreChat/pull/6775)
- 🗃️ feat: Code Interpreter File Persistence between Sessions by **@danny-avila** in [#6790](https://github.com/danny-avila/LibreChat/pull/6790)
- 🖥️ feat: Code Interpreter API for Non-Agent Endpoints by **@danny-avila** in [#6803](https://github.com/danny-avila/LibreChat/pull/6803)
- ⚡ feat: Self-hosted Artifacts Static Bundler URL by **@danny-avila** in [#6827](https://github.com/danny-avila/LibreChat/pull/6827)
- 🐳 feat: Add Jemalloc and UV to Docker Builds by **@danny-avila** in [#6836](https://github.com/danny-avila/LibreChat/pull/6836)
- 🤖 feat: GPT-4.1 by **@danny-avila** in [#6880](https://github.com/danny-avila/LibreChat/pull/6880)
- 👋 feat: remove Edge TTS by **@berry-13** in [#6885](https://github.com/danny-avila/LibreChat/pull/6885)
- feat: nav optimization by **@berry-13** in [#5785](https://github.com/danny-avila/LibreChat/pull/5785)
- 🗺️ feat: Add Parameter Location Mapping for OpenAPI actions by **@peeeteeer** in [#6858](https://github.com/danny-avila/LibreChat/pull/6858)
- 🤖 feat: Support `o4-mini` and `o3` Models by **@danny-avila** in [#6928](https://github.com/danny-avila/LibreChat/pull/6928)
- 🎨 feat: OpenAI Image Tools (GPT-Image-1) by **@danny-avila** in [#7079](https://github.com/danny-avila/LibreChat/pull/7079)
- 🗓️ feat: Add Special Variables for Prompts & Agents, Prompt UI Improvements by **@danny-avila** in [#7123](https://github.com/danny-avila/LibreChat/pull/7123)
- 🔍 feat: Mistral OCR API / Upload Files as Text by **@danny-avila** in [#6274](https://github.com/danny-avila/Chat/pull/6274)
- 🤖 feat: Support OpenAI Web Search models by **@danny-avila** in [#6313](https://github.com/danny-avila/Chat/pull/6313)
- 🔗 feat: Agent Chain (Mixture-of-Agents) by **@danny-avila** in [#6374](https://github.com/danny-avila/Chat/pull/6374)
- ⌛ feat: `initTimeout` for Slow Starting MCP Servers by **@perweij** in [#6383](https://github.com/danny-avila/Chat/pull/6383)
- 🚀 feat: `S3` Integration for File handling and Image uploads by **@rubentalstra** in [#6142](https://github.com/danny-avila/Chat/pull/6142)
- 🔒feat: Enable OpenID Auto-Redirect by **@leondape** in [#6066](https://github.com/danny-avila/Chat/pull/6066)
- 🚀 feat: Integrate `Azure Blob Storage` for file handling and image uploads by **@rubentalstra** in [#6153](https://github.com/danny-avila/Chat/pull/6153)
- 🚀 feat: Add support for custom `AWS` endpoint in `S3` by **@rubentalstra** in [#6431](https://github.com/danny-avila/Chat/pull/6431)
- 🚀 feat: Add support for LDAP STARTTLS in LDAP authentication by **@rubentalstra** in [#6438](https://github.com/danny-avila/Chat/pull/6438)
- 🚀 feat: Refactor schema exports and update package version to 0.0.4 by **@rubentalstra** in [#6455](https://github.com/danny-avila/Chat/pull/6455)
- 🔼 feat: Add Auto Submit For URL Query Params by **@mjaverto** in [#6440](https://github.com/danny-avila/Chat/pull/6440)
- 🛠 feat: Enhance Redis Integration, Rate Limiters & Log Headers by **@danny-avila** in [#6462](https://github.com/danny-avila/Chat/pull/6462)
- 💵 feat: Add Automatic Balance Refill by **@rubentalstra** in [#6452](https://github.com/danny-avila/Chat/pull/6452)
- 🗣️ feat: add support for gpt-4o-transcribe models by **@berry-13** in [#6483](https://github.com/danny-avila/Chat/pull/6483)
- 🎨 feat: UI Refresh for Enhanced UX by **@berry-13** in [#6346](https://github.com/danny-avila/Chat/pull/6346)
- 🌍 feat: Add support for Hungarian language localization by **@rubentalstra** in [#6508](https://github.com/danny-avila/Chat/pull/6508)
- 🚀 feat: Add Gemini 2.5 Token/Context Values, Increase Max Possible Output to 64k by **@danny-avila** in [#6563](https://github.com/danny-avila/Chat/pull/6563)
- 🚀 feat: Enhance MCP Connections For Multi-User Support by **@danny-avila** in [#6610](https://github.com/danny-avila/Chat/pull/6610)
- 🚀 feat: Enhance S3 URL Expiry with Refresh; fix: S3 File Deletion by **@danny-avila** in [#6647](https://github.com/danny-avila/Chat/pull/6647)
- 🚀 feat: enhance UI components and refactor settings by **@berry-13** in [#6625](https://github.com/danny-avila/Chat/pull/6625)
- 💬 feat: move TemporaryChat to the Header by **@berry-13** in [#6646](https://github.com/danny-avila/Chat/pull/6646)
- 🚀 feat: Use Model Specs + Specific Endpoints, Limit Providers for Agents by **@danny-avila** in [#6650](https://github.com/danny-avila/Chat/pull/6650)
- 🪙 feat: Sync Balance Config on Login by **@danny-avila** in [#6671](https://github.com/danny-avila/Chat/pull/6671)
- 🔦 feat: MCP Support for Non-Agent Endpoints by **@danny-avila** in [#6775](https://github.com/danny-avila/Chat/pull/6775)
- 🗃️ feat: Code Interpreter File Persistence between Sessions by **@danny-avila** in [#6790](https://github.com/danny-avila/Chat/pull/6790)
- 🖥️ feat: Code Interpreter API for Non-Agent Endpoints by **@danny-avila** in [#6803](https://github.com/danny-avila/Chat/pull/6803)
- ⚡ feat: Self-hosted Artifacts Static Bundler URL by **@danny-avila** in [#6827](https://github.com/danny-avila/Chat/pull/6827)
- 🐳 feat: Add Jemalloc and UV to Docker Builds by **@danny-avila** in [#6836](https://github.com/danny-avila/Chat/pull/6836)
- 🤖 feat: GPT-4.1 by **@danny-avila** in [#6880](https://github.com/danny-avila/Chat/pull/6880)
- 👋 feat: remove Edge TTS by **@berry-13** in [#6885](https://github.com/danny-avila/Chat/pull/6885)
- feat: nav optimization by **@berry-13** in [#5785](https://github.com/danny-avila/Chat/pull/5785)
- 🗺️ feat: Add Parameter Location Mapping for OpenAPI actions by **@peeeteeer** in [#6858](https://github.com/danny-avila/Chat/pull/6858)
- 🤖 feat: Support `o4-mini` and `o3` Models by **@danny-avila** in [#6928](https://github.com/danny-avila/Chat/pull/6928)
- 🎨 feat: OpenAI Image Tools (GPT-Image-1) by **@danny-avila** in [#7079](https://github.com/danny-avila/Chat/pull/7079)
- 🗓️ feat: Add Special Variables for Prompts & Agents, Prompt UI Improvements by **@danny-avila** in [#7123](https://github.com/danny-avila/Chat/pull/7123)
### 🌍 Internationalization
- 🌍 i18n: Add Thai Language Support and Update Translations by **@rubentalstra** in [#6219](https://github.com/danny-avila/LibreChat/pull/6219)
- 🌍 i18n: Update translation.json with latest translations by **@github-actions[bot]** in [#6220](https://github.com/danny-avila/LibreChat/pull/6220)
- 🌍 i18n: Update translation.json with latest translations by **@github-actions[bot]** in [#6240](https://github.com/danny-avila/LibreChat/pull/6240)
- 🌍 i18n: Update translation.json with latest translations by **@github-actions[bot]** in [#6241](https://github.com/danny-avila/LibreChat/pull/6241)
- 🌍 i18n: Update translation.json with latest translations by **@github-actions[bot]** in [#6277](https://github.com/danny-avila/LibreChat/pull/6277)
- 🌍 i18n: Update translation.json with latest translations by **@github-actions[bot]** in [#6414](https://github.com/danny-avila/LibreChat/pull/6414)
- 🌍 i18n: Update translation.json with latest translations by **@github-actions[bot]** in [#6505](https://github.com/danny-avila/LibreChat/pull/6505)
- 🌍 i18n: Update translation.json with latest translations by **@github-actions[bot]** in [#6530](https://github.com/danny-avila/LibreChat/pull/6530)
- 🌍 i18n: Add Persian Localization Support by **@rubentalstra** in [#6669](https://github.com/danny-avila/LibreChat/pull/6669)
- 🌍 i18n: Update translation.json with latest translations by **@github-actions[bot]** in [#6667](https://github.com/danny-avila/LibreChat/pull/6667)
- 🌍 i18n: Update translation.json with latest translations by **@github-actions[bot]** in [#7126](https://github.com/danny-avila/LibreChat/pull/7126)
- 🌍 i18n: Update translation.json with latest translations by **@github-actions[bot]** in [#7148](https://github.com/danny-avila/LibreChat/pull/7148)
- 🌍 i18n: Add Thai Language Support and Update Translations by **@rubentalstra** in [#6219](https://github.com/danny-avila/Chat/pull/6219)
- 🌍 i18n: Update translation.json with latest translations by **@github-actions[bot]** in [#6220](https://github.com/danny-avila/Chat/pull/6220)
- 🌍 i18n: Update translation.json with latest translations by **@github-actions[bot]** in [#6240](https://github.com/danny-avila/Chat/pull/6240)
- 🌍 i18n: Update translation.json with latest translations by **@github-actions[bot]** in [#6241](https://github.com/danny-avila/Chat/pull/6241)
- 🌍 i18n: Update translation.json with latest translations by **@github-actions[bot]** in [#6277](https://github.com/danny-avila/Chat/pull/6277)
- 🌍 i18n: Update translation.json with latest translations by **@github-actions[bot]** in [#6414](https://github.com/danny-avila/Chat/pull/6414)
- 🌍 i18n: Update translation.json with latest translations by **@github-actions[bot]** in [#6505](https://github.com/danny-avila/Chat/pull/6505)
- 🌍 i18n: Update translation.json with latest translations by **@github-actions[bot]** in [#6530](https://github.com/danny-avila/Chat/pull/6530)
- 🌍 i18n: Add Persian Localization Support by **@rubentalstra** in [#6669](https://github.com/danny-avila/Chat/pull/6669)
- 🌍 i18n: Update translation.json with latest translations by **@github-actions[bot]** in [#6667](https://github.com/danny-avila/Chat/pull/6667)
- 🌍 i18n: Update translation.json with latest translations by **@github-actions[bot]** in [#7126](https://github.com/danny-avila/Chat/pull/7126)
- 🌍 i18n: Update translation.json with latest translations by **@github-actions[bot]** in [#7148](https://github.com/danny-avila/Chat/pull/7148)
### 👐 Accessibility
- 🎨 a11y: Update Model Spec Description Text by **@berry-13** in [#6294](https://github.com/danny-avila/LibreChat/pull/6294)
- 🗑️ a11y: Add Accessible Name to Button for File Attachment Removal by **@kangabell** in [#6709](https://github.com/danny-avila/LibreChat/pull/6709)
- ⌨️ a11y: enhance accessibility & visual consistency by **@berry-13** in [#6866](https://github.com/danny-avila/LibreChat/pull/6866)
- 🙌 a11y: Searchbar/Conversations List Focus by **@danny-avila** in [#7096](https://github.com/danny-avila/LibreChat/pull/7096)
- 👐 a11y: Improve Fork and SplitText Accessibility by **@danny-avila** in [#7147](https://github.com/danny-avila/LibreChat/pull/7147)
- 🎨 a11y: Update Model Spec Description Text by **@berry-13** in [#6294](https://github.com/danny-avila/Chat/pull/6294)
- 🗑️ a11y: Add Accessible Name to Button for File Attachment Removal by **@kangabell** in [#6709](https://github.com/danny-avila/Chat/pull/6709)
- ⌨️ a11y: enhance accessibility & visual consistency by **@berry-13** in [#6866](https://github.com/danny-avila/Chat/pull/6866)
- 🙌 a11y: Searchbar/Conversations List Focus by **@danny-avila** in [#7096](https://github.com/danny-avila/Chat/pull/7096)
- 👐 a11y: Improve Fork and SplitText Accessibility by **@danny-avila** in [#7147](https://github.com/danny-avila/Chat/pull/7147)
### 🔧 Fixes
- 🐛 fix: Avatar Type Definitions in Agent/Assistant Schemas by **@danny-avila** in [#6235](https://github.com/danny-avila/LibreChat/pull/6235)
- 🔧 fix: MeiliSearch Field Error and Patch Incorrect Import by #6210 by **@rubentalstra** in [#6245](https://github.com/danny-avila/LibreChat/pull/6245)
- 🔏 fix: Enhance Two-Factor Authentication by **@rubentalstra** in [#6247](https://github.com/danny-avila/LibreChat/pull/6247)
- 🐛 fix: Await saveMessage in abortMiddleware to ensure proper execution by **@sh4shii** in [#6248](https://github.com/danny-avila/LibreChat/pull/6248)
- 🔧 fix: Axios Proxy Usage And Bump `mongoose` by **@danny-avila** in [#6298](https://github.com/danny-avila/LibreChat/pull/6298)
- 🔧 fix: comment out MCP servers to resolve service run issues by **@KunalScriptz** in [#6316](https://github.com/danny-avila/LibreChat/pull/6316)
- 🔧 fix: Update Token Calculations and Mapping, MCP `env` Initialization by **@danny-avila** in [#6406](https://github.com/danny-avila/LibreChat/pull/6406)
- 🐞 fix: Agent "Resend" Message Attachments + Source Icon Styling by **@danny-avila** in [#6408](https://github.com/danny-avila/LibreChat/pull/6408)
- 🐛 fix: Prevent Crash on Duplicate Message ID by **@Odrec** in [#6392](https://github.com/danny-avila/LibreChat/pull/6392)
- 🔐 fix: Invalid Key Length in 2FA Encryption by **@rubentalstra** in [#6432](https://github.com/danny-avila/LibreChat/pull/6432)
- 🏗️ fix: Fix Agents Token Spend Race Conditions, Expand Test Coverage by **@danny-avila** in [#6480](https://github.com/danny-avila/LibreChat/pull/6480)
- 🔃 fix: Draft Clearing, Claude Titles, Remove Default Vision Max Tokens by **@danny-avila** in [#6501](https://github.com/danny-avila/LibreChat/pull/6501)
- 🔧 fix: Update username reference to use user.name in greeting display by **@rubentalstra** in [#6534](https://github.com/danny-avila/LibreChat/pull/6534)
- 🔧 fix: S3 Download Stream with Key Extraction and Blob Storage Encoding for Vision by **@danny-avila** in [#6557](https://github.com/danny-avila/LibreChat/pull/6557)
- 🔧 fix: Mistral type strictness for `usage` & update token values/windows by **@danny-avila** in [#6562](https://github.com/danny-avila/LibreChat/pull/6562)
- 🔧 fix: Consolidate Text Parsing and TTS Edge Initialization by **@danny-avila** in [#6582](https://github.com/danny-avila/LibreChat/pull/6582)
- 🔧 fix: Ensure continuation in image processing on base64 encoding from Blob Storage by **@danny-avila** in [#6619](https://github.com/danny-avila/LibreChat/pull/6619)
- ✉️ fix: Fallback For User Name In Email Templates by **@danny-avila** in [#6620](https://github.com/danny-avila/LibreChat/pull/6620)
- 🔧 fix: Azure Blob Integration and File Source References by **@rubentalstra** in [#6575](https://github.com/danny-avila/LibreChat/pull/6575)
- 🐛 fix: Safeguard against undefined addedEndpoints by **@wipash** in [#6654](https://github.com/danny-avila/LibreChat/pull/6654)
- 🤖 fix: Gemini 2.5 Vision Support by **@danny-avila** in [#6663](https://github.com/danny-avila/LibreChat/pull/6663)
- 🔄 fix: Avatar & Error Handling Enhancements by **@danny-avila** in [#6687](https://github.com/danny-avila/LibreChat/pull/6687)
- 🔧 fix: Chat Middleware, Zod Conversion, Auto-Save and S3 URL Refresh by **@danny-avila** in [#6720](https://github.com/danny-avila/LibreChat/pull/6720)
- 🔧 fix: Agent Capability Checks & DocumentDB Compatibility for Agent Resource Removal by **@danny-avila** in [#6726](https://github.com/danny-avila/LibreChat/pull/6726)
- 🔄 fix: Improve audio MIME type detection and handling by **@berry-13** in [#6707](https://github.com/danny-avila/LibreChat/pull/6707)
- 🪺 fix: Update Role Handling due to New Schema Shape by **@danny-avila** in [#6774](https://github.com/danny-avila/LibreChat/pull/6774)
- 🗨️ fix: Show ModelSpec Greeting by **@berry-13** in [#6770](https://github.com/danny-avila/LibreChat/pull/6770)
- 🔧 fix: Keyv and Proxy Issues, and More Memory Optimizations by **@danny-avila** in [#6867](https://github.com/danny-avila/LibreChat/pull/6867)
- ✨ fix: Implement dynamic text sizing for greeting and name display by **@berry-13** in [#6833](https://github.com/danny-avila/LibreChat/pull/6833)
- 📝 fix: Mistral OCR Image Support and Azure Agent Titles by **@danny-avila** in [#6901](https://github.com/danny-avila/LibreChat/pull/6901)
- 📢 fix: Invalid `engineTTS` and Conversation State on Navigation by **@berry-13** in [#6904](https://github.com/danny-avila/LibreChat/pull/6904)
- 🛠️ fix: Improve Accessibility and Display of Conversation Menu by **@danny-avila** in [#6913](https://github.com/danny-avila/LibreChat/pull/6913)
- 🔧 fix: Agent Resource Form, Convo Menu Style, Ensure Draft Clears on Submission by **@danny-avila** in [#6925](https://github.com/danny-avila/LibreChat/pull/6925)
- 🔀 fix: MCP Improvements, Auto-Save Drafts, Artifact Markup by **@danny-avila** in [#7040](https://github.com/danny-avila/LibreChat/pull/7040)
- 🐋 fix: Improve Deepseek Compatbility by **@danny-avila** in [#7132](https://github.com/danny-avila/LibreChat/pull/7132)
- 🐙 fix: Add Redis Ping Interval to Prevent Connection Drops by **@peeeteeer** in [#7127](https://github.com/danny-avila/LibreChat/pull/7127)
- 🐛 fix: Avatar Type Definitions in Agent/Assistant Schemas by **@danny-avila** in [#6235](https://github.com/danny-avila/Chat/pull/6235)
- 🔧 fix: MeiliSearch Field Error and Patch Incorrect Import by #6210 by **@rubentalstra** in [#6245](https://github.com/danny-avila/Chat/pull/6245)
- 🔏 fix: Enhance Two-Factor Authentication by **@rubentalstra** in [#6247](https://github.com/danny-avila/Chat/pull/6247)
- 🐛 fix: Await saveMessage in abortMiddleware to ensure proper execution by **@sh4shii** in [#6248](https://github.com/danny-avila/Chat/pull/6248)
- 🔧 fix: Axios Proxy Usage And Bump `mongoose` by **@danny-avila** in [#6298](https://github.com/danny-avila/Chat/pull/6298)
- 🔧 fix: comment out MCP servers to resolve service run issues by **@KunalScriptz** in [#6316](https://github.com/danny-avila/Chat/pull/6316)
- 🔧 fix: Update Token Calculations and Mapping, MCP `env` Initialization by **@danny-avila** in [#6406](https://github.com/danny-avila/Chat/pull/6406)
- 🐞 fix: Agent "Resend" Message Attachments + Source Icon Styling by **@danny-avila** in [#6408](https://github.com/danny-avila/Chat/pull/6408)
- 🐛 fix: Prevent Crash on Duplicate Message ID by **@Odrec** in [#6392](https://github.com/danny-avila/Chat/pull/6392)
- 🔐 fix: Invalid Key Length in 2FA Encryption by **@rubentalstra** in [#6432](https://github.com/danny-avila/Chat/pull/6432)
- 🏗️ fix: Fix Agents Token Spend Race Conditions, Expand Test Coverage by **@danny-avila** in [#6480](https://github.com/danny-avila/Chat/pull/6480)
- 🔃 fix: Draft Clearing, Claude Titles, Remove Default Vision Max Tokens by **@danny-avila** in [#6501](https://github.com/danny-avila/Chat/pull/6501)
- 🔧 fix: Update username reference to use user.name in greeting display by **@rubentalstra** in [#6534](https://github.com/danny-avila/Chat/pull/6534)
- 🔧 fix: S3 Download Stream with Key Extraction and Blob Storage Encoding for Vision by **@danny-avila** in [#6557](https://github.com/danny-avila/Chat/pull/6557)
- 🔧 fix: Mistral type strictness for `usage` & update token values/windows by **@danny-avila** in [#6562](https://github.com/danny-avila/Chat/pull/6562)
- 🔧 fix: Consolidate Text Parsing and TTS Edge Initialization by **@danny-avila** in [#6582](https://github.com/danny-avila/Chat/pull/6582)
- 🔧 fix: Ensure continuation in image processing on base64 encoding from Blob Storage by **@danny-avila** in [#6619](https://github.com/danny-avila/Chat/pull/6619)
- ✉️ fix: Fallback For User Name In Email Templates by **@danny-avila** in [#6620](https://github.com/danny-avila/Chat/pull/6620)
- 🔧 fix: Azure Blob Integration and File Source References by **@rubentalstra** in [#6575](https://github.com/danny-avila/Chat/pull/6575)
- 🐛 fix: Safeguard against undefined addedEndpoints by **@wipash** in [#6654](https://github.com/danny-avila/Chat/pull/6654)
- 🤖 fix: Gemini 2.5 Vision Support by **@danny-avila** in [#6663](https://github.com/danny-avila/Chat/pull/6663)
- 🔄 fix: Avatar & Error Handling Enhancements by **@danny-avila** in [#6687](https://github.com/danny-avila/Chat/pull/6687)
- 🔧 fix: Chat Middleware, Zod Conversion, Auto-Save and S3 URL Refresh by **@danny-avila** in [#6720](https://github.com/danny-avila/Chat/pull/6720)
- 🔧 fix: Agent Capability Checks & DocumentDB Compatibility for Agent Resource Removal by **@danny-avila** in [#6726](https://github.com/danny-avila/Chat/pull/6726)
- 🔄 fix: Improve audio MIME type detection and handling by **@berry-13** in [#6707](https://github.com/danny-avila/Chat/pull/6707)
- 🪺 fix: Update Role Handling due to New Schema Shape by **@danny-avila** in [#6774](https://github.com/danny-avila/Chat/pull/6774)
- 🗨️ fix: Show ModelSpec Greeting by **@berry-13** in [#6770](https://github.com/danny-avila/Chat/pull/6770)
- 🔧 fix: Keyv and Proxy Issues, and More Memory Optimizations by **@danny-avila** in [#6867](https://github.com/danny-avila/Chat/pull/6867)
- ✨ fix: Implement dynamic text sizing for greeting and name display by **@berry-13** in [#6833](https://github.com/danny-avila/Chat/pull/6833)
- 📝 fix: Mistral OCR Image Support and Azure Agent Titles by **@danny-avila** in [#6901](https://github.com/danny-avila/Chat/pull/6901)
- 📢 fix: Invalid `engineTTS` and Conversation State on Navigation by **@berry-13** in [#6904](https://github.com/danny-avila/Chat/pull/6904)
- 🛠️ fix: Improve Accessibility and Display of Conversation Menu by **@danny-avila** in [#6913](https://github.com/danny-avila/Chat/pull/6913)
- 🔧 fix: Agent Resource Form, Convo Menu Style, Ensure Draft Clears on Submission by **@danny-avila** in [#6925](https://github.com/danny-avila/Chat/pull/6925)
- 🔀 fix: MCP Improvements, Auto-Save Drafts, Artifact Markup by **@danny-avila** in [#7040](https://github.com/danny-avila/Chat/pull/7040)
- 🐋 fix: Improve Deepseek Compatbility by **@danny-avila** in [#7132](https://github.com/danny-avila/Chat/pull/7132)
- 🐙 fix: Add Redis Ping Interval to Prevent Connection Drops by **@peeeteeer** in [#7127](https://github.com/danny-avila/Chat/pull/7127)
### ⚙️ Other Changes
- 📦 refactor: Move DB Models to `@librechat/data-schemas` by **@rubentalstra** in [#6210](https://github.com/danny-avila/LibreChat/pull/6210)
- 📦 chore: Patch `axios` to address CVE-2025-27152 by **@danny-avila** in [#6222](https://github.com/danny-avila/LibreChat/pull/6222)
- ⚠️ refactor: Use Error Content Part Instead Of Throwing Error for Agents by **@danny-avila** in [#6262](https://github.com/danny-avila/LibreChat/pull/6262)
- 🏃♂️ refactor: Improve Agent Run Context & Misc. Changes by **@danny-avila** in [#6448](https://github.com/danny-avila/LibreChat/pull/6448)
- 📝 docs: librechat.example.yaml by **@ineiti** in [#6442](https://github.com/danny-avila/LibreChat/pull/6442)
- 🏃♂️ refactor: More Agent Context Improvements during Run by **@danny-avila** in [#6477](https://github.com/danny-avila/LibreChat/pull/6477)
- 🔃 refactor: Allow streaming for `o1` models by **@danny-avila** in [#6509](https://github.com/danny-avila/LibreChat/pull/6509)
- 🔧 chore: `Vite` Plugin Upgrades & Config Optimizations by **@rubentalstra** in [#6547](https://github.com/danny-avila/LibreChat/pull/6547)
- 🔧 refactor: Consolidate Logging, Model Selection & Actions Optimizations, Minor Fixes by **@danny-avila** in [#6553](https://github.com/danny-avila/LibreChat/pull/6553)
- 🎨 style: Address Minor UI Refresh Issues by **@berry-13** in [#6552](https://github.com/danny-avila/LibreChat/pull/6552)
- 🔧 refactor: Enhance Model & Endpoint Configurations with Global Indicators 🌍 by **@berry-13** in [#6578](https://github.com/danny-avila/LibreChat/pull/6578)
- 💬 style: Chat UI, Greeting, and Message adjustments by **@berry-13** in [#6612](https://github.com/danny-avila/LibreChat/pull/6612)
- ⚡ refactor: DocumentDB Compatibility for Balance Updates by **@danny-avila** in [#6673](https://github.com/danny-avila/LibreChat/pull/6673)
- 🧹 chore: Update ESLint rules for React hooks by **@rubentalstra** in [#6685](https://github.com/danny-avila/LibreChat/pull/6685)
- 🪙 chore: Update Gemini Pricing by **@RedwindA** in [#6731](https://github.com/danny-avila/LibreChat/pull/6731)
- 🪺 refactor: Nest Permission fields for Roles by **@rubentalstra** in [#6487](https://github.com/danny-avila/LibreChat/pull/6487)
- 📦 chore: Update `caniuse-lite` dependency to version 1.0.30001706 by **@rubentalstra** in [#6482](https://github.com/danny-avila/LibreChat/pull/6482)
- ⚙️ refactor: OAuth Flow Signal, Type Safety, Tool Progress & Updated Packages by **@danny-avila** in [#6752](https://github.com/danny-avila/LibreChat/pull/6752)
- 📦 chore: bump vite from 6.2.3 to 6.2.5 by **@dependabot[bot]** in [#6745](https://github.com/danny-avila/LibreChat/pull/6745)
- 💾 chore: Enhance Local Storage Handling and Update MCP SDK by **@danny-avila** in [#6809](https://github.com/danny-avila/LibreChat/pull/6809)
- 🤖 refactor: Improve Agents Memory Usage, Bump Keyv, Grok 3 by **@danny-avila** in [#6850](https://github.com/danny-avila/LibreChat/pull/6850)
- 💾 refactor: Enhance Memory In Image Encodings & Client Disposal by **@danny-avila** in [#6852](https://github.com/danny-avila/LibreChat/pull/6852)
- 🔁 refactor: Token Event Handler and Standardize `maxTokens` Key by **@danny-avila** in [#6886](https://github.com/danny-avila/LibreChat/pull/6886)
- 🔍 refactor: Search & Message Retrieval by **@berry-13** in [#6903](https://github.com/danny-avila/LibreChat/pull/6903)
- 🎨 style: standardize dropdown styling & fix z-Index layering by **@berry-13** in [#6939](https://github.com/danny-avila/LibreChat/pull/6939)
- 📙 docs: CONTRIBUTING.md by **@dblock** in [#6831](https://github.com/danny-avila/LibreChat/pull/6831)
- 🧭 refactor: Modernize Nav/Header by **@danny-avila** in [#7094](https://github.com/danny-avila/LibreChat/pull/7094)
- 🪶 refactor: Chat Input Focus for Conversation Navigations & ChatForm Optimizations by **@danny-avila** in [#7100](https://github.com/danny-avila/LibreChat/pull/7100)
- 🔃 refactor: Streamline Navigation, Message Loading UX by **@danny-avila** in [#7118](https://github.com/danny-avila/LibreChat/pull/7118)
- 📜 docs: Unreleased changelog by **@github-actions[bot]** in [#6265](https://github.com/danny-avila/LibreChat/pull/6265)
- 📦 refactor: Move DB Models to `@hanzochat/data-schemas` by **@rubentalstra** in [#6210](https://github.com/danny-avila/Chat/pull/6210)
- 📦 chore: Patch `axios` to address CVE-2025-27152 by **@danny-avila** in [#6222](https://github.com/danny-avila/Chat/pull/6222)
- ⚠️ refactor: Use Error Content Part Instead Of Throwing Error for Agents by **@danny-avila** in [#6262](https://github.com/danny-avila/Chat/pull/6262)
- 🏃♂️ refactor: Improve Agent Run Context & Misc. Changes by **@danny-avila** in [#6448](https://github.com/danny-avila/Chat/pull/6448)
- 📝 docs: chat.example.yaml by **@ineiti** in [#6442](https://github.com/danny-avila/Chat/pull/6442)
- 🏃♂️ refactor: More Agent Context Improvements during Run by **@danny-avila** in [#6477](https://github.com/danny-avila/Chat/pull/6477)
- 🔃 refactor: Allow streaming for `o1` models by **@danny-avila** in [#6509](https://github.com/danny-avila/Chat/pull/6509)
- 🔧 chore: `Vite` Plugin Upgrades & Config Optimizations by **@rubentalstra** in [#6547](https://github.com/danny-avila/Chat/pull/6547)
- 🔧 refactor: Consolidate Logging, Model Selection & Actions Optimizations, Minor Fixes by **@danny-avila** in [#6553](https://github.com/danny-avila/Chat/pull/6553)
- 🎨 style: Address Minor UI Refresh Issues by **@berry-13** in [#6552](https://github.com/danny-avila/Chat/pull/6552)
- 🔧 refactor: Enhance Model & Endpoint Configurations with Global Indicators 🌍 by **@berry-13** in [#6578](https://github.com/danny-avila/Chat/pull/6578)
- 💬 style: Chat UI, Greeting, and Message adjustments by **@berry-13** in [#6612](https://github.com/danny-avila/Chat/pull/6612)
- ⚡ refactor: DocumentDB Compatibility for Balance Updates by **@danny-avila** in [#6673](https://github.com/danny-avila/Chat/pull/6673)
- 🧹 chore: Update ESLint rules for React hooks by **@rubentalstra** in [#6685](https://github.com/danny-avila/Chat/pull/6685)
- 🪙 chore: Update Gemini Pricing by **@RedwindA** in [#6731](https://github.com/danny-avila/Chat/pull/6731)
- 🪺 refactor: Nest Permission fields for Roles by **@rubentalstra** in [#6487](https://github.com/danny-avila/Chat/pull/6487)
- 📦 chore: Update `caniuse-lite` dependency to version 1.0.30001706 by **@rubentalstra** in [#6482](https://github.com/danny-avila/Chat/pull/6482)
- ⚙️ refactor: OAuth Flow Signal, Type Safety, Tool Progress & Updated Packages by **@danny-avila** in [#6752](https://github.com/danny-avila/Chat/pull/6752)
- 📦 chore: bump vite from 6.2.3 to 6.2.5 by **@dependabot[bot]** in [#6745](https://github.com/danny-avila/Chat/pull/6745)
- 💾 chore: Enhance Local Storage Handling and Update MCP SDK by **@danny-avila** in [#6809](https://github.com/danny-avila/Chat/pull/6809)
- 🤖 refactor: Improve Agents Memory Usage, Bump Keyv, Grok 3 by **@danny-avila** in [#6850](https://github.com/danny-avila/Chat/pull/6850)
- 💾 refactor: Enhance Memory In Image Encodings & Client Disposal by **@danny-avila** in [#6852](https://github.com/danny-avila/Chat/pull/6852)
- 🔁 refactor: Token Event Handler and Standardize `maxTokens` Key by **@danny-avila** in [#6886](https://github.com/danny-avila/Chat/pull/6886)
- 🔍 refactor: Search & Message Retrieval by **@berry-13** in [#6903](https://github.com/danny-avila/Chat/pull/6903)
- 🎨 style: standardize dropdown styling & fix z-Index layering by **@berry-13** in [#6939](https://github.com/danny-avila/Chat/pull/6939)
- 📙 docs: CONTRIBUTING.md by **@dblock** in [#6831](https://github.com/danny-avila/Chat/pull/6831)
- 🧭 refactor: Modernize Nav/Header by **@danny-avila** in [#7094](https://github.com/danny-avila/Chat/pull/7094)
- 🪶 refactor: Chat Input Focus for Conversation Navigations & ChatForm Optimizations by **@danny-avila** in [#7100](https://github.com/danny-avila/Chat/pull/7100)
- 🔃 refactor: Streamline Navigation, Message Loading UX by **@danny-avila** in [#7118](https://github.com/danny-avila/Chat/pull/7118)
- 📜 docs: Unreleased changelog by **@github-actions[bot]** in [#6265](https://github.com/danny-avila/Chat/pull/6265)
AI-powered chat platform with enterprise features, using Hanzo's cloud API or local deployment.
# Hanzo Chat
## Quick Start
The chat surface of the Hanzo AI cloud: multi-model chat with agents, tools, and retrieval, running on Hanzo's backend. Live at [hanzo.chat](https://hanzo.chat).
Hanzo Chat is a sibling to [hanzo.app](https://hanzo.app) (the app builder) and the Hanzo console (admin). All inference, code execution, and web search route through the unified Hanzo API at `api.hanzo.ai/v1`, and sign-in is federated to Hanzo IAM ([hanzo.id](https://hanzo.id)).
## Features
- **Multi-model chat** — the Zen model family and other frontier models, served through `api.hanzo.ai`.
- **Agents** — build agents in the thread, or run your Hanzo Cloud agents (`/v1/agents`) with an `/agent` command or `@mention`.
- **MCP tools** — connect Model Context Protocol servers for tool use.
- **RAG** — chat over your own files and documents.
- **Web search** — grounded answers via Hanzo web search.
- **Code interpreter** — run code in a sandboxed runtime.
- **Image generation** — generate images inline.
- **Guest chat** — try a free Zen model with no account (optional, off by default).
## Requirements
- Node.js 24 (see `.nvmrc`)
- pnpm 10
- A Hanzo API key — get one at [hanzo.ai/dashboard](https://hanzo.ai/dashboard)
## Quick start (Docker)
```bash
# Clone and setup
git clone https://github.com/hanzoai/chat.git
cd chat
# Copy environment template
cp .env.example .env
# Edit .env and add your Hanzo API key
# Get your key at: https://hanzo.ai/dashboard
nano .env
# Start the platform
cp .env.example .env # set HANZO_API_KEY
make up
```
Access the chat at http://localhost:3081
Open http://localhost:3080. `make up` starts the full stack (app, MongoDB, Meilisearch) from `compose.yml`; `make down` stops it.
## Development
### Basic Development (with hot reload)
```bash
make dev
pnpm install # install workspace dependencies
pnpm build:packages # build the shared workspace packages
pnpm backend:dev # API server on :3080 (nodemon)
pnpm frontend:dev # Vite client dev server (second terminal)
@@ -49,7 +49,7 @@ Artifacts are for substantial, self-contained content that users might modify or
4. Add a \`type\` attribute to specify the type of content the artifact represents. Assign one of the following values to the \`type\` attribute:
- HTML: "text/html"
- The user interface can render single file HTML pages placed within the artifact tags. HTML, JS, and CSS should be in a single file when using the \`text/html\` type.
- Images from the web are not allowed, but you can use placeholder images by specifying the width and height like so \`<img src="/api/placeholder/400/320" alt="placeholder" />\`
- Images from the web are not allowed, but you can use placeholder images by specifying the width and height like so \`<img src="/v1/chat/placeholder/400/320" alt="placeholder" />\`
- The only place external scripts can be imported from is https://cdnjs.cloudflare.com
- Mermaid Diagrams: "application/vnd.mermaid"
- The user interface will render Mermaid diagrams placed within the artifact tags.
@@ -63,7 +63,7 @@ Artifacts are for substantial, self-contained content that users might modify or
- The assistant can use prebuilt components from the \`shadcn/ui\` library after it is imported: \`import { Alert, AlertDescription, AlertTitle, AlertDialog, AlertDialogAction } from '/components/ui/alert';\`. If using components from the shadcn/ui library, the assistant mentions this to the user and offers to help them install the components if necessary.
- Components MUST be imported from \`/components/ui/name\` and NOT from \`/components/name\` or \`@/components/ui/name\`.
- NO OTHER LIBRARIES (e.g. zod, hookform) ARE INSTALLED OR ABLE TO BE IMPORTED.
- Images from the web are not allowed, but you can use placeholder images by specifying the width and height like so \`<img src="/api/placeholder/400/320" alt="placeholder" />\`
- Images from the web are not allowed, but you can use placeholder images by specifying the width and height like so \`<img src="/v1/chat/placeholder/400/320" alt="placeholder" />\`
- If you are unable to follow the above requirements for any reason, don't use artifacts and use regular code blocks instead, which will not attempt to render the component.
5. Include the complete and updated content of the artifact, without any truncation or minimization. Don't use "// rest of the code remains the same...".
6. If unsure whether the content qualifies as an artifact, if an artifact should be updated, or which type to assign to an artifact, err on the side of not creating an artifact.
@@ -162,7 +162,7 @@ Artifacts are for substantial, self-contained content that users might modify or
4. Add a \`type\` attribute to specify the type of content the artifact represents. Assign one of the following values to the \`type\` attribute:
- HTML: "text/html"
- The user interface can render single file HTML pages placed within the artifact tags. HTML, JS, and CSS should be in a single file when using the \`text/html\` type.
- Images from the web are not allowed, but you can use placeholder images by specifying the width and height like so \`<img src="/api/placeholder/400/320" alt="placeholder" />\`
- Images from the web are not allowed, but you can use placeholder images by specifying the width and height like so \`<img src="/v1/chat/placeholder/400/320" alt="placeholder" />\`
- The only place external scripts can be imported from is https://cdnjs.cloudflare.com
- SVG: "image/svg+xml"
- The user interface will render the Scalable Vector Graphics (SVG) image within the artifact tags.
@@ -186,7 +186,7 @@ Artifacts are for substantial, self-contained content that users might modify or
- The assistant can use prebuilt components from the \`shadcn/ui\` library after it is imported: \`import { Alert, AlertDescription, AlertTitle, AlertDialog, AlertDialogAction } from '/components/ui/alert';\`. If using components from the shadcn/ui library, the assistant mentions this to the user and offers to help them install the components if necessary.
- Components MUST be imported from \`/components/ui/name\` and NOT from \`/components/name\` or \`@/components/ui/name\`.
- NO OTHER LIBRARIES (e.g. zod, hookform) ARE INSTALLED OR ABLE TO BE IMPORTED.
- Images from the web are not allowed, but you can use placeholder images by specifying the width and height like so \`<img src="/api/placeholder/400/320" alt="placeholder" />\`
- Images from the web are not allowed, but you can use placeholder images by specifying the width and height like so \`<img src="/v1/chat/placeholder/400/320" alt="placeholder" />\`
- When iterating on code, ensure that the code is complete and functional without any snippets, placeholders, or ellipses.
- If you are unable to follow the above requirements for any reason, don't use artifacts and use regular code blocks instead, which will not attempt to render the component.
5. Include the complete and updated content of the artifact, without any truncation or minimization. Don't use "// rest of the code remains the same...".
@@ -367,7 +367,7 @@ Artifacts are for substantial, self-contained content that users might modify or
4. Add a \`type\` attribute to specify the type of content the artifact represents. Assign one of the following values to the \`type\` attribute:
- HTML: "text/html"
- The user interface can render single file HTML pages placed within the artifact tags. HTML, JS, and CSS should be in a single file when using the \`text/html\` type.
- Images from the web are not allowed, but you can use placeholder images by specifying the width and height like so \`<img src="/api/placeholder/400/320" alt="placeholder" />\`
- Images from the web are not allowed, but you can use placeholder images by specifying the width and height like so \`<img src="/v1/chat/placeholder/400/320" alt="placeholder" />\`
- The only place external scripts can be imported from is https://cdnjs.cloudflare.com
- SVG: "image/svg+xml"
- The user interface will render the Scalable Vector Graphics (SVG) image within the artifact tags.
@@ -391,7 +391,7 @@ Artifacts are for substantial, self-contained content that users might modify or
- The assistant can use prebuilt components from the \`shadcn/ui\` library after it is imported: \`import { Alert, AlertDescription, AlertTitle, AlertDialog, AlertDialogAction } from '/components/ui/alert';\`. If using components from the shadcn/ui library, the assistant mentions this to the user and offers to help them install the components if necessary.
- Components MUST be imported from \`/components/ui/name\` and NOT from \`/components/name\` or \`@/components/ui/name\`.
- NO OTHER LIBRARIES (e.g. zod, hookform) ARE INSTALLED OR ABLE TO BE IMPORTED.
- Images from the web are not allowed, but you can use placeholder images by specifying the width and height like so \`<img src="/api/placeholder/400/320" alt="placeholder" />\`
- Images from the web are not allowed, but you can use placeholder images by specifying the width and height like so \`<img src="/v1/chat/placeholder/400/320" alt="placeholder" />\`
- When iterating on code, ensure that the code is complete and functional without any snippets, placeholders, or ellipses.
- If you are unable to follow the above requirements for any reason, don't use artifacts and use regular code blocks instead, which will not attempt to render the component.
5. Include the complete and updated content of the artifact, without any truncation or minimization. Don't use "// rest of the code remains the same...".
{"level":"error","message":"[mongoMeili] Error checking index convos: fetch failed","name":"MeiliSearchCommunicationError","stack":"MeiliSearchCommunicationError: fetch failed\n at node:internal/deps/undici/undici:13510:13\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)"}
{"level":"error","message":"[mongoMeili] Error checking index messages: fetch failed","name":"MeiliSearchCommunicationError","stack":"MeiliSearchCommunicationError: fetch failed\n at node:internal/deps/undici/undici:13510:13\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)"}
{"level":"error","message":"[mongoMeili] Error checking index convos: fetch failed","name":"MeiliSearchCommunicationError","stack":"MeiliSearchCommunicationError: fetch failed\n at node:internal/deps/undici/undici:13510:13\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)"}
{"level":"error","message":"[mongoMeili] Error checking index messages: fetch failed","name":"MeiliSearchCommunicationError","stack":"MeiliSearchCommunicationError: fetch failed\n at node:internal/deps/undici/undici:13510:13\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)"}
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.