Commit Graph

3768 Commits

Author SHA1 Message Date
Timothy Jaeryang Baek
bb3526f4e4 refac 2026-03-21 17:59:44 -05:00
Timothy Jaeryang Baek
9a2c60d595 refac 2026-03-21 17:12:33 -05:00
biebiep
f593f92f18 FIX: serper.dev API - Change snippet key from 'description' to 'snippet' (#22869)
This has apparently been broken since forever and native tool calling made it a lot more apparent.
2026-03-20 18:54:16 -05:00
Timothy Jaeryang Baek
ecba37070d refac 2026-03-20 17:05:47 -05:00
Timothy Jaeryang Baek
f23296b22d refac 2026-03-20 16:30:41 -05:00
Timothy Jaeryang Baek
adcc50d337 refac 2026-03-19 15:56:43 -05:00
Timothy Jaeryang Baek
b8ea267f8e refac 2026-03-17 18:01:18 -05:00
Timothy Jaeryang Baek
de3317e26b refac 2026-03-17 17:58:01 -05:00
Timothy Jaeryang Baek
fcf7208352 refac 2026-03-17 17:56:15 -05:00
Timothy Jaeryang Baek
b171b0216b refac 2026-03-17 17:54:59 -05:00
Timothy Jaeryang Baek
3107a5363d refac 2026-03-17 17:37:20 -05:00
Timothy Jaeryang Baek
c0385f60ba refac 2026-03-17 16:52:14 -05:00
Jacob Leksan
14d876c259 Added Readiness probe (#22507) 2026-03-15 18:17:57 -05:00
Timothy Jaeryang Baek
5787c969f6 refac 2026-03-15 18:03:50 -05:00
Ethan T.
a229f9ea42 fix: replace bare except with except Exception (#22473)
Replace bare except clauses with except Exception to follow Python best practices and avoid catching unexpected system exceptions like KeyboardInterrupt and SystemExit.
2026-03-15 17:48:23 -05:00
Timothy Jaeryang Baek
f9756de693 refac 2026-03-15 17:35:06 -05:00
Timothy Jaeryang Baek
bc5b3ec6b8 refac 2026-03-15 17:21:14 -05:00
Timothy Jaeryang Baek
566e25569e refac 2026-03-15 16:58:01 -05:00
Timothy Jaeryang Baek
f9d38a073f refac 2026-03-15 16:51:51 -05:00
Timothy Jaeryang Baek
6862d618ee refac 2026-03-13 20:57:12 -05:00
Timothy Jaeryang Baek
d85b52bfc2 refac 2026-03-12 20:37:41 -05:00
Timothy Jaeryang Baek
afa0609ece feat: support whitelist filtering in AuditLoggingMiddleware (#22515)
Add AUDIT_INCLUDED_PATHS env var for whitelist-based audit filtering.
When set, only matching paths are audited and AUDIT_EXCLUDED_PATHS is
ignored. Auth endpoints (signin/signout/signup) are always logged
regardless of filtering mode.
2026-03-11 15:41:42 -05:00
Steve-Li-1998
7ea1e9cbd0 fix: Prefer model-provided web search result count over admin default (#22577)
* Prefer model-provided web search result count over admin default

Update `search_web` to prioritize the model-provided `count` parameter before falling back to the admin-configured `WEB_SEARCH_RESULT_COUNT`, and finally defaulting to 5.

Changes:
- Set `count` default to `None` instead of `5`.
- Adjust fallback order to: model-provided `count` → admin-configured value → `5`.
- Update comment to reflect the new precedence logic.

This ensures explicit model requests for result count are respected while preserving sensible defaults.

* Enforce maximum web search result count from config

Update `search_web` to cap the model-provided `count` parameter at the admin-configured `WEB_SEARCH_RESULT_COUNT` to prevent excessive result requests.

Changes:
- Set default `count` parameter to `5`.
- Replace fallback logic with enforcement logic that limits `count` to the configured maximum.
- Update comment to reflect that the result count is now capped to prevent abuse.

This ensures web search requests cannot exceed the configured limit while maintaining a sensible default.
2026-03-11 15:34:24 -05:00
Timothy Jaeryang Baek
e34ed72e1e refac 2026-03-11 15:33:24 -05:00
Shamil
3a6b5ebb5f refac: modernize type hints and imports in access_control module (#22594) 2026-03-11 15:28:39 -05:00
Lorenzo Maffioli
035b981e11 feat(otel): introduce an environment variable to control the export interval of otel metrics (#22529) 2026-03-11 15:27:06 -05:00
Timothy Jaeryang Baek
8da29566a1 refac: safer tool server handling 2026-03-11 15:22:51 -05:00
Classic298
06657b8109 fix: handle non-dict history/messages in chat_message migration (#22588)
Some databases contain chat records where 'history' or 'messages' are
stored as lists instead of dicts. This causes an AttributeError
('list' object has no attribute 'items') during the
8452d01d26d7_add_chat_message_table migration.

Add isinstance checks to skip chat records with unexpected data shapes
gracefully, matching the existing pattern used for individual message
validation.
2026-03-11 14:24:21 -05:00
Timothy Jaeryang Baek
c6a1469fad refac 2026-03-08 19:05:15 -05:00
Timothy Jaeryang Baek
97cc94756e chore: bump 2026-03-08 19:00:50 -05:00
Timothy Jaeryang Baek
61366cbcda refac 2026-03-08 18:57:20 -05:00
Timothy Jaeryang Baek
c3e1d2d894 refac 2026-03-08 18:40:47 -05:00
Timothy Jaeryang Baek
0bfacca0a0 refac 2026-03-08 18:30:16 -05:00
Timothy Jaeryang Baek
1364df0913 refac 2026-03-08 18:26:36 -05:00
Timothy Jaeryang Baek
352391fa76 chore: format 2026-03-08 18:14:09 -05:00
Timothy Jaeryang Baek
2cb28369b7 refac 2026-03-08 18:08:12 -05:00
Timothy Jaeryang Baek
3f350f8659 refac 2026-03-08 17:52:49 -05:00
Timothy Jaeryang Baek
9d8f590fc5 feat: support pipe filters for per-message content truncation in task templates
Add |middletruncate:n, |start:n, and |end:n pipe filters to the
{{MESSAGES}} template variable, enabling per-message character
truncation for task models (title, tags, follow-up, etc.).

Example: {{MESSAGES:END:2|middletruncate:500}}

This optimizes task model prompt size for conversations with very
long messages (e.g. pasted documents), reducing latency for local
models and API costs.

Closes #21499
2026-03-08 17:43:23 -05:00
Timothy Jaeryang Baek
c97767424f refac/fix 2026-03-08 17:26:29 -05:00
Code with love
265d1b2824 Add support for mariadb-vector as backing vector DB (#21931) 2026-03-08 17:13:14 -05:00
Classic298
caf3362be8 fix: add missing group_id filter to analytics token usage query (#22167)
The get_token_usage_by_user query lacked group_id filtering, while the
companion get_message_count_by_user query already supported it. When an
admin filtered analytics by user group, message counts were correctly
scoped to the group but token usage totals included data from all users.

Add the group_id parameter and subquery filter to get_token_usage_by_user,
matching the pattern used by get_message_count_by_user and other analytics
queries, and pass group_id through from the analytics endpoint.
2026-03-08 17:11:12 -05:00
Alvin Tang
7aa7bbc390 fix: correct Azure TTS locale extraction for SSML xml:lang (#22443)
The locale for Azure TTS SSML was being extracted with `split("-")[:1]`,
which only takes the first segment (e.g., "en" from "en-US"). The
xml:lang attribute in SSML requires a full locale like "en-US", not just
a language code. This caused Azure TTS to either fail or use incorrect
pronunciation rules.

Changed `[:1]` to `[:2]` to properly extract the locale (e.g., "en-US").

Co-authored-by: gambletan <ethanchang32@gmail.com>
2026-03-08 16:50:25 -05:00
Ethan T.
a97f5adf95 fix: URL-encode OAuth error message in redirect URL (#22415)
- URL-encodes the OAuth error message when constructing the redirect URL in the OIDC callback handler
- Without encoding, error messages containing spaces, ampersands, or other special characters produce malformed URLs that the frontend cannot parse correctly
- The custom OAuth client callback handler already correctly uses urllib.parse.quote_plus() for the same purpose; this fix brings the OIDC handler in line with that pattern

Co-authored-by: gambletan <tan@gambletan.com>
2026-03-08 16:47:47 -05:00
Fu-Jie
138c4cbfcf fix: filter out internal tool methods starting with underscore (#22408) 2026-03-08 16:46:56 -05:00
Alvin Tang
3e513be963 fix: prevent TypeError in Teams webhook when user data is missing (#22444)
json.loads(event_data.get("user", {})) crashes with TypeError when
the "user" key is absent because the default value {} is a dict, not
a JSON string. json.loads expects str/bytes, not dict.

Also handle the case where "user" is already a dict (not serialized
JSON) to make the webhook more robust.

Co-authored-by: gambletan <ethanchang32@gmail.com>
2026-03-08 16:45:21 -05:00
Alvin Tang
f78b238b40 fix: prevent pipeline filter from corrupting payload on HTTP error (#22445)
In both inlet and outlet filter processing, response.json() was called
BEFORE response.raise_for_status(). When a filter endpoint returns an
HTTP error, the user's chat payload gets silently overwritten with the
error response body. If the error is not caught, the corrupted payload
propagates through subsequent filters and into the chat completion.

Swapped the order so raise_for_status() runs first — payload is only
updated on success.

Co-authored-by: gambletan <ethanchang32@gmail.com>
2026-03-08 16:44:35 -05:00
Timothy Jaeryang Baek
710320601a refac 2026-03-08 16:41:21 -05:00
Timothy Jaeryang Baek
67e26fd3af refac 2026-03-08 16:40:20 -05:00
Alvin Tang
2c35bdbcf5 fix: replace bare string raises with proper exception types (#22446)
`raise "string"` in Python raises TypeError instead of the intended
error, making error messages confusing and debugging difficult.

Co-authored-by: gambletan <ethanchang32@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 16:39:09 -05:00
Ethan T.
61bbb99d9e fix: replace bare except with Exception in oauth.py (#22420)
* fix: replace bare except with except Exception in main.py

* fix: replace bare except with Exception in oauth.py

In Python 3, bare 'except:' is discouraged as it catches all
SystemExit and KeyboardInterrupt exceptions. Changed to 'except Exception:'
to only catch actual exceptions.
2026-03-08 16:36:53 -05:00