## What
Frontend for chat workspace uploads:
- Files whose declared MIME type is outside the attachment allowlist are
automatically routed to the workspace upload endpoint (picker,
drag-drop, and paste). Empty/`application/octet-stream` types 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.
- Composer chips (`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.
- Timeline chips (`WorkspaceFileChip`) render `workspace-file-reference`
parts with name/size and the absolute path in a tooltip.
- References survive message edits and queued-message edits.
- Upload error text is the server message plus its detail when present,
without a doubled period or the generic developer-console hint. The
shared `formatAgentAttachmentUploadError` helper had the same defect for
inline attachments and is fixed there.
- The affordance is gated on a bound workspace with a connected agent;
otherwise the input falls back to attachments only. A disabled
(read-only) composer refuses workspace routing entirely. The target
agent is the one the server resolves for the chat binding (main now
enriches the binding server-side), so the frontend no longer mirrors
`agentselect.FindChatAgent`.
- Message edits only rehydrate `workspace-file-reference` parts whose
`workspace_file_workspace_id` matches 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 vitest` for 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](https://linear.app/codercom/issue/CODAGT-1172))
- Expose workspace-upload availability from the backend (the agent
`agentselect.FindChatAgent` would 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](https://linear.app/codercom/issue/CODAGT-1174))
- Reset or re-validate composer chips when `repairChatAgentIDs` replaces
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_id` differs 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](https://linear.app/codercom/issue/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](https://linear.app/codercom/issue/CODAGT-1170)).
`text/csv` is an allowlisted attachment type and stays inline (UAT
finding).
- Route large files of allowlisted types to workspace upload by size
([CODAGT-1169](https://linear.app/codercom/issue/CODAGT-1169)).
Part of CODAGT-211. Stack: agent API -> coderd endpoint -> UI (this PR).
> This PR was authored by Mux (AI) working on Mike's behalf.
Coder is a self-hosted platform for cloud development environments and AI coding agents. Workspaces are defined with Terraform, connected through a secure Wireguard® tunnel, and automatically shut down when not used. Coder Agents runs a native AI coding agent whose loop executes in the control plane on your infrastructure, with no API keys in workspaces.
- Define cloud development environments in Terraform
- EC2 VMs, Kubernetes Pods, Docker Containers, etc.
- Automatically shutdown idle resources to save on costs
- Onboard developers in seconds instead of days
- Delegate coding work to AI agents on your infrastructure
- Bring any model (Anthropic, OpenAI, Google, Bedrock, self-hosted)
- No LLM credentials in workspaces, user identity on every action
- Centralized model governance, cost tracking, and audit logging
Quickstart
Check out our install guides for other methods and a complete tutorial.
Try Coder with the install script on Linux and macOS, or grab the latest binary or installer from GitHub Releases on Windows:
curl -fsSL https://coder.com/install.sh | sh
Start the server and open http://localhost:3000 to create your initial user, create a Docker template, and provision your first workspace:
coder server
For a production deployment, add a PostgreSQL database (version 13 or later) and an external access URL, and see our validated architectures for sizing and infrastructure guidance:
coder server --postgres-url <url> --access-url <url>
Without these flags, Coder uses a built-in database and sets up a *.try.coder.app access URL for evaluation. Use coder --help for the full list of flags and environment variables.
Documentation
Browse the documentation or visit a specific section below:
- Workspaces: Workspaces contain the IDEs, dependencies, and configuration information needed for software development
- Templates: Templates are written in Terraform and describe the infrastructure for workspaces
- Coder Agents: Delegate coding work to AI agents running on your self-hosted infrastructure
- AI Gateway: Centralize authentication, auditing, and cost controls for AI tooling
- Administration: Learn how to operate Coder
- Premium: Learn about paid features built for large teams
- IDEs: Connect your existing editor to a workspace
Support
Open an issue for bugs and feature requests.
For community support, showcasing what you built, and feedback on in-progress features, join our Discord or GitHub Discussions.
Dedicated support is included in Coder Premium. For more information, visit coder.com/pricing.
Integrations
New integrations are always in progress. Open an issue to request one. Contributions are welcome in any official or community repository.
Official
- Coder Registry: Templates, modules, and integrations for common development environments
- Coding Agents: Run agents like Claude Code, Codex, and OpenCode isolated in Coder workspaces
- coderd Terraform Provider: Declaratively manage your Coder deployment configuration as code
- VS Code Extension: Open any Coder workspace in VS Code with a single click
- JetBrains Toolbox Plugin: Open any Coder workspace from JetBrains Toolbox with a single click
- Dev Containers: Build development environments using
devcontainer.jsonon Docker, Kubernetes, and OpenShift - Kubernetes Log Stream: Stream Kubernetes Pod events to the Coder startup logs
- Self-Hosted VS Code Extension Marketplace: A private extension marketplace that works in restricted or airgapped networks integrating with code-server.
- GitHub Actions: An action to set up the Coder CLI in GitHub workflows
Community
- Coder Discord: Chat with the community, get support, and hear about new product updates first
- Community Templates: Community-contributed workspace templates in the Coder Registry
- Community Modules: Community-contributed modules to extend Coder templates
- Coder Template GitHub Action: A GitHub Action that updates Coder templates
- Coder Agents Chat Action: A GitHub Action that starts a Coder Agents chat against a GitHub issue or pull request
Contributing
New contributors are always welcome. If you are new to the Coder codebase, see the contribution guide to get started.
Hiring
Apply on the careers page if you are interested in joining the team.
