Commit Graph

909 Commits

Author SHA1 Message Date
Timothy Carambat
6b2ed8ec12
Remove WelcomeMessages from app - no longer used (#5206)
* remove `WelcomeMessages` from app - no longer user

* update erronous alert message

* fix job collision ref

* fix jobs - remove dev job
2026-03-13 12:55:59 -07:00
Timothy Carambat
6a492f038d Fix potential Zip Slip path traversal in community plugin import
Validate all ZIP entries before extraction in importCommunityItemFromUrl()
to prevent path traversal attacks (CWE-22). Malicious ZIP entries with
paths like "../../" could write files outside the intended plugin folder.

Requires admin privileges and explicit opt-in to unverified hub downloads.
GHSA-rh66-4w74-cf4m
2026-03-13 10:18:20 -07:00
Timothy Carambat
a207449095 Enforce user suspension check on browser extension API key path
Previously, suspended users could continue using browser extension
endpoints if they had created an API key before suspension. The normal
JWT session path blocked suspended users, but the browser extension
middleware did not.

Changes:
- Add suspension and user existence checks to validBrowserExtensionApiKey
- Delete browser extension API keys when a user is deleted
- Add deleteAllForUser method to BrowserExtensionApiKey model
GHSA-7754-8jcc-2rg3
2026-03-13 10:05:05 -07:00
Timothy Carambat
732eac6fa8 Align Manager API access with frontend access
GHSA-wfq3-65gm-3g2p
2026-03-13 09:46:37 -07:00
Timothy Carambat
334ce052f0 Fix SQL injection in SQL Agent plugin via parameterized queries
Replace string concatenation with parameterized queries in all database
connectors to prevent SQL injection through LLM-generated table names.

Changes:
- PostgreSQL: Use $1, $2 placeholders with pg client parameterization
- MySQL: Use ? placeholders with mysql2 execute() prepared statements
- MSSQL: Use @p0 placeholders with request.input() parameterization
- Update handlers to support parameterized query objects
- Add formatQueryForDisplay() for logging parameterized queries

Security: Mitigates potential SQL injection when LLM passes unsanitized
user input as table_name parameter to getTableSchemaSql/getTablesSql.
GHSA-jwjx-mw2p-5wc7
2026-03-12 21:56:57 -07:00
Timothy Carambat
c76576a9da
Report citations for Agent call stacks (#5199) 2026-03-12 14:49:44 -07:00
Timothy Carambat
15a84d5121
Support Agent stream metric reporting (#5197) 2026-03-12 12:50:02 -07:00
Timothy Carambat
6713c80f31 fix schema not persisting in DB connector 2026-03-11 11:43:38 -07:00
Timothy Carambat
21ac874cfa
Implement v2 chat layout designs (#5074)
* New chat history layout with chat bubbles (#4985)

* new chat history layout, remove message alignment setting

* remove orphaned chat alignment hook and MessageDirection

* remove workspace profile picture setting and fetch

* clean up unnecessary changes

* add light mode colors to chat ui and main page backgrounds

* update chat message and action icon colors for light mode

* update thinking and agent ui, layout, sizing

* update user message uploaded images ui

* update thought, agent containers to use new colors

* add truncatable content with gradient to user chat messages

* fix citations margin

* implement new edit message UI with save and submit actions

* add translations for TruncatableContent subcomponent

* remove unused props

* fix text colors for default mode chats, agent, thoughts container

* Normalize translations for new chat history layout (#5022)

* normalize translations

* update translations with DMR

* lint

* fix mismatched home container colors

* fix: add password character validation to onboarding single-user setup (#5037)

* fix single user mode password bug

* share const

---------

Co-authored-by: Timothy Carambat <rambat1010@gmail.com>

* Native Tool calling (#5071)

* checkpoint

* test MCP and flows

* add native tool call detection back to LMStudio

* add native tool call loops for Ollama

* Add ablity detection to DMR (regex parse)

* bedrock and generic openai with ENV flag

* deepseek native tool calling

* localAI native function

* groq support

* linting, add litellm and OR native tool calling via flag

* fix: resolve Gemini agent 400 error on tool call responses (#5054)

* add gtc__ prefix to tool call names in Gemini agent message formatting

* resolve Gemini agent 400 error on tool call responses

* add comments explaining geminis thought signatures

---------

Co-authored-by: Timothy Carambat <rambat1010@gmail.com>

* fix: prevent CMD/CTRL+Arrow scroll from overriding textarea cursor movement (#5053)

prevent CMD/CTRL+Arrow scroll from overriding textarea cursor movement

Co-authored-by: Timothy Carambat <rambat1010@gmail.com>

* linting, assistant speaker spacing and order, copy/edit order

---------

Co-authored-by: Marcello Fitton <106866560+angelplusultra@users.noreply.github.com>
Co-authored-by: Timothy Carambat <rambat1010@gmail.com>

* Implement new citations UI (#5038)

* new chat history layout, remove message alignment setting

* remove orphaned chat alignment hook and MessageDirection

* remove workspace profile picture setting and fetch

* clean up unnecessary changes

* add light mode colors to chat ui and main page backgrounds

* update chat message and action icon colors for light mode

* update thinking and agent ui, layout, sizing

* update user message uploaded images ui

* update thought, agent containers to use new colors

* add truncatable content with gradient to user chat messages

* fix citations margin

* implement new edit message UI with save and submit actions

* add translations for TruncatableContent subcomponent

* remove unused props

* fix text colors for default mode chats, agent, thoughts container

* Normalize translations for new chat history layout (#5022)

* normalize translations

* update translations with DMR

* lint

* fix mismatched home container colors

* implement new citations ui with sources sidebar

* bottom sheet for mobile citations

* convert mobile citations bottom sheet to new modal design

* add score, border separators for mobile citations modal

* push down sources sidebar in password/multiuser mode

* fix animation gap, simplify sources sidebar by splitting state to persist data on animation

* add english translations

* fix spacing from citations sidebar when user has auth

* Normalize translations for new citation UI (#5087)

* normalize translations

* update translations using DMR

* fix pluralize to use i18n native solution
change reset to immediate clear
fix spacing for TTS when showing or not to not have space

* proper pluralize

* hide metrics on mobile, fix last message padding on mobile

---------

Co-authored-by: Timothy Carambat <rambat1010@gmail.com>

* New prompt input ui/tools menu (#5070)

* wip new prompt input ui/tools menu

* fix colors for prompt input

* redesign workspace llm selector, extract text size + model picker to components

* refactor ToolsMenu component

* fix colors/refactor WorkspaceModelPicker

* fix spacing in ws model picker, change order of tools menu tabs

* fix slash commands showing /reset instead of /exit during active agent session

* refactor ToolsMenu to be much simpler

* cleanup, fix behavior of setupup provider in WorkspaceModelPicker

* simplify AgentSkillsTab toggle logic

* add english translations for new components

* remove legacy slash command/agent popups, add ToolsMenu keyboard nav

* fix spacing of workspace model picker text

* fix SourcesSidebar and TextSizeMenu positioning after merge

* fix keyboard nav in ToolsMenu when clicking on tools button to open

* typo

* only auto pop up tools menu when prompt input is empty with /

* fix z index for tools menu on citation

* fix behavior of / in prompt input

* move global window agent session state to module level variable

* fix prompt input not clearing on /reset

* missing translations

* revert translating slash command

* fix STT auto-submit not working on home page

* Normalize translations for new prompt input/tools menu UI (#5130)

* normalize translations

* update translations using DMR script

* normalize translations

* update translations using DMR script

* remove slash_exit

* fix skills.js import after merge

* fix tooltip z-index rendering behind citations

* patch translation prune script to not remove special cases

* updates to tools input

* factory translations

* use safeJsonParse in clearPromptInputDraft

* normalize translations

* disable agent skill toggles during active agent sessions + show tooltip on disabled

* normalize translations

* handle enter key behavior when tools menu is open

* fix unfocusable modal for slash command edit/new

* fix sending prompt when editing/creating slash commands

* hide/show agent skills in tools menu based on role

* container borders for dark/light mode compliance to designs

---------

Co-authored-by: Timothy Carambat <rambat1010@gmail.com>

* update how tooltip works for agent menu

* update prompt input to show agent button with CTA in agent panel for user clarify
update agent session start prompt button in input

* translations

* translations + move regex for slash commands to constants

* fix open sidebar ux

* fix tools menu to always open to slash commands, dismiss auto pop up

* fix sidebar open/close button overlapping with ws model picker

---------

Co-authored-by: Sean Hatfield <seanhatfield5@gmail.com>
Co-authored-by: Marcello Fitton <106866560+angelplusultra@users.noreply.github.com>
2026-03-10 12:50:19 -07:00
Timothy Carambat
868358597e Remove use_mlock from Ollama to solve WARN logs in ollama 0.17
resolves #5182
2026-03-10 09:08:05 -07:00
Marcello Fitton
456738bbda
chore: add ESLint CI workflow (#5160)
add lint CI GitHub Action
2026-03-09 14:27:08 -07:00
Timothy Carambat
4e3bcfc616
Add custom fetch to embedder for Ollama (#5180)
Refactor ollama timeout to be shared. Add custom fetch to embedder for ollama as well
2026-03-09 11:47:00 -07:00
Timothy Carambat
dc0bdf112b linting & show descriptive error for bad addtoWorkspace request body
resolves #5172
2026-03-09 11:30:53 -07:00
Ryan
179a823ab1
Fix: Azure OpenAI model key collision (#5092)
* fix: Migrate AzureOpenAI model key from OPEN_MODEL_PREF to prevent the naming collision. No effort necessary from current users.

* test: add backwards compat tests for AzureOpenAI model key migration

* patch missing env example file

* linting

---------

Co-authored-by: Timothy Carambat <rambat1010@gmail.com>
2026-03-05 17:12:08 -08:00
Marcello Fitton
4a4378ed99
chore: add ESLint to /server (#5126)
* add eslint config to server

* add break statements to switch case

* add support for browser globals and turn off empty catch blocks

* disable lines with useless try/catch wrappers

* format

* fix no-undef errors

* disbale lines violating no-unsafe-finally

* ignore syncStaticLists.mjs

* use proper null check for creatorId instead of unreachable nullish coalescing

* remove unneeded typescript eslint comment

* make no-unused-private-class-members a warning

* disable line for no-empty-objects

* add new lint script

* fix no-unused-vars violations

* make no-unsued-vars an error

---------

Co-authored-by: shatfield4 <seanhatfield5@gmail.com>
Co-authored-by: Timothy Carambat <rambat1010@gmail.com>
2026-03-05 16:32:45 -08:00
Timothy Carambat
1d8c488e97
Remove Google web-search Programmable SERP (#5156) 2026-03-05 14:49:32 -08:00
Timothy Carambat
ee4b208f95 native tool calling detection for novita 2026-03-05 10:19:03 -08:00
Timothy Carambat
b3944eb50e Revert "Add automatic chat mode with native tool calling support (#5140)"
- Need to support documents in agents
- Need to support images in agent mode

This reverts commit 4c69960dca.
2026-03-04 15:29:41 -08:00
Timothy Carambat
4c69960dca
Add automatic chat mode with native tool calling support (#5140)
Introduces a new automatic chat mode (now the default) that automatically invokes tools when the provider supports native tool calling. Conditionally shows/hides the @agent command based on whether native tooling is available.

    - Add supportsNativeToolCalling() to AI providers (OpenAI, Anthropic, Azure always support; others opt-in via ENV)
    - Update all locale translations with new mode descriptions
    - Enhance translator to preserve Trans component tags
    - Remove deprecated ability tags UI
2026-03-04 14:34:30 -08:00
Timothy Carambat
86431c6833
5112 or stream metrics and finish reason (#5117)
* update metric tracking for OR + fix finish_reason missing from transitive chunks

* linting + comments
closes #5113
resolves #5112
2026-03-02 18:53:29 -08:00
Timothy Carambat
e145c391e9
v1.11.1 Release tags (#5107)
bump tag
2026-03-02 09:25:06 -08:00
Timothy Carambat
1eae02e60f fix max tool call stack abort flow 2026-02-27 15:57:58 -08:00
Timothy Carambat
a6ba5a4034
Lemonade integration (#5077)
* lemonade integration

* lemonade embedder

* log

* load model

* readme updates

* update embedder privacy entry
2026-02-27 11:02:38 -08:00
Timothy Carambat
fc29461718 resolve Ollama string strict num_ctx
resolves #5081
2026-02-27 09:20:48 -08:00
Timothy Carambat
70ee112522 lint 2026-02-26 20:37:36 -08:00
Marcello Fitton
b13dd820cc
fix: resolve Gemini agent 400 error on tool call responses (#5054)
* add gtc__ prefix to tool call names in Gemini agent message formatting

* resolve Gemini agent 400 error on tool call responses

* add comments explaining geminis thought signatures

---------

Co-authored-by: Timothy Carambat <rambat1010@gmail.com>
2026-02-26 13:42:02 -08:00
Timothy Carambat
ac0b1d401d
Native Tool calling (#5071)
* checkpoint

* test MCP and flows

* add native tool call detection back to LMStudio

* add native tool call loops for Ollama

* Add ablity detection to DMR (regex parse)

* bedrock and generic openai with ENV flag

* deepseek native tool calling

* localAI native function

* groq support

* linting, add litellm and OR native tool calling via flag
2026-02-26 13:37:56 -08:00
Timothy Carambat
40853e4e43
1.11.0 release tag (#5014) 2026-02-18 08:47:47 -08:00
Timothy Carambat
d46c032787 Merge branch 'master' of github.com:Mintplex-Labs/anything-llm 2026-02-16 16:05:20 -08:00
Timothy Carambat
35af646a53 patch out no finish reason from https://github.com/microsoft/Foundry-Local/issues/423 2026-02-16 16:05:14 -08:00
Timothy Carambat
dba1be0600
add support for custom headers for LLM Generic OpenAI (#4999)
* add support for custom headers for LLM Generic OpenAI

* add env
2026-02-13 09:19:36 -08:00
Marcello Fitton
1ccf468158
fix: correct TPS calculation for Generic OpenAI provider with llama.cpp (#4981)
* add check for timings field on final chunk to override usage data

* refactor: extract llama.cpp timings into reusable private method

Move timings extraction into #extractTimings so it can be shared
by both streaming (handleStream) and non-streaming (getChatCompletion)
code paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* lint and cleanup

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Timothy Carambat <rambat1010@gmail.com>
2026-02-12 14:40:35 -08:00
Timothy Carambat
5fb1281891 patch out max_tokens from block output amount
resolves #3421
2026-02-12 14:20:08 -08:00
Timothy Carambat
cd6217fd6f normalize logo wordmark 2026-02-11 08:53:44 -08:00
Timothy Carambat
1c91d369c3
set embedder output dimensions for LocalAI and Gemini (gemini-embedding-001) (#4980) 2026-02-10 08:28:34 -08:00
Marcello Fitton
1f93753058
chore: bump ollama SDK from 0.5.10 to 0.6.3 (#4977)
upgrade ollama in server to latest (0.6.3)
2026-02-09 15:34:31 -08:00
Marcello Fitton
0da728fc50
refactor: Migrate system preferences to field-based endpoint and remove deprecated endpoint (#4958)
* Migrate all existing deprecated system preferences endpoint services to new service by field | delete old endpoint and service

* format

* destructure settings from response

* nitpick

---------

Co-authored-by: shatfield4 <seanhatfield5@gmail.com>
Co-authored-by: Timothy Carambat <rambat1010@gmail.com>
2026-02-09 12:48:48 -08:00
Timothy Carambat
bb77326659 linting + tolerate folder deletion for bad ParsedFile inserts 2026-02-08 14:35:50 -08:00
Timothy Carambat
152ac93e27 remove deprecated value for Google embedding 2026-02-08 14:05:34 -08:00
Timothy Carambat
fef5bf06ec
add provider field to chats (#4959) 2026-02-02 20:11:18 -08:00
Sean Hatfield
866e9efbf8
Fix agent workspace settings loading forever (#4956)
remove .brief from SystemSettings.agent_sql_connections
2026-02-02 12:26:53 -08:00
Timothy Carambat
2c513ae396
Web push notifications (#4942)
* WIP push notifications

* testing push

* cleanup for web-push bootstrapping
2026-02-02 10:56:58 -08:00
Timothy Carambat
97b140b4b4
Update LMStudio LLM & Embedder for API token (#4948)
- Updates Option panels to be consistent for other providers
adds API key to all LMStudio API calls
2026-01-30 11:13:32 -08:00
Timothy Carambat
0032c4da22
SambaNova Integration (#4943)
* SambaNova Integration

* lint
2026-01-29 18:48:22 -08:00
Marcello Fitton
3dae8db7ae
feat: Add ability to edit existing SQL agent connections (#4848)
* Add the ability to edit existing SQL connections

* Enhance SQL connection management by adding connections prop to DBConnection and SQLConnectionModal components for improved duplicate detection and handling.

* format

* fix: prevent input defocus in SQL connection edit modal

Fixed an issue where typing in input fields would cause the field to lose
focus during editing. The useEffect dependency array was using the entire
existingConnection object, which could change reference on parent re-renders,
triggering unnecessary re-fetches and unmounting form inputs.

Changed the dependency to use the primitive database_id value instead of the
object reference, ensuring the effect only runs when the actual connection
being edited changes.

* fix: prevent duplicate SQL connections from being created

Fixed an issue where saving SQL connections multiple times would create
duplicate entries with auto-generated hash suffixes (e.g., my-db-abc7).
This occurred because the frontend maintained stale action properties on
connections after saves, causing the backend to treat already-saved
connections as new additions.

Backend changes (server/models/systemSettings.js):
- Modified mergeConnections to skip action:add items that already exist
- Reject duplicate updates instead of auto-renaming with UUID suffixes
- Check if original connection exists before applying updates

Frontend changes:
- Added hasChanges prop to SQL connector component
- Automatically refresh connections from backend after successful save
- Ensures local state has clean data without stale action properties

This prevents the creation of confusing duplicate entries and ensures
only the connections the user explicitly created are stored.

* Refactor to use existing system settings endpoint for getting agent SQL connections | Add better documentation

* Simplify handleUpdateConnection handler

* refactor mergeConnections to use map

* remove console log

* fix bug where edit SQL connection modal values werent recomputed after re-opening

* Add loading state for fetching agent SQL connections

* tooltip

* remove unused import

* Put skip conditions in switch statement

* throw error if default switch case is triggered

---------

Co-authored-by: shatfield4 <seanhatfield5@gmail.com>
Co-authored-by: Timothy Carambat <rambat1010@gmail.com>
2026-01-29 16:37:46 -08:00
Timothy Carambat
b8dd7bc97e
Support PrivateModeAI Integration (#4937)
* Support PrivateModeAI Integration

* tooltip for proxy
2026-01-29 12:01:11 -08:00
Neha Prasad
3fc2432684
fix: prevent Citations UI glitching during streaming chats (#4897)
* fix: prevent Citations UI glitching during streaming chats

* replaced random keys with stable keys

* simplify citation glitch fix

* Remove unneeded memo()

* Simplify key logic

* Replace Boolean(source) with !!source

* change cohere to behave with citations like other models

---------

Co-authored-by: shatfield4 <seanhatfield5@gmail.com>
Co-authored-by: Timothy Carambat <rambat1010@gmail.com>
Co-authored-by: Marcello Fitton <macfittondev@gmail.com>
2026-01-29 10:44:34 -08:00
Marcello Fitton
b96f38486d
Fix: Clean username already exists error (#4914)
* Add Prisma unique constraint error messaging.

* Create `_identifyErrorAndFormatMessage` private method for identifying the error type and returning the approprioate error message string
2026-01-29 09:51:03 -08:00
Timothy Carambat
54e0cde56f
Manage Onboarding decision via DB flag (#4926)
* WIP add onboarding flag to db

* dev build

* fix onboarding telem call
2026-01-28 16:32:26 -08:00
Timothy Carambat
9584ebcd2c
Patch AzureOpenAI tool calling from function to tool (#4922) 2026-01-28 13:21:27 -08:00