🤖 feat: stage arbitrary files from the creation composer#3748
Conversation
Creation composers (new chat on project/scratch pages) previously rejected non-provider files because no workspace exists to stage into. Hold such files in memory as a new pending-file attachment kind, then stage them via the existing stageAttachment IPC right after workspace creation and append the attached-files notice to the first message. If any staging call fails, fail closed: skip the initial send, transfer the draft (text + staged/pending attachments) into the new workspace's composer, and surface the error as a toast after navigation so the user can retry without creating a duplicate workspace. Workspace composers stage any pending-file drafts (from such transfers) at submit time. The file picker accept filter gate is removed since every composer can now take arbitrary files.
Reuse filePartsToChatAttachments for the failed-transfer draft, derive the staging mock types from stagePendingFiles instead of duplicating the IPC shapes, and trim comments to the non-obvious invariants.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6291eb71e0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
Deferred runtimes (Coder/SSH/devcontainer) return from create before provisioning finishes, so staging right after creation could write into a not-yet-ready workspace. Await the same InitStateManager barrier executeBash uses.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b10a50c7e2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
… init test Creation skill sends built muxMetadata.rawCommand before staging, so the transcript (which prefers rawCommand for display) lost the attachment chips; patch rawCommand with the notice after staging. Replace the fixed test sleep with an explicit barrier-reached gate.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fbcb26215d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
…nsfer For slash-skill creation sends, the transferred draft contained the rewritten skill text, so a retry lost the skill invocation. Prefer muxMetadata.rawCommand (the original typed command) for the draft text.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ff55a31f5a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
Staging can succeed and the initial sendMessage still fail; the creation draft was already cleared, so the workspace opened without the text or staged chips needed to retry. Reuse the staging-failure draft transfer.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f8d7782c16
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
…retries Creation sends with project-scoped skills force project-path discovery; a transferred-draft retry resolved the slash command against the new worktree instead, so it could miss or run a different skill. Persist an ephemeral per-workspace flag with the transfer, honor it in the workspace composer's skill resolution and send options, and clear it after the next successful send.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0673fa850a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9a20217971
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 23ec38eb5b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b1df87256b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f11c15d2c5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4268432f14
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
…r transferred drafts
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 39aca0dfeb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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 |
|
Codex Review: Didn't find any major issues. 🚀 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". |
Summary
Creation composers (new chat on project/scratch pages) can now accept arbitrary files. Non-provider files (
.md,.csv, binaries, ...) are held in memory as a newpending-fileattachment kind and staged into the workspace via the existingworkspace.stageAttachmentIPC right afterworkspace.create, before the firstsendMessage. The backendstageAttachmenthandler now waits for the workspace init barrier (same asexecuteBash) so staging works on deferred-init runtimes.Background
#3746 added arbitrary file paste/drop/pick, but only for workspace composers: files are written immediately into
.mux/user-attachments/of an existing workspace. The creation composer has no workspace yet, so dropping a non-provider file threw "Files can be staged after opening a workspace." and the picker was filtered toimage/*,.svg,.pdf.Implementation
pending-filekind in theChatAttachmentunion: filename, media type, size, and base64 bytes held in composer state (like provider data URLs), rendered with the same chip as staged files.processAttachmentFilesgainsholdNonProviderFiles; creation composers enable it. Provider-native formats still route first and the existing 10 MiB cap applies before reading bytes.create-> stage each pending file (newstagePendingFileshelper, sequential, per-file failure collection) -> append the<attached-files>notice built from returned staged paths ->sendMessage.WorkspaceService.stageAttachmentawaitsinitStateManager.waitForInitbefore writing, closing the race where deferred runtimes (Coder/SSH/devcontainer) return fromcreatewhile provisioning continues in background init.pending-filedrafts at submit time before building the notice./goaltyped with attachments bypasses command processing and sends as a normal message instead of silently dropping files; other commands with pending files are blocked with the existing toast.pending-filevalidator added; records are self-contained so the fork draft-copy path keeps them (unlikestaged, which is worktree-local). Existing 4M-char size guard unchanged.acceptgate removed (canStageFilesprop deleted); every composer takes any file type.Validation
stagePendingFilesordering and failure aggregation; draft round-trip and self-healing; creation flow asserting create -> stage x N -> send ordering with staged paths in the notice; fail-closed flow asserting no send, draft transfer, and persisted error.make static-checkand fullbun test src(10109 pass) locally.Risks
useCreationWorkspace.handleSend) now has a staging step between create and first send; a regression there would affect first-message delivery for new workspaces. The fail-closed path degrades to a draft in the new workspace rather than data loss.createreturns while post-create setup still runs; staging writes go through the host-mounted worktree, and a failure lands in the fail-closed retry path.Generated with
mux• Model:anthropic:claude-fable-5• Thinking:xhigh• Cost:$111.51