feat: download task attachments before starting the agent#52
Closed
feat: download task attachments before starting the agent#52
Conversation
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>
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.
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:
TaskAssignmentMessagetype didn't include anattachmentsfield, so attachment data from the server was lost during JSON deserialization--attachments-dirto the oz CLISolution
Message types (
messages.go)AttachmentDownloadstruct matching the server's new fieldAttachmentsfield toTaskAssignmentMessageWorker (
worker.go){attachmentID}_{filename}to match the server'sResolveAttachmentReferencesFromTaskDefinitionconvention--attachments-dir <dir>to the oz CLI so the agent can reference themCompanion 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.