| Files | Last commit | Last update |
|---|---|---|
feat(plugin): add interactive plugin message views (#11179) * feat(chatui): add plugin views and shared view bridge * fix(chatui): return fixed public messages for view errors * feat(chatui): add tabbed workbench and resident plugin views * fix(chatui): persist session workbenches in unified preferences * fix: refresh workbench API docs and preserve Gemini user agent * refactor: gate UI views on platform interaction capability * docs: organize plugin views guides and document bridge types * refactor: separate tabbed workbench from message views | 12 days ago | |
refactor: run built-in agents through runtime sessions (#11052) | 21 days ago | |
refactor: run built-in agents through runtime sessions (#11052) | 21 days ago | |
style: add ruff lint module of isort and pyupgrade, and some ruff check fix (#3214) Co-authored-by: Dt8333 <25431943+Dt8333@users.noreply.github.com> Co-authored-by: Soulter <905617992@qq.com> | 1 year ago | |
refactor: run built-in agents through runtime sessions (#11052) | 21 days ago | |
refactor: run built-in agents through runtime sessions (#11052) | 21 days ago | |
feat: expose prepared agent outputs and honor delivery policy (#11153) * feat: expose prepared agent outputs and honor delivery policy * fix: honor turn delivery policy in built-in media tools * test: keep agent output regression coverage minimal * docs: trim agent delivery policy explanation * docs: simplify agent output usage guide | 15 days ago | |
feat(plugin): add interactive plugin message views (#11179) * feat(chatui): add plugin views and shared view bridge * fix(chatui): return fixed public messages for view errors * feat(chatui): add tabbed workbench and resident plugin views * fix(chatui): persist session workbenches in unified preferences * fix: refresh workbench API docs and preserve Gemini user agent * refactor: gate UI views on platform interaction capability * docs: organize plugin views guides and document bridge types * refactor: separate tabbed workbench from message views | 12 days ago | |
refactor: decouple interactive message views from WebChat (#11380) * refactor(chatui): store interactive views in the main database * refactor(chatui): initialize tables directly in the main database * refactor(chatui): use platform-neutral table names for interactive views * refactor(interactive-ui): decouple view messages from WebChat * fix(interactive-ui): preserve card sources and include them in backups * refactor(interactive-ui)!: remove the old ChatUI import path | 4 days ago | |
style: format codes | 1 year ago | |
fix(dashboard): bound upload memory and add resumable chunked uploads (#10123) * refactor(dashboard): consolidate upload saves into streaming helper Five copies of the same upload-save logic existed: three file wrappers (UploadFileAdapter, RequestUploadFile, PluginUploadFile) plus one _save_upload() in each of BackupService and SkillsService. The backup variant fell back to a full-body read() for raw FastAPI UploadFile, buffering entire uploads in memory. Introduce save_upload_stream() as the single streaming implementation (1 MiB blocks, optional max_bytes with in-loop abort and partial-file cleanup). The wrappers keep their public signatures and delegate to it; skills/chat/config save paths call save() directly with max_bytes, replacing their post-save size checks. * fix(dashboard): bound backup upload size and harden chunked flow Backup routes passed raw FastAPI UploadFile into the service layer, hitting the full-body read() fallback: a single authenticated request with an oversized chunk or whole-file upload could OOM-kill the process (verified with a 512 MiB memory-limited container, exit 137). - Wrap uploads in UploadFileAdapter so all saves stream to disk - Enforce CHUNK_SIZE (1 MiB) per chunk and 128 MiB for whole-file uploads, aborting mid-stream with partial-file cleanup - Cap chunked backup totals at 8 GiB and point larger backups at manual restore via the data directory - Verify the merged backup size against the declared total * fix(dashboard): enforce MAX_CONTENT_LENGTH with per-route overrides The 128 MiB MAX_CONTENT_LENGTH value was written into the compat-layer config dict but nothing read it, so the FastAPI/hypercorn path had no request body limit at all. Add a middleware that rejects oversized bodies with 413 before auth or body parsing, using MAX_CONTENT_LENGTH as the default with per-route overrides for legitimate large uploads (attachments 512 MiB, plugin config files 500 MiB, knowledge bases 512 MiB) and a tight 2 MiB cap on the backup chunk endpoint. Requests without a Content-Length header pass through and remain bounded by per-endpoint max_bytes at save time. * refactor(dashboard): extract generic chunked upload session service Pull the chunk session machinery out of BackupService into a reusable ChunkedUploadService owning session lifecycle, chunk storage, streaming assembly and expiry cleanup, in preparation for webchat attachment chunked uploads. Sessions are now bound to an owner (the authenticated username) and a purpose; chunk/complete/abort calls from another owner fail with the same "not found or expired" error as unknown sessions, so upload IDs cannot be probed or consumed cross-user. BackupService keeps business concerns (zip validation, size caps, manifest marking) and delegates the rest; API shapes and frontend flows are unchanged. * feat(dashboard): add resumable upload status endpoint Expose per-session progress (received chunk indexes, totals, expiry) so clients can resume an interrupted chunked upload by sending only the missing chunks instead of starting over. Abuse considerations baked in: the lookup inherits owner binding and answers "not found or expired" for both unknown sessions and sessions owned by someone else (no probing), the response carries no filename (minimal disclosure), and the query is strictly read-only — it never touches last_activity, so polling it cannot anchor a session and its on-disk chunks alive past expiry. * fix(dashboard): bound file signature memory with chunked hashing getFileSignature() read the entire file into browser memory via arrayBuffer() before computing SHA-256, spiking renderer memory by the full attachment size (up to the 512 MiB upload cap). The signature is only used for in-session staging dedup and never leaves the browser, so it does not need to be the canonical whole-file SHA-256. Hash 8 MiB blocks individually and digest the concatenated block digests instead; the prefix changes to sha256m: to mark the algorithm change (old signatures vanish with the page session, so no compatibility concern). * feat(dashboard): resumable chunked upload UI for backup import Extract the chunk scheduling logic from BackupDialog into a reusable useChunkedUpload composable (5-way concurrency, per-chunk silent retries, progress accounting) and add resume support on top of the new upload status endpoint: a failed upload now offers a "Resume Upload" action that queries received chunk indexes and sends only the missing ones. Expired sessions transparently re-initialize and start over; a failed complete() drops the poisoned session by design. Wires the new /backups/upload/status endpoint through the OpenAPI spec and regenerated client, and adds the resumeUpload label to all four locales. * feat(dashboard): chunked upload endpoints for webchat attachments Mirror the backup chunked-upload flow for chat attachments so large files (>128 MiB request-body default, up to the 512 MiB attachment cap) can be uploaded in slices: POST /api/v1/files/upload/{init, chunk,complete,abort,status}, owner-bound sessions, and a per-route body limit on the chunk endpoint. ChatService reuses the generic ChunkedUploadService with a new meta passthrough carrying the client content_type through the session; completion merges outside the chunk dir and feeds the result through save_uploaded_file() unchanged via a move-based LocalUploadFile adapter, keeping MIME sniffing, type classification and attachment insertion in exactly one place. Also repairs two pre-existing test stubs that predated the max_bytes-aware save() contract and were already failing on this branch. * feat(dashboard): chunked upload with resume for webchat attachments Route staged files >= 32 MiB through the new chunked upload endpoints via useChunkedUpload; smaller files keep the single POST path so paste and quick picks stay low-latency. The content_type travels through the init payload so server-side attachment classification is unchanged. A failed chunked upload is kept as an error chip in the input area with a retry action that resumes from the last received chunk (and transparently restarts when the session expired) plus a discard action that aborts the session. Failed entries hold their uploader in a shallowRef so Vue's deep ref unwrapping cannot strip the composable's internal refs, and their signatures stay reserved to block duplicate staging while a failed entry exists. * docs: regenerate openapi artifacts for file upload endpoints * fix(dashboard): harden chunk save and request body limits Address review findings on the upload-hardening branch: - save_chunk() now writes to a uniquely named temp file, verifies the save() byte count against the expected chunk length, and publishes via atomic rename. A failed or concurrent same-index retry can no longer truncate and delete an already-received chunk (previously left received_chunks claiming data that assemble() then failed to find), and short writes are rejected instead of published. - Requests with multipart bodies but no Content-Length are rejected with 411: form parsing spools large bodies to disk before any per-file size check can run. This is a documented stopgap — other lengthless bodies still pass and are bounded only at save time; closing that fully requires counting bytes as they arrive. - Whole-file upload overrides gain 1 MiB of multipart framing slack so a file exactly at the size cap is no longer rejected with 413. The body-limit decision is extracted into a pure function for direct unit tests; the assemble-time size recheck is now covered by an out-of-band corruption test since chunk-level verification rejects short writes earlier. * fix(dashboard): drain upload pool and pin session on resume A failed chunk made runPool() reject immediately while the remaining in-flight requests kept writing; a resume could then race them on the same chunk, stale retries read the mutable uploadId (potentially writing into a re-initialized session), and late completions kept counting progress (150% after resume). The pool now stops scheduling on first failure but drains issued requests via allSettled before surfacing the error, each request pins the uploadId captured at run start, and a run-generation counter (bumped on start/resume/cancel) blocks stale completions from the progress accounting. * fix(dashboard): close 411 bypass and temp-file residue on publish Address the second round of review findings: - The 411 media-type check used a raw startswith(), but the form parser strips surrounding whitespace, so a leading-space Content-Type was let through without a Content-Length while Starlette still parsed the body as multipart. Detection now uses the same parse_options_header the parser uses. - A failing os.replace() during chunk publish left the uniquely named temp file behind; it is now covered by the same cleanup discipline as the save path. Backup direct-upload routes deliberately get no framing slack: they are legacy paths with no remaining callers, and the pre-existing exact-limit 413 edge is answered by chunked upload. * fix(dashboard): abort sessions created after a cancel Cancelling while initUpload was still in flight cleared local state before an upload id existed; when the delayed init returned, the run flipped from idle to error and the freshly created server session was never aborted. handleFailure now lets cancel win over any late resolution and aborts the session id captured at that point. * fix(dashboard): check cancel flag after completeUpload resolves Cancelling while completeUpload was in flight let the late success response flip the uploader from idle to done and hand the result to the caller, which proceeded to the precheck. completeSession() now re-checks the cancel flag after the response arrives and routes the late success through the cancelled path instead. * fix(dashboard): gate the 411 rule to body-capable methods The 411 stopgap rejected GET /api/v1/logs/live: the SSE log client sends a bogus "Content-Type: multipart/form-data" header on a GET (copy-paste relic), and a GET with no Content-Length matched the multipart-without-length rule. Body-less methods never trigger form parsing, so no disk-spool risk exists for them — the 411 now applies only to POST/PUT/PATCH. The junk header on the SSE client is removed as well; the other two SSE consumers never had it. * feat(dashboard): show in-progress chips for chunked attachments Chunked uploads gave no feedback while in flight: the staged chip only appeared after completion, leaving multi-minute uploads silent. Track in-flight uploads alongside the failed ones and render progress chips (filename, percent, thin progress bar) with a cancel action in the input area; on success the chip hands off to the staged attachment, on failure to the resumable error chip. * fix(dashboard): type active upload chips upfront and align progress bar The in-progress chip used a generic cloud icon even though the file type is known locally before the upload starts; it now derives icon/color/label from the filename via attachmentPresentation, same as the staged chip. The progress bar's left edge is aligned with the filename text instead of the card padding. * fix(dashboard): keep active-chip progress bar inside the card v-progress-linear ships width:100%, which wins over the right offset in absolute positioning; the bar ran 52px past the card's right edge and was clipped by overflow:hidden. Give it width:auto so the left/ right offsets determine the width. * fix(dashboard): rework active-chip progress track and cancel button Positioning a Vuetify component root directly proved fragile — the progress bar drifted to the card's top edge. Wrap it in a plain track div that owns the absolute positioning and let the component fill it. Replace the corner tonal badge cancel with an inline text-variant icon button after the percent label, and drop the padding reserved for the badge. * fix(dashboard): enforce session expiry and atomic save semantics Address the third review round (sourcery-ai findings): - get_session() now actually enforces the idle expiry it advertises in its "not found or expired" error; expired sessions stay abortable for cleanup, and backup upload_init starts the janitor just like chat's does, so chunk dirs cannot linger indefinitely. - cleanup_session() only unregisters a session after rmtree() succeeds, letting the janitor retry on transient filesystem errors instead of permanently leaking the chunk directory. - save_upload_stream() writes to a uniquely named temp sibling and atomically renames on success, so a failed or cancelled overwrite can no longer delete a pre-existing destination (e.g. re-uploading over an existing attachment), and all callers inherit the behavior. The write()-return-value finding is a non-issue: BufferedWriter writes fully or raises, and the chunk path already verifies byte counts. * fix(dashboard): guard failed-upload retry against double clicks retryFailedUpload() ran resume() without any in-flight marker, so a second click started a concurrent resume on the same session; the loser hit "not found or expired" and left a failed chip next to the successfully staged attachment. The entry now moves to activeUploads while resuming, which blocks the second click and shows live progress, and returns to failedUploads only if the resume errors. | 2 months ago |
| Files | Last commit | Last update |
|---|---|---|
| 12 days ago | ||
| 21 days ago | ||
| 21 days ago | ||
| 1 year ago | ||
| 21 days ago | ||
| 21 days ago | ||
| 15 days ago | ||
| 12 days ago | ||
| 4 days ago | ||
| 1 year ago | ||
| 2 months ago |