Skip to content

Bound inline image request payloads - #670

Draft
alejandro-ao wants to merge 2 commits into
mainfrom
fix/image-tool-payload-budget
Draft

Bound inline image request payloads#670
alejandro-ao wants to merge 2 commits into
mainfrom
fix/image-tool-payload-budget

Conversation

@alejandro-ao

@alejandro-ao alejandro-ao commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • cap read-generated inline image payloads at 4 MB of base64 per assistant turn
  • automatically resize and re-encode images to fit the remaining turn budget
  • return an actionable text-only tool result only when safe automatic compression cannot fit
  • omit image bytes already consumed by a successful assistant from later provider replays while preserving durable session history
  • allow sticky automatic Hugging Face routes to reroute once after a pre-output HTTP 413

User experience

Multiple individually valid screenshots can no longer accumulate until the next model request fails with request entity too large. Tau first compresses an image to fit the request and tells the agent what happened. If the image still cannot fit safely, the agent receives a normal tool result with the total limit, remaining space, and instructions to resize or compress the source. Existing sessions also stop replaying already-consumed image bytes.

Validation

  • uv run pytest -q — 1858 passed, 2 skipped
  • uv run ruff check .
  • uv run ruff format --check .
  • uv run mypy
  • cd website && hugo --minify

Manual validation

  1. Ask a vision-capable model to read enough screenshots in one turn to approach the 4 MB encoded-image budget.
  2. Confirm the next large image is automatically resized/re-encoded to fit and the tool result reports the transformation.
  3. Exhaust the remaining budget and confirm read returns an omission result containing the total limit, remaining space, and resize/compress guidance.
  4. Continue after a successful image response and confirm old image bytes are not resent while session history remains intact.

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