Repository navigation
feat(site): support workspace file uploads from the new chat page - #27112
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. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0d665f9937
ℹ️ 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".
0d665f9 to
32a777a
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! 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". |
32a777a to
db35883
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: db35883c08
ℹ️ 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".
db35883 to
40f2a3b
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 40f2a3b583
ℹ️ 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".
40f2a3b to
84d79af
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 84d79afa43
ℹ️ 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".
84d79af to
d11e67d
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d11e67d0b8
ℹ️ 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".
d11e67d to
aad65b9
Compare
|
@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". |
|
Stopping the automated Codex loop on this PR as well and handing it to a human reviewer. Reason: this PR's own diff has not changed since round 3 (only the layers below were restacked), and Codex approved it on four consecutive heads before this round produced three new findings on the same code (an FE8 design point about the scope-key reset effect, the navigate-after-unmount window during the first-message request, and the error presentation of a failed deferred send). Each is answered and resolved above; the two behavioral items are tracked as follow-ups in the description and the design point is left for the reviewer. |
jscottmiller
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.
92320a9 to
91bb9e3
Compare
91bb9e3 to
608799c
Compare
jscottmiller
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.
608799c to
675276b
Compare
7a36398 to
468ec93
Compare
Workspace-routed files (zips and other non-attachment types) can now be attached on the new-chat page when a workspace is selected. Since the upload endpoint needs a chat ID, files queue locally and the submit becomes a three-step sequence: create the chat without content, upload the queued files, then send the first message carrying the workspace file references. Failure handling: any upload failure archives the just-created chat and keeps the composer state for retry; a failed first message lands on the created chat with a toast since the uploads are already there. Deselecting the workspace drops queued files with a notice. The no-workspace toast now says to select a workspace instead of the misleading "attach a running workspace to the chat".
…t send conflicts A first-message send can fail on the client after the server already committed it. Archiving the chat then returns 409 because it left the idle state, so treat that as success and open the chat instead of showing error toasts on the composer.
…ertions to Vitest Story play functions may drive state but must not assert. Cover the deferred workspace upload behavior in AgentCreateForm.test.tsx and keep only the visually distinct stories, without assertions. Drop stories that duplicated existing coverage or had no visual state to capture.
… locked until navigation After the page's create call resolved, the form cleared its chips and unlocked while the page had not yet navigated. A pending Send then took the text-only path and created a duplicate chat without files, and a file added in that window was uploaded and silently dropped. Guard submits with a synchronous in-flight ref and keep the composer locked after a successful submit; only a failed submit releases it. Attachments are refused with a toast while a submit is in flight.
…a send is pending The composer's Lexical editor becomes non-editable during a pending send, and Lexical ignores paste events on a non-editable root. Pasted files were therefore dropped silently, while the file picker and drop target showed the "wait for the current message" toast. Route pasted files through the same path while a send is pending so the form and composer refuse them visibly. Read-only composers keep ignoring paste.
468ec93 to
68d1ea5
Compare
…able in the picker when workspace uploads are wired iOS greys out types excluded by the input's accept attribute with no explanation, so zips, tarballs and videos were unselectable whenever no workspace was ready. Leave accept unset and let routeFiles show the unavailable-workspace message instead.

What
Workspace-routed files, such as zip archives, can now be attached on the new-chat page when a running workspace is selected. Previously the upload endpoint required a chat ID that did not exist yet, so the landing page rejected these files with a misleading toast.
How
deferredchip state ("Uploads when sent"), distinct from the chat page'squeuedstate ("Waiting to upload...").Follow-ups
The create page gates workspace uploads on any connected root agent; the server picks the agent with
agentselect.FindChatAgent, so a multi-root-agent workspace with a disconnected chat-suffixed agent passes the gate and fails on upload (error toast, draft preserved, shell chat archived). An exact probe needs the selection exposed by the API. Tracked in CODAGT-1174.Freeze regular attachment remove controls while the deferred workspace upload runs (adding files is already refused); the message is sent with the attachment IDs snapshotted at submit time, and
AttachmentPreview/AgentChatInputcurrently have no read-only mode (the same window exists on the chat page while a send is pending).Skip the final navigation when the user leaves the page while the deferred first-message request is in flight (needs an unmounted signal through the page; the regular create path on main has the same window).
Route a failed deferred first message through the form's inline hook-failure presentation (with the lifecycle-hook dispatch detail) instead of the toast; needs the send mutation state lifted into the form.
Recover from a first-message request that never responds (client timeout or cancel, archiving the shell chat on abandon); the create path on main has the same hang (CODAGT-1177).
Show one refusal toast per paste batch and use one policy for inline attachments during a pending send on both pages (CODAGT-1178).
Testing
AgentCreatePage.test.tsxcovers the create, upload, send, navigate order and each archive path;AgentCreateForm.test.tsxcovers the deferred-upload form behavior. The stories added here keep only distinct visual states.Notes
Queued
Fileobjects do not survive a page reload. A browser closing mid-sequence can leave an idle, archivable chat after an explicit submit.