feat(app): upload managed attachments before prompt submit - #46185
Draft
safzanpirani wants to merge 4 commits into
Draft
feat(app): upload managed attachments before prompt submit#46185safzanpirani wants to merge 4 commits into
safzanpirani wants to merge 4 commits into
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: The search results show that PR #46185 (the current PR) appears alongside PR #46175. However, according to the PR description, #46175 is explicitly referenced as part of the base for this PR (mentioned as part of the stacked PR plan: "stacked on #46182 — this PR's diff is the top two commits, the rest is the #46175/#46182 base"). This means #46175 is not a duplicate but rather a dependency/related PR that this PR builds upon. No duplicate PRs found |
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.
Issue for this PR
Closes #46173 (PR 3 of the 3-PR plan there; stacked on #46182 — this PR's diff is the top two commits, the rest is the #46175/#46182 base)
Type of change
What does this PR do?
The client half: web/desktop attach flows upload the file to
POST /api/session/:sessionID/attachmentfirst, then submit the prompt with the returned managed URI in the existingPromptInput.FileAttachment. Any file type is accepted now, not just images. Against a v1 server the previous data-URI path still applies (v2-only feature, no v1 behavior change). A typed multipart upload adapter is added to the client package (the route can't be generated yet); blob URLs stay preview-only and durable prompts contain no base64. Upload failure (quota 413, network) surfaces the server's message, blocks the submit, and preserves the user's prompt text; retried batches reuse already-succeeded uploads.How did you verify your code works?
packages/client: 18 tests (Blob/File/stream multipart, typed 413/transport/malformed-response errors, auth-header parity with generated calls) + typecheck +check:generated.packages/app: focused submit/build/attachment tests (upload-before-submit ordering incl. queued and custom-command paths, 413 blocks submit + restores exact prompt text, partial-batch retry, v1 fallback) + browser tests + typecheck; full unit suite green except one pre-existingpa-PKlocale failure.packages/session-ui: 85 tests + typecheck.packages/coreattachment suites re-run green.Screenshots / recordings
Prompt-input behavior is covered by the existing component test harness; no visual redesign — existing cards/previews are reused.
Checklist