Skip to content

fix: handle Telegram document groups - #225

Open
QueryPlanner wants to merge 1 commit into
mainfrom
codex/fix-telegram-document-uploads
Open

QueryPlanner wants to merge 1 commit into
mainfrom
codex/fix-telegram-document-uploads

Conversation

@QueryPlanner

Copy link
Copy Markdown
Owner

What

Process all available files in a Telegram document bundle in one model turn, with their captions.

Why

The bot buffered photo bundles only. In the reported upload, three document messages started separate turns. Two were canceled before their files reached storage, and the model received only the transcript.

How

  • Reuse the Telegram album buffer for document groups and preserve message order.
  • Give same-named files distinct sandbox paths and keep uploads in the conversation queue when newer messages arrive.
  • Report unavailable files and tell the user which ones can be restored from durable storage.

Tests

  • Reproduced the loss on the previous code with two PDFs and a transcript.
  • Verified grouped uploads, consecutive uploads, and partial storage failures.
  • Ruff formatting and lint checks passed.
  • MyPy passed.
  • Full pytest suite passed with 2,867 tests passed, 1 skipped, and 100% coverage.

- Collect grouped documents before starting one conversation turn.
- Preserve distinct upload paths and report partial failures.
- Queue newer messages behind document uploads.

This branch has not been deployed

No deployments
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