Commit graph

5529 commits

Author SHA1 Message Date
Timothy Jaeryang Baek
0c2e4270bc chore: format 2026-03-01 14:10:45 -06:00
Timothy Jaeryang Baek
80ad5fd2d0 refac 2026-03-01 14:06:26 -06:00
Classic298
2054ee0b73
fix: enforce ownership check on user-memory collection queries (#22109)
* fix: enforce ownership check on user-memory collection queries

fix: enforce ownership check on user-memory collection queries

Prevent authenticated users from querying other users' memory
collections via the /query/doc and /query/collection endpoints.
A new _validate_collection_access helper rejects requests for
user-memory-{UUID} collections where the UUID does not match
the requesting user. Admins bypass the check.

* Update retrieval.py

* Update retrieval.py
2026-03-01 15:03:37 -05:00
Timothy Jaeryang Baek
93bab8d822 refac 2026-03-01 13:54:44 -06:00
Timothy Jaeryang Baek
259d5ca596 refac 2026-03-01 13:49:36 -06:00
Classic298
387225eb8b
fix: suppress internal path leakage in audio transcription errors (GHSA-vvxm-vxmr-624h) (#22108)
- Use os.path.basename() for filename sanitization instead of fragile blocklist

- Replace ERROR_MESSAGES.DEFAULT(e) with generic error message in both except blocks to prevent CWE-209 information disclosure

- Server-side logging via log.exception(e) is preserved for debugging
2026-03-01 14:44:49 -05:00
Timothy Jaeryang Baek
c83a42198d refac 2026-03-01 13:37:31 -06:00
Timothy Jaeryang Baek
2cacc2e649 chore: format 2026-03-01 13:34:09 -06:00
Timothy Jaeryang Baek
c9a78e5476 refac 2026-03-01 13:30:36 -06:00
Timothy Jaeryang Baek
2cbba2a28a chore: format 2026-03-01 13:29:06 -06:00
Timothy Jaeryang Baek
62ab30f593 refac 2026-03-01 13:28:32 -06:00
Timothy Jaeryang Baek
0fff2fbcab refac 2026-03-01 13:23:39 -06:00
Timothy Jaeryang Baek
fcff9c3afd refac 2026-03-01 13:20:55 -06:00
Classic298
0b851cf55a
fix: offline model retrieval, re-raise to disable instead of returning useless fallback (#22106)
Co-authored-by: ahxxm <1286225+ahxxm@users.noreply.github.com>
2026-03-01 13:52:31 -05:00
Timothy Jaeryang Baek
ff86283be0 refac
Co-Authored-By: Algorithm5838 <108630393+Algorithm5838@users.noreply.github.com>
2026-03-01 12:50:24 -06:00
Classic298
c436e0366c
perf: async DB calls, skip intermediate status writes, elif chain in event emitter (#22107)
Three improvements to the socket event emitter hot path (when realtime chat save is enabled):

1. Wrap all synchronous Chats.* DB calls in asyncio.to_thread() to avoid blocking the event loop during streaming. With N concurrent users, sync DB calls serialize all writes and block socket event delivery.

2. Only persist final (done=True) status events to DB. Intermediate statuses (tool calling progress, web search progress, etc.) are ephemeral UI-only data already delivered via socket — writing every one to DB is unnecessary I/O.

3. Convert if/if/if chain to if/elif since event types are mutually exclusive, avoiding unnecessary string comparisons after a match.
2026-03-01 13:43:03 -05:00
Timothy Jaeryang Baek
ddedceb7ad refac 2026-03-01 12:32:44 -06:00
Timothy Jaeryang Baek
18865a9fef refac 2026-03-01 12:30:03 -06:00
Timothy Jaeryang Baek
1357dc6737 chore: format 2026-02-28 21:28:59 -06:00
Timothy Jaeryang Baek
668bd44485 refac 2026-02-28 20:22:24 -06:00
Timothy Jaeryang Baek
499ca282e5 refac
Co-Authored-By: Nil Puig <244631886+npuigm@users.noreply.github.com>
2026-02-28 17:08:41 -06:00
Timothy Jaeryang Baek
9440d09114 refac 2026-02-28 13:07:10 -06:00
Timothy Jaeryang Baek
cfa16e1a37 refac 2026-02-27 16:37:33 -06:00
Timothy Jaeryang Baek
0324a1bbdd refac 2026-02-27 16:03:43 -06:00
Timothy Jaeryang Baek
a677b212d9 refac 2026-02-27 16:03:12 -06:00
Timothy Jaeryang Baek
179a4ad9ea refac 2026-02-27 16:01:57 -06:00
Timothy Jaeryang Baek
965f242d16 refac 2026-02-27 15:53:03 -06:00
Timothy Jaeryang Baek
758d8fcf31 refac 2026-02-27 15:51:15 -06:00
Timothy Jaeryang Baek
0f8b339f6d refac 2026-02-27 15:48:55 -06:00
Timothy Jaeryang Baek
4737e1f118 feat: open terminal integration 2026-02-27 13:08:59 -06:00
Stefan Weil
d7d05a4717
fix(ui): fix some broken links (#21904)
The referenced information was moved to a new location.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2026-02-26 14:27:57 -06:00
Timothy Jaeryang Baek
345f3e3559 refac 2026-02-25 15:15:59 -06:00
Timothy Jaeryang Baek
87d33f6e18 refac 2026-02-25 14:52:41 -06:00
Algorithm5838
b2413f914a
perf: early-return in get_tools() for empty tool_ids (#21873)
Avoids a needless Groups.get_groups_by_member_id() query when
no tools are attached to the request.
2026-02-25 13:13:18 -06:00
Timothy Jaeryang Baek
5ee5093259 refac
Co-Authored-By: Johannes Fahrenkrug <16358+jfahrenkrug@users.noreply.github.com>
2026-02-24 17:23:36 -06:00
Timothy Jaeryang Baek
81781e6495 refac 2026-02-24 17:14:07 -06:00
Classic298
82959cec88
Update oauth_sessions.py (#21794) 2026-02-24 17:05:47 -06:00
Timothy Jaeryang Baek
9478c5e7ac refac 2026-02-24 17:04:07 -06:00
Classic298
5c403fb829
fix: resolve valve priority for actions and filters via class instantiation (#21841)
fix: resolve valve priority for actions and filters via class instantiation

The priority sorting for action buttons and filter execution order
read valve data directly from the database JSON column using
Functions.get_function_valves_by_id(). This returns only explicitly
saved values — when a developer defines priority as a class default
in their Valves definition (e.g. priority: int = 5) without ever
opening the Valves UI to persist it, the database column remains
empty. Every function then resolves to priority 0, and the preceding
set() deduplication produces non-deterministic iteration order that
the stable sort preserves — resulting in random button placement on
every page load.

The fix instantiates the Valves class with database values as keyword
overrides: Valves(**(db_valves or {})). This merges any persisted
overrides onto the code-defined defaults, matching the pattern already
established in the action execution handler, filter processing
pipeline, and tool module initialization. A secondary sort key (the
function ID) ensures fully deterministic ordering even when multiple
functions share the same priority value.

Affected locations:
- get_action_priority in utils/models.py (action button ordering)
- get_priority in utils/filter.py (filter execution ordering)
2026-02-24 15:58:23 -06:00
Timothy Jaeryang Baek
538501c88d refac 2026-02-24 15:19:49 -06:00
Timothy Jaeryang Baek
64ec73635b refac 2026-02-24 14:47:28 -06:00
Timothy Jaeryang Baek
e6fe3ba8ef refac 2026-02-23 18:23:47 -06:00
Timothy Jaeryang Baek
0b867590a8 refac 2026-02-23 18:23:34 -06:00
Timothy Jaeryang Baek
3c8d658160 fix: tools_dict issue 2026-02-23 16:25:38 -06:00
Timothy Jaeryang Baek
176f9a7816 refac 2026-02-23 16:01:03 -06:00
Timothy Jaeryang Baek
3d99de6771 enh: access grant level perms 2026-02-23 15:49:05 -06:00
Classic298
1808d7fd2f
feat: sort action buttons by valve priority (#21790)
feat: sort action buttons by valve priority

Action buttons under assistant messages were rendered in
non-deterministic order due to set() deduplication. They now
respect the priority field from function Valves, sorted ascending
(lower value = appears first, default 0), matching the existing
filter priority mechanism.
2026-02-23 13:52:12 -06:00
Timothy Jaeryang Baek
f4a1d99f00 refac 2026-02-23 12:52:46 -06:00
Timothy Jaeryang Baek
8f49725aa5 refac 2026-02-23 12:17:36 -06:00
Jannik S.
140ab270af
fix: correct ENABLE_AUDIT_STDOUT stdout filter (#21777) 2026-02-23 11:52:29 -06:00