Skip to content

Put presigned S3 URLs first in file hints, proxy only as fallback - #8

Merged
glani merged 1 commit into
mainfrom
presigned-first-hints
Nov 11, 2026
Merged

glani merged 1 commit into
mainfrom
presigned-first-hints

Conversation

@glani

@glani glani commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Problem

The hint returned by download_file / upload_file put the proxy URL into the main curl command, while the text said the proxy is only a fallback. AI clients copy that command verbatim, so every transfer went through watchword.giglabo.com (Cloudflare):

  • downloads: ~90 KB/s through Cloudflare vs ~57 MB/s straight from S3 (200 MB file)
  • uploads: Cloudflare rejects request bodies over 100 MB (413), although watchword allows 1 GB

Change

  • Hints: the primary command uses the presigned download_url / upload_url (upload keeps the Content-Type header). When the proxy is enabled, a separate sentence names proxy_url / proxy_upload_url and gives the full fallback command; the upload fallback mentions the ~100 MB limit.
  • Tool descriptions (internal/config/config.go defaults): presigned URLs are the primary, fast path; proxy URLs are fallbacks for sandboxes that cannot reach S3.
  • The proxy itself stays (added in 2fa0612 for sandboxed clients). No JSON field names or response structure changed.
  • Tests assert the primary command contains the presigned URL and the proxy URL appears only in the fallback, with and without a proxy signer.
  • CLAUDE.md: presigned is primary, proxy is fallback, and why.

🤖 Generated with Claude Code

The upload_file/download_file hints put the proxy URL into the main curl
command while the text called the proxy a fallback. AI clients copy the
command verbatim, so every transfer went through Cloudflare: ~90 KB/s
instead of ~57 MB/s from S3 for downloads, and uploads over 100 MB were
rejected with 413.

The hint now starts with the presigned command; when the proxy is enabled
a separate sentence names proxy_url/proxy_upload_url and gives the full
fallback command (uploads: limited to ~100 MB). The tool descriptions say
the same. JSON field names and response structure are unchanged.
@glani
glani merged commit 422c6a8 into main Nov 11, 2026
12 checks passed
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