Commit Graph

6463 Commits

Author SHA1 Message Date
Timothy Jaeryang Baek f730733bc4 refac 2026-07-14 00:30:47 -04:00
Timothy Jaeryang Baek 53ccd718a5 refac 2026-07-14 00:24:20 -04:00
Timothy Jaeryang Baek 797293c749 refac 2026-07-14 00:19:41 -04:00
Timothy Jaeryang Baek 7088d245bb refac 2026-07-14 00:10:28 -04:00
Timothy Jaeryang Baek 0c23466a3e refac 2026-07-13 23:46:28 -04:00
Timothy Jaeryang Baek 3005b7bc71 refac 2026-07-13 23:31:14 -04:00
Timothy Jaeryang Baek 23062e9fca refac 2026-07-13 23:31:01 -04:00
Timothy Jaeryang Baek 17e6496538 refac 2026-07-13 23:28:43 -04:00
Timothy Jaeryang Baek 959558fd82 refac 2026-07-13 23:27:54 -04:00
Timothy Jaeryang Baek 08dacd19da refac 2026-07-13 23:01:10 -04:00
Timothy Jaeryang Baek 51ff386fd6 refac 2026-07-13 23:00:54 -04:00
Timothy Jaeryang Baek e8b59b2ef3 refac 2026-07-13 22:50:24 -04:00
Timothy Jaeryang Baek 09d4cccb79 refac 2026-07-10 18:32:21 -05:00
Timothy Jaeryang Baek 9a772f42c8 refac 2026-07-10 16:41:35 -05:00
Classic298 f8c0d2fdd6 fix: don't mutate caller's payload when resolving a pipe base model (#26906)
generate_function_chat_completion rewrote form_data['model'] to the base
model id in place. Because that dict is the same object process_chat_response
later re-submits for the post-tool-call continuation, the continuation was
access-checked against the base model instead of the user-facing preset.
For a public preset over a private/unregistered pipe base, a non-admin's
first message succeeded but the continuation after a native tool call was
denied and silently swallowed, aborting the response (admins skip the
user-only check, so they were unaffected).

Operate on a shallow copy of form_data, mirroring the openai/ollama routers
which already substitute the base model on a copy. The continuation now
re-checks the preset the user actually has access to.


Claude-Session: https://claude.ai/code/session_018toPfJW1hMXAhokGaL43Ep

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-10 13:33:24 -05:00
Classic298 f4a6ea9300 fix: Milvus multitenancy scalar index creation on Milvus Lite (#26911)
Enabling ENABLE_MILVUS_MULTITENANCY_MODE with the default MILVUS_URI (embedded Milvus Lite at DATA_DIR/vector_db/milvus.db) fails on the first embedding write: _create_shared_collection calls collection.create_index(RESOURCE_ID_FIELD) with no index params. A Milvus server auto-selects a scalar index type in that case, but Milvus Lite rejects the call with "create_index missing required 'index_type' parameter", so shared collection creation raises and every embedding write 500s (memory add, file upload, knowledge writes).

Keep the parameterless call as the first attempt so behavior on Milvus servers is unchanged, fall back to an explicit INVERTED scalar index, and if that also fails log a warning and continue. The scalar index only accelerates resource_id filters; inserts and filtered queries work without it, so a missing index must not break collection creation.

Verified against embedded Milvus Lite: shared collections now create (with the warning), and memory add, file upload and memory query succeed end to end. Against a Milvus server the first attempt is identical to the current code, so nothing changes where it works today.
2026-07-10 13:29:29 -05:00
Classic298 0f8846b7fc fix: convert SecurityHeadersMiddleware to pure ASGI (#26924)
SecurityHeadersMiddleware was the last middleware in the stack still
subclassing BaseHTTPMiddleware, after CommitSession, AuthToken,
WebsocketUpgradeGuard and Redirect were all moved to pure ASGI in
utils/asgi_middleware.py. BaseHTTPMiddleware re-buffers the response
body through an anyio task group, which has known issues with
streaming and Content-Length-bearing responses (e.g. the FileResponse
returned by /api/v1/audio/speech).

Reimplement it as a pure-ASGI middleware that stamps the configured
security headers onto the http.response.start message via
MutableHeaders and forwards all body chunks untouched, matching the
pattern already used by its four siblings. set_security_headers() and
all its helpers are unchanged.

Co-authored-by: classic298 <classic298@users.noreply.github.com>
2026-07-10 13:29:14 -05:00
Timothy Jaeryang Baek 5fe525b8e0 refac 2026-07-09 18:02:37 -05:00
Timothy Jaeryang Baek f5b196c060 refac 2026-07-09 17:59:17 -05:00
Timothy Jaeryang Baek d3ea8eb7e7 refac 2026-07-09 17:38:19 -05:00
Timothy Jaeryang Baek c89b6c50bc refac 2026-07-09 17:37:17 -05:00
Timothy Jaeryang Baek 0a8492b15d refac 2026-07-09 17:37:12 -05:00
Timothy Jaeryang Baek 9951fbe549 refac 2026-07-09 17:37:04 -05:00
Timothy Jaeryang Baek 5c389ad93f refac 2026-07-09 17:33:30 -05:00
Timothy Jaeryang Baek ef8630d556 refac 2026-07-09 17:31:43 -05:00
Timothy Jaeryang Baek 951f96021a refac 2026-07-09 17:29:51 -05:00
Timothy Jaeryang Baek 8e46450acd refac 2026-07-09 17:28:34 -05:00
Timothy Jaeryang Baek bd6e0b61c2 refac 2026-07-09 17:28:05 -05:00
Timothy Jaeryang Baek 44c2a27ce0 refac 2026-07-09 16:20:19 -05:00
Timothy Jaeryang Baek 90eca2ac25 refac 2026-07-01 03:37:35 -05:00
Timothy Jaeryang Baek 80af65c24a refac 2026-07-01 03:35:46 -05:00
Timothy Jaeryang Baek 7f182ea063 refac 2026-07-01 03:35:27 -05:00
Timothy Jaeryang Baek 54f31c630a refac 2026-07-01 03:32:12 -05:00
Timothy Jaeryang Baek 4351c78b1e refac 2026-07-01 03:22:13 -05:00
Timothy Jaeryang Baek fa2abe4cb6 refac 2026-07-01 03:17:06 -05:00
Timothy Jaeryang Baek 73c0be8389 refac 2026-07-01 03:01:46 -05:00
Timothy Jaeryang Baek 645cd9327c refac 2026-07-01 02:59:14 -05:00
Timothy Jaeryang Baek 9562f036f8 refac 2026-07-01 02:57:29 -05:00
Timothy Jaeryang Baek c416c6cad6 refac 2026-07-01 02:53:42 -05:00
Timothy Jaeryang Baek 0016266c06 refac 2026-07-01 02:49:33 -05:00
Timothy Jaeryang Baek 650b817925 refac 2026-07-01 02:49:28 -05:00
Timothy Jaeryang Baek 64b92ff08a refac 2026-07-01 02:48:29 -05:00
Timothy Jaeryang Baek 989c6c13f5 refac 2026-07-01 02:26:47 -05:00
Timothy Jaeryang Baek ab22fe64bd refac
Co-Authored-By: Syed Osama Ali Shah <86572800+osamaali313@users.noreply.github.com>
2026-07-01 02:20:50 -05:00
Timothy Jaeryang Baek 688bda09fb refac
Co-Authored-By: Syed Osama Ali Shah <86572800+osamaali313@users.noreply.github.com>
2026-07-01 02:20:16 -05:00
Timothy Jaeryang Baek 19d8f03bd2 refac 2026-07-01 02:15:16 -05:00
Timothy Jaeryang Baek 9866a02863 refac 2026-07-01 02:08:34 -05:00
Timothy Jaeryang Baek 0b75445ff9 refac 2026-06-30 20:20:10 -05:00
Timothy Jaeryang Baek 4067e357b2 refac 2026-06-29 21:31:49 -05:00
Timothy Jaeryang Baek 5134e5ecfc refac 2026-06-29 14:03:11 -05:00