Skip to content

fix(ai): prevent unsupported tool files from breaking Chat sessions - #52517

Closed
vladislav-miroshnikov wants to merge 1 commit into
anomalyco:devfrom
vladislav-miroshnikov:mcp-binary-replay
Closed

vladislav-miroshnikov wants to merge 1 commit into
anomalyco:devfrom
vladislav-miroshnikov:mcp-binary-replay

Conversation

@vladislav-miroshnikov

@vladislav-miroshnikov vladislav-miroshnikov commented Oct 1, 2026 •

Copy link
Copy Markdown

Issue for this PR

Follow-up to #52448

Type of change

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

What does this PR do?

An unsupported file returned by a tool could make every later OpenAI Chat request fail when replaying the history.

The adapter now sends an omission note with the filename and MIME type. The file stays in the stored history. Tool text, images, PDFs, videos and user-media validation keep their existing handling.

#57640 filters new unsupported MCP attachments, but leaves existing history alone. Plugins can still return these files, so the replay fix is still needed.

How did you verify your code works?

Local checks on d0732ea:

  • Three regressions fail before the fix and pass afterward: Parquet, unnamed CSV and mixed PNG/PDF/CSV results.
  • Chat tests: 81 passed. Full AI suite: 1,814 passed, 28 skipped.
  • AI typechecks, root check and Effect checks pass.

The reporter's MCP server and new live-provider calls were not run.

Screenshots / recordings

Not applicable.

Checklist

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

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

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

@vladislav-miroshnikov vladislav-miroshnikov changed the title fix(ai): tolerate unsupported files in Chat tool results fix(ai): prevent unsupported tool files from breaking Chat sessions Oct 1, 2026
@vladislav-miroshnikov

Copy link
Copy Markdown
Author

hey @rekram1-node, I reproduced #52448 in the Chat request compiler with Parquet and CSV tool results. When an unsupported file is in chat history, every follow-up fails before reaching the API. This fix keeps the attachment in history and sends Chat an omission note instead, so the session can continue.

I also checked the compiled Parquet request and a follow-up against openai api platform with gpt-5.4 and gpt-6.1-sol, both models handled them successfully.

Could you take a look at this for v2, please?

@vladislav-miroshnikov

Copy link
Copy Markdown
Author

Added replay coverage for Parquet, unnamed CSV and mixed PNG/PDF/CSV results. Unsupported Chat tool files now produce an omission note while preserving the stored history.

@github-actions

github-actions Bot commented Nov 1, 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.

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