Repository navigation
feat: add composer attachments with owned storage - #157
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Files are staged under <home>/attachments/staging the moment they arrive (drop anywhere in the window, paste, or the composer's paperclip), shown as chips whose thumbnails load over the app's own modex-attachment: scheme (served only from that root), and moved into attachments/<thread id>/ on send, where the user item records them. Images reach Claude as base64 blocks on the stream-json user message and Codex as localImage inputs; other files are named by absolute path in the prompt, with --add-dir so Claude reads them without a prompt. Limits: 5 MB per image, 25 MB per file, 20 per message. Retry reuses the files; deleting the thread removes them. The Store demo reports attachments as unavailable. Co-Authored-By: Claude Fable 5.1 <[email protected]>
The layout spec fixes `+` at x 690 and the access pill at x 708, so the paperclip now follows the pill. The user bubble stays the element it was; attachment chips render as a sibling below it, right-aligned like the bubble. Co-Authored-By: Claude Fable 5.1 <[email protected]>
BunsDev
commented
Oct 10, 2026
BunsDev
left a comment
Contributor
Author
There was a problem hiding this comment.
Reviewed against #159 at 44ac57a.
The desktop attachment flow looks good:
- Storage is confined to its own folder, and the
modex-attachment:scheme resolves only paths inside it. - The staging sweep is safe. On macOS,
copyFileSyncgives the copy a fresh mtime (tested), so the 24h sweep can't remove a file that was just attached. - Both CLIs are handled without an API path.
- CI is green on this head.
Gap: the Store edition when connected to a host. Only the offline demo is handled.
apps/store-desktop/src/main/preload.cjshas nopathForFile, so every file goes as base64 throughDesktopHost. Its request limit is 1 MB (desktop-host.ts,body()), so files over about 750 KB fail with "Request is too large."attachments:pickislocalOnly, so the paperclip fails with "Unknown desktop command."- The Store main process doesn't register
modex-attachment://, so no thumbnails appear. - Fix in progress on this branch: report attachments as unavailable while connected, as the demo does.
Minor:
attachments:opencallsshell.openPath. Pasted bytes are written without a quarantine mark, so a pasted script opens without a Gatekeeper prompt.showItemInFolderfor non-images would avoid that.- The 20-per-message limit is enforced only in the renderer.
Not covered here from #159:
- The composer width (736px → 960px).
- The live check with each CLI, which is still unticked in the test plan.
- Add
Closes #159if this PR is meant to close it.
The App Store edition forwards workspace requests to its paired host, but attachments cannot cross that bridge yet: the host rejects requests over 1 MB, attachments:pick is local-only there, and the Store main process does not serve modex-attachment: thumbnails. Answer every attachments:* request in the Store main process instead of forwarding it: stage and pick report "Attachments are not available in the App Store edition yet.", discard is a no-op and open throws the same message. The offline demo keeps its own message, now shared from the same module. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Return validated turn-scoped permission profiles for the installed Codex protocol. Deny malformed or declined requests without granting session scope. Include backend and schema validation evidence.
Wait for matching native and renderer content bounds before exact layout assertions; retry Knowledge file visibility across responsive sidebar changes. Keep the scripted demo independent of login-PATH discovery. Validated on current main with build, unit tests (468 passed, 1 skipped), typecheck, 166 desktop E2E tests including real OpenKnowledge, and 7 site tests. Independent code and integration review passed. Assisted by Codex.
Track every accepted companion socket and destroy it during close so incomplete TLS handshakes cannot delay dispose. Add the half-open shutdown regression and update status evidence. Verified local build and 469 unit tests (one skip), independent integration review, and both current-head required macOS and iPhone workflows. The one diagnostic macOS rerun passed; the earlier empty-app close timeout remains unreproduced and unresolved.
Disable the simulator hardware keyboard before its first CI boot and log the resulting setting. This keeps the software keyboard available to the existing focus fallback without changing local Simulator preferences. Verified unchanged reviewed tree, build and 469 unit tests (one skip), independent review, and all four current-head hosted checks. Both iPhone jobs logged hardware keyboard 0; both macOS jobs passed 166 desktop and 7 site cases.
Identify the optional Jev CLI as unofficial in the README. Preserve the original one-word wording change on the verified current-main integration.
Align Graphite chat rows, hover details, Space navigation and page controls with the supplied references. Add local comments with per-page drafts and a floating view of the existing CLI chat. Keep page selections and component identity scoped to each document, and hide the native Knowledge guest while floating chat is open. Preserve composer state, keyboard navigation, saved sidebar widths and local Markdown operations.
Apply pending focus ranges after the committed textarea update so a delayed callback cannot collapse a newer selection. Share the Code command caret position with toolbar insertion. Verified with build, typecheck, 470 unit tests (one optional skip), 171 desktop E2E tests with real Knowledge, and seven site tests. Native regressions reproduced each original failure before the fixes.
Keep Modex usable in Streamer Mode with display-only secret masking, native editable values and terminal input preserved, and covers scoped to embedded Browser and Knowledge panes. Mask comment excerpts in full without changing saved quotes or clipboard values. Verified build, typecheck, 475 unit passes (one optional skip), 175 desktop E2E cases including three real Knowledge integrations, seven site tests, and independent source review. Preserve documented heuristic and human-acceptance limits.
Preserve unique historical Space/Knowledge verification outcomes and the original WorkOS/GitHub design proposal beneath a supersession banner. Record which unfinished snapshots are already delivered, while retaining their dirty source and probes. Three documentation files only. Final independent review, build, typecheck and 475 unit passes (one optional skip); both required hosted macOS checks passed the full 175 desktop and seven site tests. The editor focus failure exposed by the first audit CI was fixed separately in #170.
Integrate private attachment storage, transactional ownership and limits, project/thread drafts, native and development uploads, and safe previews/reveal. Preserve incoming Space and Streamer behavior and original attachment ancestry. Verified with build, typecheck, 621 unit passes plus one existing skip, 199 desktop E2E passes with real OpenKnowledge, seven site passes, and both installed Claude and Codex CLIs. Preserve the initial failed run and its unresolved resize observation alongside the final complete passing run.
This branch was successfully deployed
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.
Adds composer attachments through the existing Claude and Codex CLIs: pick, drop or paste files, remove chips, and send with or without text. App-owned drafts preserve text and files across thread/project switches and failed sends; pending copies block submission. The responsive composer now reaches 960px and rests at 109px.
Main owns private copies, validates metadata and byte limits, enforces 20 attachments per message and 5 MiB image/25 MiB file limits, and checks file identity during claim, access and cleanup. Authenticated development uploads use the same store. Raster thumbnails reject forged image content, and opening an attachment reveals its location. Store attachments report unavailable in both offline and connected modes.
Validation:
An earlier full run had a stale menu-order assertion and an unexplained Space resize mismatch. The menu assertion was corrected; five instrumented diagnostics, the focused original panel sequence, and the final full run passed without changing resize code or relaxing its exact width assertion. The original resize cause remains unproven and is retained in the evidence.
Issue #159 acceptance and live CLI evidence are recorded in the review. Store attachments remain unavailable, including connected mode. Fresh protected current-head CI is required before landing.