[codex] Add high-fidelity PDF file attachment plumbing#983
Open
mimeding wants to merge 1 commit intoosaurus-ai:mainfrom
Open
[codex] Add high-fidelity PDF file attachment plumbing#983mimeding wants to merge 1 commit intoosaurus-ai:mainfrom
mimeding wants to merge 1 commit intoosaurus-ai:mainfrom
Conversation
497f813 to
579226f
Compare
177514a to
e5b5e76
Compare
Contributor
Author
|
@tpae could you please review the core high-fidelity file I/O contract in this PR? The key design question is whether this is the right boundary for PDF/PPT/PPTX support:
Question: are you comfortable with trusted native plugins receiving Follow-up blocker: the companion |
Business rationale: File fidelity is a core part of the Osaurus harness: users need PDFs, presentations, spreadsheets, audio, video, and other local documents to survive chat, plugin, and tool handoffs without being flattened into lossy text or accidentally dropped. Preserving private files as local artifacts strengthens trust because the app can reason over previews while keeping the original bytes available on the user's machine. Coding rationale: Attachment.Kind.file carries filename, MIME type, size, host path, and extracted preview so downstream code can distinguish rich files from inline text. AttachmentFileStore centralizes local preservation under Osaurus-controlled paths instead of scattering copy logic across views, while ExternalTool and PluginHostAPI expose a bounded _context.attachments surface for tools. Spillover preserves file attachments before falling back to blobs, and the new tests pin security boundaries, plugin API shape, and high-fidelity handoff behavior. Co-authored-by: Codex <codex@openai.com>
e5b5e76 to
22b2568
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Business rationale
File fidelity is a core part of the Osaurus harness: users need PDFs, presentations, spreadsheets, audio, video, and other local documents to survive chat, plugin, and tool handoffs without being flattened into lossy text or accidentally dropped. Preserving private files as local artifacts keeps the model's prompt lightweight while giving trusted local tools access to the original bytes when the user asks for high-fidelity read, edit, render, or export workflows.
Coding rationale
Attachment.Kind.filecarries filename, MIME type, size, host path, and extracted preview so rich files can be treated differently from inline text while keeping old attachment decoding compatible.AttachmentFileStorecentralizes file preservation under Osaurus-controlled paths instead of scattering copy logic through chat views._context.attachmentsis injected into external and plugin tool payloads as a narrow metadata surface, so tools can opt into real files without bloating every prompt. Attachment spillover preserves file attachments before falling back to blobs because the bytes already live outside chat history JSON.What changed
Attachment.Kind.filesupport with MIME/category helpers and compatibility decoding.AttachmentFileStoreand Osaurus path support for preserved attachment files.ChatView/FloatingInputCardwhile retaining compact extracted previews._context.attachmentstoExternalTooland v2 plugin host payloads.Validation
git fetch origin && git rebase origin/mainswift build --package-path Packages/OsaurusCoreswift build --package-path Packages/OsaurusCore -c releaseswift test --package-path Packages/OsaurusCore(1445 tests in 195 suites passed;SandboxIntegrationTestsskipped by guard)xcrun swift-format lint --stricton every touched Swift fileswiftlint lint --stricton every touched Swift filegit diff --check origin/main...HEADPackages/OsaurusCLI.Non-scope
Residual risks
host_pathcarefully and preserve folder/path containment in their own tools.