GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(core): promote managed attachment media on first turn by safzanpirani · Pull Request #46182 · anomalyco/opencode

Conversation

@safzanpirani

@safzanpirani safzanpirani commented Aug 29, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #46173 (PR 2 of the 3-PR plan there; stacked on #46175 — only the top commit f9e6c06c6 is this PR's diff, the rest is #46175's base)

Type of change

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

What does this PR do?

Native media delivery for managed attachments. On the first provider turn that consumes a prompt, a stored image or PDF is sent as native media (path in the media part's filename) when the model's catalog capabilities, the sniffed MIME, the protocol route, and the decoded-size limit all allow it. Anything disqualified degrades to the path-only text part from #46175 instead of aborting. Later turns replay path-only — the file is never re-read or re-encoded, and no base64 is persisted (the #42263 failure class). Delivery is at-most-once via a durable nativeMediaDeliveredAt marker written before provider I/O. Media admission is owned by each protocol (Chat Completions: images only; Responses/Anthropic/Gemini: images + PDF), so core can't drift from what lowering accepts.

How did you verify your code works?

  • packages/core: focused suites 124 pass — includes a two-real-runner-turn test with a recording LLM client that kills and reopens the runtime/store between turns, then asserts the replay request is path-only and raw session_message rows contain no media base64. Typecheck clean.
  • packages/llm: 300 pass / 30 skipped, typecheck clean — per-protocol admission and PDF lowering tests for Responses, Anthropic, Gemini; Chat Completions PDF rejection.
  • packages/opencode: HTTP attachment suite 5 pass.

Screenshots / recordings

Not a UI change.

Checklist

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
safzanpirani added 2 commits August 29, 2026 22:58
@safzanpirani
feat(core): materialize managed attachments
7dc3901
@safzanpirani
feat(core): promote managed attachment media on first turn
f9e6c06
@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

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

Based on my search results, I found one related PR that is not a duplicate but rather a stacked dependency:

Related PR (not a duplicate):

  • PR feat(core): materialize managed attachments for v2 sessions #46175: feat(core): materialize managed attachments for v2 sessions
    • feat(core): materialize managed attachments for v2 sessions #46175
    • This is the base PR that PR feat(core): promote managed attachment media on first turn #46182 is stacked on (as mentioned in the description: "stacked on feat(core): materialize managed attachments for v2 sessions #46175")

This is intentional as per the PR description which states this is "PR 2 of the 3-PR plan" and only the top commit represents the current PR's diff, with the rest being #46175's base.

The searches also found PR #43314 about degrading undecodable image attachments, but this is addressing a different concern (error handling) rather than native media delivery.

No duplicate PRs found

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@safzanpirani safzanpirani mentioned this pull request Aug 29, 2026
feat(app): upload managed attachments before prompt submit #46185
Closed
3 of 6 tasks
@chrishalltu chrishalltu mentioned this pull request Sep 1, 2026
[FEATURE]: TUI should capture dropped/pasted files at drop time when the source path is ephemeral #46664
Open
2 tasks done
@github-actions

github-actions Bot commented Sep 29, 2026

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot closed this Sep 29, 2026
@github-actions github-actions Bot added the automated-pr-cleanup label Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

automated-pr-cleanup

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[FEATURE]: upload attachments to the server so agent tools can read them (managed per-session store)

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@safzanpirani
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.