Skip to content

feat: download task attachments before starting the agent#52

Closed
ianhodge wants to merge 1 commit intomainfrom
oz-agent/fix-selfhosted-attachments
Closed

feat: download task attachments before starting the agent#52
ianhodge wants to merge 1 commit intomainfrom
oz-agent/fix-selfhosted-attachments

Conversation

@ianhodge
Copy link
Copy Markdown
Member

Summary

Add support for downloading task attachments before starting the agent. This is the worker-side half of enabling attachment support (e.g. Slack file uploads, image attachments) for self-hosted agents.

Problem

Self-hosted workers silently dropped task attachments because:

  1. The TaskAssignmentMessage type didn't include an attachments field, so attachment data from the server was lost during JSON deserialization
  2. There was no code to download attachments or pass an --attachments-dir to the oz CLI

Solution

Message types (messages.go)

  • Add AttachmentDownload struct matching the server's new field
  • Add Attachments field to TaskAssignmentMessage

Worker (worker.go)

  • Before executing a task, check if the assignment includes attachments
  • Download each attachment using its presigned URL to a temp directory
  • Name files as {attachmentID}_{filename} to match the server's ResolveAttachmentReferencesFromTaskDefinition convention
  • Pass --attachments-dir <dir> to the oz CLI so the agent can reference them
  • Clean up the temp directory after task execution

Companion PR

Server-side changes: warpdotdev/warp-server#10433


Conversation: https://staging.warp.dev/conversation/00d4e66f-d3ee-461b-95e0-1055ba628e08
Run: https://oz.staging.warp.dev/runs/019d938e-348d-7ced-8536-3e4841875e8f
This PR was generated with Oz.

Add support for task attachments in the self-hosted worker. When the server
includes attachment download URLs in the task assignment, the worker now:

1. Downloads all attachments to a temporary directory using presigned URLs
2. Names files as {attachmentID}_{filename} to match the server's
   ResolveAttachmentReferencesFromTaskDefinition convention
3. Passes --attachments-dir to the oz CLI so the agent can reference them

This enables features like Slack file uploads to work with self-hosted
agents. Previously, attachment data from the server was silently dropped
because the worker's TaskAssignmentMessage type didn't include the
attachments field and there was no download logic.

Companion PR: warpdotdev/warp-server (oz-agent/fix-selfhosted-attachments)

Co-Authored-By: Oz <oz-agent@warp.dev>
@ianhodge ianhodge closed this Apr 16, 2026
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