Repository navigation
feat(site): route non-attachment chat files to workspace uploads - #27080
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
commented
Jul 7, 2026
commented
Jul 7, 2026
|
@codex review |
Documentation CheckUpdates Needed
Automated review via Coder Agents |
left a comment
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6e27fef423
ℹ️ 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".
6e27fef to
1491b74
Compare
commented
Jul 7, 2026
|
@codex review |
1491b74 to
4d92aca
Compare
left a comment
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1491b74669
ℹ️ 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".
commented
Jul 7, 2026
|
@codex review |
left a comment
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4d92acabaf
ℹ️ 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".
4d92aca to
dd220f8
Compare
commented
Jul 7, 2026
|
@codex review |
left a comment
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dd220f8a6c
ℹ️ 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".
dd220f8 to
f192a13
Compare
commented
Jul 7, 2026
|
@codex review |
left a comment
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f192a13b89
ℹ️ 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".
f192a13 to
b1ae8ac
Compare
commented
Jul 8, 2026
|
@codex review |
left a comment
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b1ae8acf27
ℹ️ 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".
b1ae8ac to
45d3fb2
Compare
commented
Jul 8, 2026
|
@codex review |
left a comment
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 45d3fb28e5
ℹ️ 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".
left a comment
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 28f8e4f5dd
ℹ️ 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".
28f8e4f to
11e2bb5
Compare
commented
Sep 21, 2026
|
@codex review |
left a comment
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 11e2bb5e5b
ℹ️ 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".
11e2bb5 to
e9a28bd
Compare
commented
Sep 21, 2026
|
@codex review |
left a comment
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e9a28bd704
ℹ️ 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".
e9a28bd to
efc33e5
Compare
commented
Sep 21, 2026
|
Stopping the automated Codex loop on this PR and handing it to a human reviewer. Reason: the loop is not converging. Findings per round on this PR: 1, 4, 3, 3, 4. Every round surfaced new areas rather than shrinking the previous set, and the last two rounds re-raised design points that were already declined with rationale and tracked as follow-ups in the description (client-side mirror of State for review: the four other PRs in the stack are Codex-approved on their current heads. UAT round 2 on the previous tip ( |
left a comment
There was a problem hiding this comment.
Approved. See the summary comment on #27078 and the non-blocking inline follow-ups across the stack.
Approval posted by Coder Agents on Scott's behalf.
efc33e5 to
7904dbc
Compare
7904dbc to
1c45f25
Compare
left a comment
There was a problem hiding this comment.
Re-approved after the fix commits. Verified the addressed threads against the code (agent atomic publish, workspace status, normalized references, logging/metric, first-message fallback title, reasoning-effort override, Vitest coverage, archive-409 navigation) and ran the affected Go and Vitest suites; the remaining notes are acceptable as is. The three open follow-up threads are resolved as agreed follow-ups.
Approval posted by Coder Agents on Scott's behalf.
1c45f25 to
19fb01d
Compare
Auto-route files whose MIME type is outside the attachment allowlist to the new chat workspace upload endpoint. Uploads start eagerly on select, are concurrency-limited and abortable, and render as chips in the composer and timeline. workspace-file-reference parts survive message edits and queued-message edits.
…rkspace filter Editing a message rehydrates workspace file references only when they belong to the chat's bound workspace. Assert references from another workspace or with no workspace id are dropped from the send payload.
… queued uploads Upload errors now show the server message followed by its detail only when present, without doubled punctuation or the developer console hint that getErrorDetail adds for any Error. This also applies to inline chat attachments, which shared the same formatter and defect. Workspace uploads waiting for one of the three concurrent slots now carry a queued status and read "Waiting to upload..." instead of claiming to upload. Send gating treats queued and uploading alike.
19fb01d to
96d884d
Compare

What
Frontend for chat workspace uploads:
application/octet-streamtypes stay on the attachment path so the server can sniff bytes.useWorkspaceFileUploads: react-query mutation with eager upload on select, bounded to 3 concurrent streams, per-entry abort (removing a chip cancels its in-flight request), and generation-scoped workers so switching chats mid-upload cannot leak a stale upload into the new chat.WorkspaceUploadPreview) show queued ("Waiting to upload..." beyond the 3 in flight), uploading, uploaded, and error states; removal copy makes explicit that already-uploaded bytes stay in the workspace.WorkspaceFileChip) renderworkspace-file-referenceparts with name/size and the absolute path in a tooltip.formatAgentAttachmentUploadErrorhelper had the same defect for inline attachments and is fixed there.agentselect.FindChatAgent.workspace-file-referenceparts whoseworkspace_file_workspace_idmatches the currently bound workspace; references from a previous binding are dropped from the edit draft (the server also rejects them).Why
Completes CODAGT-211: dropping a
.zip/.tar.gz/dataset whose MIME type is outside the attachment allowlist into chat lands it at~/.coder/chats/<chat-id>/files/where the agent can act on it, without pushing bytes through the LLM context.How tested
pnpm vitestfor the upload hook (including a chat-switch race regression test), routing predicate, message parsing/helpers; Storybook interaction tests for the chip states;tsc, biome, React Compiler check, and knip all clean.Follow-ups
Persist workspace-upload metadata per chat so composer chips survive a failed workspace rebind and navigating away from and back to a chat. Today the hook resets when the chat or bound workspace changes (the server rejects references from a previous binding) and the upload list is client state only, so the chips are dropped even though the bytes stay in the workspace. (CODAGT-1172)
Expose workspace-upload availability from the backend (the agent
agentselect.FindChatAgentwould pick) instead of the client gating on the bound agent or, when the chat has none yet, on any connected root agent; a multi-root-agent workspace whose selected agent is disconnected currently gets the server's 409 on upload. (CODAGT-1174)Reset or re-validate composer chips when
repairChatAgentIDsreplaces the bound agent after a workspace rebuild (the hooks scope on chat and workspace ID only); belongs with the upload-metadata persistence above.Render timeline chips whose
workspace_file_workspace_iddiffers from the chat's current binding in a stale/unavailable state (the prompt already renders such references as unavailable); needs the current binding threaded into the timeline and a chip variant. (CODAGT-1173)Files with an unknown MIME type (empty or
application/octet-stream, for example a random.bin) stay on the attachment path by design, where the server classifies the bytes and rejects them with "Unsupported file type"; routing that rejection to the workspace upload instead is a follow-up (CODAGT-1170).text/csvis an allowlisted attachment type and stays inline (UAT finding).Route large files of allowlisted types to workspace upload by size (CODAGT-1169).
Part of CODAGT-211. Stack: agent API -> coderd endpoint -> UI (this PR).