Skip to content

feat(app): upload managed attachments before prompt submit - #46185

Draft
safzanpirani wants to merge 4 commits into
anomalyco:devfrom
safzanpirani:attachment-wiring
Draft

feat(app): upload managed attachments before prompt submit#46185
safzanpirani wants to merge 4 commits into
anomalyco:devfrom
safzanpirani:attachment-wiring

Conversation

@safzanpirani

Copy link
Copy Markdown

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

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The client half: web/desktop attach flows upload the file to POST /api/session/:sessionID/attachment first, then submit the prompt with the returned managed URI in the existing PromptInput.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-existing pa-PK locale failure.
  • packages/session-ui: 85 tests + typecheck. packages/core attachment 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

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: upload attachments to the server so agent tools can read them (managed per-session store)

1 participant