Concurrent send_file uploads in one turn are uncapped #1040

Closed
opened 2026-10-27 13:38:47 +00:00 by sam · 0 comments
Owner

liveReply.Media starts an unbounded mediaWg.Go per attachment. Not a leak (each is bounded by a 30s ctx) and not a memory problem (go-telegram streams via io.Pipe, nothing is buffered), but N send_file calls in one turn start N concurrent multipart uploads against a rate-limited API.

Also noted: send_file is ClassIdempotent, which makes it ExecParallelSafe. Defensible since the tool only validates and never sends, but minimax is ClassMutating for an equivalent 'produces an outbound artifact' tool -- worth deciding deliberately rather than by accident.

Found by adversarial review of 9a45fbb. internal/channels/telegram/live.go:386.

Acceptance Criteria

Either a bound on concurrent media sends per reply, or a recorded decision that the 30s timeout plus Telegram's own rate limiting is sufficient.

Close reason

Landed in 82d7bb3; GitHub #648 already closed.


Imported from beads archie-core-3svc · GitHub #648 · type task · priority P4 · created 2026-08-24 · closed 2026-09-17

liveReply.Media starts an unbounded mediaWg.Go per attachment. Not a leak (each is bounded by a 30s ctx) and not a memory problem (go-telegram streams via io.Pipe, nothing is buffered), but N send_file calls in one turn start N concurrent multipart uploads against a rate-limited API. Also noted: send_file is ClassIdempotent, which makes it ExecParallelSafe. Defensible since the tool only validates and never sends, but minimax is ClassMutating for an equivalent 'produces an outbound artifact' tool -- worth deciding deliberately rather than by accident. Found by adversarial review of 9a45fbb. internal/channels/telegram/live.go:386. ## Acceptance Criteria Either a bound on concurrent media sends per reply, or a recorded decision that the 30s timeout plus Telegram's own rate limiting is sufficient. ### Close reason Landed in 82d7bb3; GitHub #648 already closed. --- _Imported from beads `archie-core-3svc` · GitHub #648 · type task · priority P4 · created 2026-08-24 · closed 2026-09-17_
sam added the task label 2026-10-27 13:38:47 +00:00
sam self-assigned this 2026-10-27 13:38:47 +00:00
sam closed this issue 2026-10-27 13:38:47 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1040