Skip to content

feat: better image handling (auto resize & max size constraints)#26401

Open
rekram1-node wants to merge 17 commits intodevfrom
image-handling
Open

feat: better image handling (auto resize & max size constraints)#26401
rekram1-node wants to merge 17 commits intodevfrom
image-handling

Conversation

@rekram1-node
Copy link
Copy Markdown
Collaborator

WIP

opencode-agent Bot added a commit that referenced this pull request May 9, 2026
opencode-agent Bot added a commit that referenced this pull request May 9, 2026
opencode-agent Bot added a commit that referenced this pull request May 9, 2026
opencode-agent Bot added a commit that referenced this pull request May 9, 2026
opencode-agent Bot added a commit that referenced this pull request May 9, 2026
opencode-agent Bot added a commit that referenced this pull request May 9, 2026
opencode-agent Bot added a commit that referenced this pull request May 9, 2026
opencode-agent Bot added a commit that referenced this pull request May 9, 2026
opencode-agent Bot added a commit that referenced this pull request May 9, 2026
opencode-agent Bot added a commit that referenced this pull request May 9, 2026
opencode-agent Bot added a commit that referenced this pull request May 9, 2026
@rekram1-node
Copy link
Copy Markdown
Collaborator Author

/review

Comment thread packages/opencode/src/image/image.ts Outdated
Comment thread packages/opencode/src/image/image.ts Outdated
@rekram1-node
Copy link
Copy Markdown
Collaborator Author

/review

Comment thread packages/opencode/src/image/image.ts Outdated
Comment thread packages/opencode/src/session/prompt.ts
Comment thread packages/opencode/src/session/processor.ts Outdated
opencode-agent Bot added a commit that referenced this pull request May 9, 2026
opencode-agent Bot added a commit that referenced this pull request May 9, 2026
opencode-agent Bot added a commit that referenced this pull request May 9, 2026
@rekram1-node
Copy link
Copy Markdown
Collaborator Author

/review

Comment thread packages/opencode/src/config/config.ts
Comment thread packages/opencode/src/session/prompt.ts Outdated
@rekram1-node
Copy link
Copy Markdown
Collaborator Author

/review

const JPEG_QUALITIES = [80, 85, 70, 55, 40]
const log = Log.create({ service: "image" })

type Photon = typeof import("@silvia-odwyer/photon-node")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion, human can decide: this type alias appears to be unused. Since the style guide asks us to avoid extra single-use or unnecessary names, consider removing it unless it is intended for a near-term exported API.

variant: input.variant,
},
{ message: info, parts },
{ message: info, parts: resolvedParts },
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion, human can decide: chat.message now receives resolvedParts, but the saved message and Prompted event use the normalized parts built just below. That means plugins can observe or mutate the pre-resize image data, including large base64 payloads that are not what the model ultimately receives. Consider normalizing before this hook, or otherwise make the hook payload match the persisted parts.

opencode-agent Bot added a commit that referenced this pull request May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant