Skip to content

docs(ecosystem): add opencode-prune-images to plugins table - #55058

Closed
Sugamsss wants to merge 2 commits into
anomalyco:devfrom
Sugamsss:feat-ecosystem-prune-images
Closed

Sugamsss wants to merge 2 commits into
anomalyco:devfrom
Sugamsss:feat-ecosystem-prune-images

Conversation

@Sugamsss

@Sugamsss Sugamsss commented Oct 13, 2026 •

Copy link
Copy Markdown

Issue for this PR

Relates to #48095
Supersedes #48096 (which was closed by automated cleanup)

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds opencode-prune-images to the community plugins table in packages/web/src/content/docs/ecosystem.mdx.

Problem it solves

When running agent workflows with browser tools (Playwright, Chrome DevTools) or visual verification loops, chats accumulate dozens of screenshots. Upstream providers reject requests when image count limits are exceeded (e.g. 50 images max on Console, OpenAI, and Azure: 400 invalid_request_error: request contains 51 images, exceeding the maximum of 50 allowed per request).

While OpenCode 2.0 bounds inline image bytes above 25 MiB via boundImages(), it enforces no image-count limit and does not classify provider count errors as context overflow. An agent taking 51 small screenshots still bricks the session permanently.

How opencode-prune-images solves it

  • Dual-Budget Protection (Count + Bytes): Keeps the newest images within a count limit (default 7) and cumulative wire Base64 payload limit (default 16 MiB), completely preventing image-count and payload-size lockouts.
  • Conversational 3-Point Context Cards: Instead of dropping images into a black hole with a blind stub, older images are summarized into structured context cards with what was observed, why it was captured, and the exact path for recall.
  • Rolling FIFO Disk Buffer: Ephemeral /tmp captures and pasted base64 data are backed up to ~/.cache/opencode/recent-images/ (100 files FIFO) so screenshots don't vanish if /tmp is wiped.
  • Compaction Defense: Images are safely converted to text cards during compaction so compaction never fails on media payloads.
  • Universal Compatibility: Works across OpenCode 2.x (including 2.0.16+ nested media assets and Uint8Array binary buffers) and OpenCode 1.x.

Repository: https://github.com/Sugamsss/opencode-prune-images

How did you verify your code works?

  • Verified the markdown table entry matches the format and alignment of existing entries in ecosystem.mdx.
  • The plugin repository has 22 passing tests and a strict TypeScript check covering count limits, wire byte bounds, Uint8Array binary cache persistence, OpenCode 2 Media.Asset shapes, V1 tool attachments, and compaction hooks.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@opencode-agent opencode-agent Bot left a comment

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.

The docs entry looks fine. I didn't run anything because this only changes documentation. I checked that the row is well-formed and that the linked plugin repository exists. The public API is unchanged.

One thing for maintainers to decide: the description says Closes #48095. That issue asks for a built-in rolling window for images in OpenCode. Listing a third-party plugin in the ecosystem docs gives users a workaround, but it doesn't implement that request, so merging this would close the issue automatically. If the issue should stay open, it would be better to reference it without Closes.

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant