Repository navigation
feat(bots): download and send sandbox files as attachments - #604
Merged
Merged
Conversation
nixuuu
force-pushed
the
feat/bot-download-attachments
branch
3 times, most recently
from
November 12, 2026 23:40
84beb21 to
e4d0ef7
Compare
nixuuu
force-pushed
the
feat/bot-download-attachments
branch
from
November 12, 2026 23:49
e4d0ef7 to
c74ac57
Compare
nixuuu
marked this pull request as ready for review
November 13, 2026 00:13
nixuuu
added a commit
that referenced
this pull request
Nov 18, 2026
nixuuu
added a commit
that referenced
this pull request
Nov 18, 2026
## Changes - Send a fixed Canopy-Bot User-Agent on public bot downloads, including redirects. GitHub REST accepts the same anonymous Releases request that previously returned HTTP 403. - Let private bot turns and routines with Web access verify the earliest indexed publication of up to 50 Canopy PRs across Nightly, Beta, and Stable. The gateway reuses the public changelog index and returns only matching versions, dates, and source links. This keeps large release bodies outside conversation files and requires no GitHub credential. ## Verification - Focused worker download tests and gateway typecheck. - Real anonymous GitHub Releases download and read through the worker file implementation. Live index lookup for a PR published to all three channels. - Tests for duplicate PRs, missing matches, and publication ordering. The standalone gateway policy test hits an import-cycle failure on both the branch and clean dev. Required CI covers the combined test suite and builds. Fixes: #604
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.
Bots can download public HTTP(S) files into their conversation workspace and send generated/downloaded files as ordinary Canopy attachments. download_file and send_attachment are gated by current Files permission, owner, worker, active turn and gateway approval policy. A new bot_outgoing_files_v1 capability prevents dispatch to older workers; protobuf extensions are additive and no migration is needed.
Downloads block private/loopback/link-local/metadata/reserved addresses after DNS and on every redirect, pin the checked literal IP and preserve HTTPS hostname verification. Limits: 50 MiB, five redirects, 60 seconds total, 10 seconds idle; Content-Length and streamed bytes are checked separately. No credentials, cookies, inherited proxy, execution or unpacking. Files is the download permission, independent of native Web access.
Outgoing transfers use bounded chunks and an immutable worker snapshot with SHA-256. Existing gateway attachment validation/storage, message, audit and durable tool result commit in the fenced/idempotent action. Replayed call IDs return the stored result; revoked Files and stopped/foreign turns cannot publish. Existing web/desktop/mobile APIs and attachment renderers provide download and supported previews. This repository has MCP connector accounts, but no automatic Telegram/Slack chat delivery adapters; external delivery needs its separately granted connector tool.
Fourth draft layer of stack #598. Do not merge separately.
Validation: authorized review-host checks passed: gen:check, typecheck, lint, format:check and web build. All download security tests passed (3 tests): SSRF private/reserved ranges, redirects, DNS pinning/rebinding, declared/streamed size, DNS/body timeouts and MIME. All gateway↔worker outgoing-file tests passed (6 tests): every provider, attachment retrieval, replay without duplicate delivery/audit, owner refusal through core/storage, completed turns, approval refusal, Files revocation and restarts. Local HTTP/inference fixtures only. The final UI layer was reviewed in one Chromium session at desktop/phone widths, light/dark, including actual Markdown/image previews and downloads.
Copy audit §8: errors name public-URL, size, timeout or permission failures with a recovery action. Tool descriptions distinguish downloading from sending and Canopy delivery from connector delivery. Prompt states files/web boundaries, retention and limits. No new UI controls in this layer; final-layer visual verification passed.
Related: #469, #581