Repository navigation
feat(app): upload managed attachments before prompt submit - #46185
safzanpirani wants to merge 4 commits into
Conversation
|
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 |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
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