Skip to content

feat(server): expose composable Linear file uploads - #310

Merged
siisee11 merged 1 commit into
mainfrom
codex/linear-file-upload-operation
Jul 14, 2026
Merged

siisee11 merged 1 commit into
mainfrom
codex/linear-file-upload-operation

Conversation

@siisee11

Copy link
Copy Markdown
Contributor

One-Line Summary

Agents can upload any local file to Linear and reuse the returned asset URL in existing issue or comment operations.

User-Facing Changes

  • Replaces the composite create_comment_with_image operation with a composable upload_file operation.
  • Accepts binary input with Content-Type and X-OneQuery-File-Name, including non-image files such as PDFs.
  • Returns the uploaded Linear assetUrl, which can be embedded in Markdown passed to create_comment or create_issue.

Why This Changed

create_comment_with_image was a Velen-specific convenience API, not an operation provided by Linear. It coupled file upload to one comment workflow and made agents believe image attachment was unavailable whenever only create_comment was considered. Linear's official API instead exposes fileUpload, followed by a presigned PUT, and expects the resulting asset URL to be used in Markdown.

How It Changed

  • Adds upload_file to the read-write Linear source API descriptor and removes create_comment_with_image.
  • Calls Linear's fileUpload GraphQL mutation, uploads the binary to the returned presigned URL, and exposes only the resulting assetUrl and success state.
  • Keeps create_comment unchanged so callers can compose the returned URL into image or file Markdown themselves.
  • Advances the Linear descriptor to linear.v3 and narrows upload headers to filename and content type.

Bug Fixes

  • Under agent-driven comment workflows, the prior composite operation was not discoverable as a general file primitive; upload_file now exposes the same official Linear flow independently of comment creation.
  • Non-image Linear attachments were rejected even though Linear supports them; valid MIME types are now accepted.

Extra Context / Decisions (Optional)

The response intentionally omits the temporary presigned upload URL and provider headers after the PUT completes. Callers receive the stable Linear asset URL needed for subsequent Markdown.

Verification

  • bunx oxfmt --check packages/server/src/source-api/adapters/linear.ts packages/server/src/source-api/adapters/linear.test.ts
  • bunx oxlint packages/server/src/source-api/adapters/linear.ts packages/server/src/source-api/adapters/linear.test.ts
  • bunx vitest run packages/server/src/source-api/adapters/linear.test.ts (13 tests, including PDF normalization, presigned upload success, and upload failure)
  • bun run --filter @onequery/server typecheck
  • bun run build
  • bun run test

Video / Screenshot (Optional)

  • N/A

@siisee11
siisee11 enabled auto-merge (squash) July 14, 2026 05:07
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
onequery-landing 3e7abfd Commit Preview URL

Branch Preview URL
Jul 14 2026, 05:08 AM

@siisee11
siisee11 merged commit 01ddc73 into main Jul 14, 2026
9 checks passed
@siisee11
siisee11 deleted the codex/linear-file-upload-operation branch July 14, 2026 05:10
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.

1 participant