Commit Graph
17215 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 009715cd63 refac 2026-07-14 00:22:00 -04:00
Timothy Jaeryang Baek 6a7068c3a4 refac 2026-07-14 00:21:47 -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 8f07c0c8ee refac 2026-07-13 23:34:54 -04:00
Timothy Jaeryang Baek d3fd860c13 refac 2026-07-13 23:32:07 -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 e1f96aa20e refac 2026-07-13 23:21:45 -04:00
Timothy Jaeryang Baek 2f37e853d1 refac 2026-07-13 23:19:58 -04:00
Timothy Jaeryang Baek e355959e91 refac 2026-07-13 23:16:22 -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 49d202a18e refac 2026-07-13 12:06:17 -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
A-PS1999andGitHub 8c71897bc0 Corrected a few Japanese translations, added several more which were previously blank (#26881) 2026-07-10 13:33:46 -05:00
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
Classic298andGitHub 274729aa47 fix: socket reconnect recovery never runs for chats started from the home page (#26913)
When a chat is started from the home page, the URL is switched to /c/{id} with
history.replaceState, so the Chat component is never remounted and chatIdProp
stays empty for the lifetime of that view. Both websocket recovery paths,
handleSocketConnect and the chat:active fallback, are gated on chatIdProp and
therefore never run for these chats. After any websocket drop during a response
(mobile backgrounding, VPN or IP change, wake from sleep) the completed response
is never fetched and the chat stays stuck in a loading state until a manual page
refresh. Chats opened directly via /c/{id} recover fine, which is why the bug
only reproduces reliably on freshly started chats.

Gate both recovery paths on the chatId store instead, which is set for every
persisted chat, and let loadChat fall back to it so the recovery reload also
works when chatIdProp is empty. Chats opened via /c/{id} behave exactly as
before and temporary chats stay excluded.

The same gate likely explains the remaining reports in #26315.

Fixes #26844
2026-07-10 13:30:55 -05:00
65a5fad7b9 fix: gate allow-same-origin on the terminal file-preview iframe to prevent same-origin XSS (#26907)
The system-terminal HTML file preview (FilePreview.svelte, serveUrl branch) rendered served HTML in an iframe that hardcoded allow-same-origin. The terminal proxy serves the file root-relative (same origin as the app) and injects no CSP, and there is no default global CSP, so script in a previewed HTML file executed in the application's own origin and could read localStorage (the session token), enabling account takeover and, for admin or workspace.functions victims, server-side RCE via Functions. The sibling srcdoc branch already gates allow-same-origin behind the iframeSandboxAllowSameOrigin setting (off by default) and injects a CSP; the serveUrl branch never received that defense. Gate allow-same-origin on the serveUrl branch identically, so by default the preview runs at an opaque origin and its scripts cannot reach the parent context. Legitimate HTML preview rendering is unaffected.

Co-authored-by: manus-use <manus-use@users.noreply.github.com>
2026-07-10 13:30:18 -05:00
Classic298andGitHub 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
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
Classic298andGitHub 42f5c3d6f7 Merge pull request #26914 from Classic298/srcdoc-embed-prompt-confirmation
fix: restore prompt confirmation for sandboxed tool result embeds
2026-07-10 13:28:39 -05:00
Timothy Jaeryang Baek b854389951 refac 2026-07-09 18:46:40 -05:00
Timothy Jaeryang Baek 6e030e892b refac 2026-07-09 18:28:38 -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 247b866330 refac 2026-07-09 17:44:40 -05:00
Timothy Jaeryang Baek 285379d489 refac 2026-07-09 17:43:13 -05:00
Timothy Jaeryang Baek 5ab012e7ae refac 2026-07-09 17:38:52 -05:00
Timothy Jaeryang Baek d3ea8eb7e7 refac 2026-07-09 17:38:19 -05:00
Timothy Jaeryang Baek 6be9d1e760 refac 2026-07-09 17:37:47 -05:00
Timothy Jaeryang Baek 5e1a337d6e refac 2026-07-09 17:37:43 -05:00
Timothy Jaeryang Baek 31996a5acf refac 2026-07-09 17:37:31 -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 975f7b868a refac 2026-07-09 17:32:45 -05:00
Timothy Jaeryang Baek ef8630d556 refac 2026-07-09 17:31:43 -05:00
Timothy Jaeryang Baek 252e6fd855 refac 2026-07-09 17:30:02 -05:00
Timothy Jaeryang Baek 951f96021a refac 2026-07-09 17:29:51 -05:00
Timothy Jaeryang Baek db802e28d3 refac 2026-07-09 17:29:07 -05:00
Timothy Jaeryang Baek a489e4f219 refac 2026-07-09 17:28:45 -05:00