Repository navigation
Studio: linked folders honour .gitignore, folder uploads in the browser, queued drops and retry for failed sources - #13224
Conversation
Chat with files now has its own card stacked above the composer, with a header (title, Project / This chat scope, Add files, paging arrows, close) over a strip of the chat's documents drawn as composer attachment cards. - Files reach the index only through the panel: its Add files button and drops on the panel. Composer attachments stay with the message. - The panel picker reuses the composer's file chooser via openFilePicker. - On a new chat the greeting, panel and composer center as one block. - Light mode draws a border, dark mode keeps the composer shadow. - Knowledge base chats and inherited project sources use the same panel.
…page - A drop on the chat with files panel during an upload is refused with a toast instead of falling through to the message attachments. - The project landing composer mounts the document preview, so its file cards open.
…les in chat with files (#13081) * Studio: read Office, OpenDocument, e-book, email and RTF files in chat with files Adds parsers for .doc .xls .xlsx .xlsm .ppt .pptx .msg .eml .rtf .odt .ods .odp .epub using only the standard library, and lets the chat with files panel pick and drop them along with .csv .tsv .json .xml. * Studio: address review on Office, ODF, e-book, email and RTF parsing - RTF: ignore negative \bin lengths, and decode literal 8-bit text in the document code page. - ODF: skip tracked deletions, keep bookmark references, read nested tables once, and cap text added by repeated cells and rows. - EPUB: resolve URI-escaped manifest paths. - OOXML: read Strict namespaces. - PPTX: drop only the notes slide number placeholder, not numeric notes. - XLS: format date cells from FORMAT, XF and DATEMODE records. - DOC: include footnotes, endnotes and text boxes. - MSG: decode String8 properties with the message code page, and fall back to the compressed RTF body. - Desktop: route dropped .doc .xls .xlsx .xlsm .ppt .pptx .msg files to chat with files. * Studio: harden RTF, compressed RTF, ODS and Excel date parsing - RTF: pair UTF-16 surrogates from \uN so astral characters survive, and skip text marked \deleted. - MSG: stop decoding compressed RTF at its declared size and refuse oversized bodies. - ODS: read typed cell values written without a text paragraph. - XLS and XLSX: treat the CJK and Thai built-in date formats as dates. * Studio: read .ppt slides from the latest save, with text boxes and notes Incremental saves keep old record versions in the stream, so slides from earlier saves were indexed too. The reader now follows the Current User edit chain and its persist directories to the live document, reads each slide's shapes in order (placeholders through OutlineTextRefAtom, plus text boxes), and appends speaker notes matched by slide id. A broken edit link continues with the next older edit; files without an edit chain keep the old scan. * Studio: format Excel times and errors, and read RTF font charsets - XLSX and XLS: time-of-day and [h] duration formats keep their own text, and serials before March 1900 account for Excel's 29 February 1900, as openpyxl does. - XLS: error cells and cached formula errors read as #DIV/0!, #N/A and so on, and long formula strings continue into CONTINUE records. - RTF: bytes decode with the active font's charset or code page, and groups nested past 1000 levels are refused. - MSG: Exchange senders get their SMTP address. - EML: an empty plain part falls back to the HTML part. * Read charts, number formats and package rels; bound XML parsing - Find the main OOXML part through _rels/.rels, and sharedStrings and styles through the workbook rels. - Stream sheet rows and shared strings with per-element, per-row and depth caps so large or crafted parts cannot exhaust memory. - Show Excel numbers with their display format (percent, grouping, scientific, literals, currency, sections). - Add pptx chart titles and cached series data. - Keep internal empty ODF cells, drop only trailing ones; stream .ods rows. - Prefer the Unicode branch of RTF \upr groups. - Join every inline body part of mixed emails. * Read Office macro, template and slideshow files, OpenDocument templates, MHTML and XHTML in chat with files * Decode Excel 5.0/95 byte strings with the workbook code page; bound the compound file FAT to the file size * Refuse EPUBs with DRM encrypted chapters; leave oversized number formats as stored * Skip the upload and index test where sqlite-vec cannot load * Trim comments * Read SmartArt labels and string HTML bodies; charge reused shared strings to the repeat budget * Read scatter chart caches; bound .doc text to the stream size * Keep each scatter series' X values; fall back from a blank .msg plain body
…-book and email files
…ers and shows a file count
… cards, info tooltip, flat panel edge
…dumps, keep syncing past the file cap, and report every failed file
…to studio-project-sources-followups
… sources, grouped linked folders and quieter folder syncs
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (1)ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex security review |
…to studio-project-sources-followups
…ep Retry when a delete fails, and skip malformed gitignore rules
…ail closed on unreadable .gitignore
|
@codex review |
…to studio-project-sources-followups # Conflicts: # studio/frontend/src/features/rag/components/thread-documents-bar.tsx
…s-followups # Conflicts: # studio/frontend/src/features/rag/components/project-sources-panel.tsx # studio/frontend/src/features/rag/components/thread-documents-bar.tsx # studio/frontend/src/features/rag/components/use-source-drop.ts # studio/frontend/tests/project-sources-model-without-tools.test.ts # studio/frontend/tests/rag-thread-initialization.test.ts
|
@codex review |
|
@codex security review |
There was a problem hiding this comment.
🛡️ Codex Security Review
Here are some automated security review suggestions for this pull request.
Reviewed commit: fa94d871b1
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
| directory, ancestor_paths, ancestor_identities, depth, rules = pending.pop() | ||
| directory_rel = os.path.relpath(directory, root).replace(os.sep, "/") | ||
| directory_rel = "" if directory_rel == "." else directory_rel | ||
| rules = (*rules, *_read_gitignore(directory, directory_rel)) |
There was a problem hiding this comment.
🛡️ Codex Security Review
Security: Bound .gitignore rules during linked-folder scans
When a user links a repository controlled by another party, every <=256 KiB .gitignore is parsed into an unbounded number of rules and this line accumulates all ancestor rules. _scan then applies every regex to each directory/file. One valid 256 KiB file can contain 131,072 one-character rules; with the 10,000-file default that is 1.31 billion checks (13.1 million took 4.43 s locally), and nested files retain millions of rule objects. The scan has no cancellation check and auto-sync runs by default, so a crafted repo can pin CPU or exhaust memory after it is linked. Cap rules per file and scan, and check cancellation while scanning.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not changing this: it needs a deliberately crafted .gitignore with 100k+ rules in a folder the user chose to link. Real .gitignore files are a few hundred rules at most, and per-name matching is already bounded (globstar cap, atomic star groups, 256 KB file cap).
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Stacked on #13078 (base
studio-chat-with-files-panel). This picks up the project, linked folder and source fixes that #13078 left out.Linked folders
.gitignoreis honoured. The root.gitignoreand nested ones apply, with the usual rules: anchoring,**, negation and directory-only patterns. The rules live incore/rag/gitignore.py.dist,build,out,target,coverage,htmlcovandvendorare skipped when the folder holding them also haspackage.json,pyproject.toml,Cargo.tomlor a similar manifest. A plainbuild/folder in a notes vault is still indexed.RAG_FOLDER_MAX_TEXT_BYTES, 0 turns the limit off). Empty files are left out too: an empty__init__.pyused to fail on every sync.RAG_FOLDER_MAX_FILESindexes the first 10,000 files in sorted order, so the same files are kept from one pass to the next. Only a folder past twice the cap is still refused, and the error now suggests a.gitignore.last_scan_atmoves on every 30 s pass, and clients compared it, so every open panel and tab re-fetched the project's full document list every 30 s. Folders now exposelastChangedAt, which moves only when files were added, changed, removed or renamed. Finished jobs reportrenamedFiles, and a job with no changes does not announce a sources change.Project Sources, knowledge bases and chat with files
node_modules, venvs,.envfiles, lockfiles and empty files are skipped. On desktop, dropping a folder suggests Link folder instead.Testing
studio/backend: the newtests/test_rag_folder_scan_filters.pyhas 30 tests:.gitignorepatterns and nested files;last_change_atunchanged on an idle pass;studio/backend:test_rag_linked_folders.py,test_rag_source_files_indexing.py,test_rag_linked_folder_grant_retry.pyandtest_folder_sync_account_rotation.pypass. The exceptions also fail on the base branch on this macOS host, where the temp directory is a denied system path: the threetest_scan_does_not_enter_dot_directoriescases andtest_scan_indexes_source_and_skips_dependencies_and_secrets.studio/frontend:npm run typecheckandnpm run buildpass, andnpm testpasses 11212 of 11212. New tests inrag-source-followups.test.tsandrag-upload-lifecycle.test.tscover:README.md,leave.txtandtool.py, and left outnode_modules/andprod.env. In the screenshot below, theempty.txtfailure comes from a run made before empty files were skipped; folder uploads now leave it out.Not tested here
Before / after (browser build, merge base vs this branch)
The empty Sources tab gains "Add folder" and the folder drop hint:
After uploading
notes.mdand an emptyempty.txt(refused with "Uploaded file is empty."), the failed file used to disappear after the toast. It now stays as a failed chip with Retry and remove: