Skip to content

docs(rfc): add RFC-0059 image attachment normalization - #13

Closed
Million-mo wants to merge 1 commit into
mainfrom
docs/rfc-0059-image-attachment-normalization
Closed

docs(rfc): add RFC-0059 image attachment normalization#13
Million-mo wants to merge 1 commit into
mainfrom
docs/rfc-0059-image-attachment-normalization

Conversation

@Million-mo

Copy link
Copy Markdown
Owner

Summary

Adds RFC-0059: Image Attachment Normalization (DRAFT), which proposes inserting the existing resize_image_if_needed() normalization into the protocol user-upload path.

Context

AgentPool already normalizes images on the tool-read path: resize_image_if_needed() in src/wolfharness_toolsets/fsspec_toolset/image_utils.py (Pillow-based, default 2000px / 4.5MB) is wired into read tool and the fsspec toolset.

However, the protocol user-upload paths bypass it entirely:

  • Python API run_agent(image_url=...)ImageUrl
  • ACP server ImageContentBlock/BlobResourceContentsBinaryImage
  • OpenCode server FilePartInputBinaryContent.from_data_uri()

Oversized field photos (4000×3000px, 10–20MB) get forwarded to the model unchanged, risking context overflow and opaque provider errors.

What the RFC proposes

  1. Reuse the existing resize_image_if_needed() rather than building a new resizer
  2. Insert it at the FilePart → pydantic-ai content conversion points across all three protocol entries
  3. Distinct over-limit failure semantics: user input errors cleanly, tool-result images keep omission behavior
  4. Config-supported limits (attachment.image.{auto_resize, max_width, max_height, max_base64_bytes})

Files

  • docs/rfcs/draft/RFC-0059-image-attachment-normalization.md (new, 477 lines)

Note

Following repo convention, STATUS.md is maintained separately from individual RFC commits (per RFC-0058 precedent) — not touched in this PR.

Reviewers

@yuchen.liu (pending)

Proposes inserting the existing resize_image_if_needed() normalization
(the read tool / fsspec toolset path, Pillow-based, default 2000px / 4.5MB)
into the protocol user-upload conversion points: Python API run_agent,
ACP attachments, and OpenCode server FilePartInput. Distinct failure
semantics for user input vs tool-result over-limit; model failure
behavior based on opencode's image.ts reference.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@Million-mo

Copy link
Copy Markdown
Owner Author

Superseded by wolf1069b#375 — the RFC should land on the origin repo (wolf1069b/wolfharness), not the Million-mo/agentpool fork.

@Million-mo Million-mo closed this Aug 17, 2026
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