bug: session gets trashed if binary file is opened #992

Closed
opened 2026-02-16 17:29:02 -05:00 by yindo · 7 comments
Owner

Originally created by @rekram1-node on GitHub (Jul 30, 2025).

Image

Going to make PR with fix shortly

Originally created by @rekram1-node on GitHub (Jul 30, 2025). <img width="2273" height="694" alt="Image" src="https://github.com/user-attachments/assets/6c0860cc-4611-445b-a59c-5a0563dc6a78" /> Going to make PR with fix shortly
yindo closed this issue 2026-02-16 17:29:02 -05:00
Author
Owner

@rekram1-node commented on GitHub (Jul 30, 2025):

opened basic fix following pattern used for image read

@rekram1-node commented on GitHub (Jul 30, 2025): opened basic fix following pattern used for image read
Author
Owner

@achembarpu commented on GitHub (Jul 31, 2025):

Hi @rekram1-node - I see your fix is merged and released in v0.3.85 acc to the changelog - but I'm still facing this issue in v0.3.93.

refer: Terminal UI Corruption & Prompt Overage due to fetched PDFs

@achembarpu commented on GitHub (Jul 31, 2025): Hi @rekram1-node - I see your fix is merged and released in [v0.3.85](https://github.com/sst/opencode/releases/tag/v0.3.85) acc to the changelog - but I'm still facing this issue in [v0.3.93](https://github.com/sst/opencode/releases/tag/v0.3.93). refer: [Terminal UI Corruption & Prompt Overage due to fetched PDFs](https://github.com/sst/opencode/issues/1423)
Author
Owner

@rekram1-node commented on GitHub (Jul 31, 2025):

yes @achembarpu my change does not work for pdfs that will require a separate solution, I think ideally we make something more generic that can check if we are reading a text file and also prevent hugeeee files from entering context if they are binary so that at least you could keep using session.

I can take a look at your issue but yeah, the fix I made addressed a different but related problem

@rekram1-node commented on GitHub (Jul 31, 2025): yes @achembarpu my change does not work for pdfs that will require a separate solution, I think ideally we make something more generic that can check if we are reading a text file and also prevent hugeeee files from entering context if they are binary so that at least you could keep using session. I can take a look at your issue but yeah, the fix I made addressed a different but related problem
Author
Owner

@zippeurfou commented on GitHub (Oct 2, 2025):

@rekram1-node did this ever get fixed for pdf or did you find a workaround?

@zippeurfou commented on GitHub (Oct 2, 2025): @rekram1-node did this ever get fixed for pdf or did you find a workaround?
Author
Owner

@rekram1-node commented on GitHub (Oct 2, 2025):

@zippeurfou I think it should be fixed for pdfs is it not?

@rekram1-node commented on GitHub (Oct 2, 2025): @zippeurfou I think it should be fixed for pdfs is it not?
Author
Owner

@zippeurfou commented on GitHub (Oct 2, 2025):

It is still there sadly:


Task[papers] Analyze AdaF2M paper weighting approach

∟ Fetch https://arxiv.org/pdf/2501.15816 (format=markdown)

ctrl+right, ctrl+left navigate child sessions

Let me try fetching the paper directly:
Plan anthropic.claude-sonnet-4-5-20250929-v1:0 (04:10 PM)

Fetch https://arxiv.org/pdf/2501.15816 (format=markdown)

%PDF-1.5 %� 2 0 obj << /Filter /FlateDecode /Length 586 >> stream x�mTˎ�0��+�$���$0�� ����� �a#A%��߯����jD�岻��f��c;Z����̫����MfG��}�
q�]/��ޭ�mޯ�o⣩����0Z���^�x]f�kn{��E+{ʧy�pg�6;5�P���V��pH8$h��
@zippeurfou commented on GitHub (Oct 2, 2025): It is still there sadly: ``` Task[papers] Analyze AdaF2M paper weighting approach ∟ Fetch https://arxiv.org/pdf/2501.15816 (format=markdown) ctrl+right, ctrl+left navigate child sessions Let me try fetching the paper directly: Plan anthropic.claude-sonnet-4-5-20250929-v1:0 (04:10 PM) Fetch https://arxiv.org/pdf/2501.15816 (format=markdown) %PDF-1.5 %� 2 0 obj << /Filter /FlateDecode /Length 586 >> stream x�mTˎ�0��+�$���$0�� ����� �a#A%��߯����jD�岻��f��c;Z����̫����MfG��}� q�]/��ޭ�mޯ�o⣩����0Z���^�x]f�kn{��E+{ʧy�pg�6;5�P���V��pH8$h�� ```
Author
Owner

@rekram1-node commented on GitHub (Oct 2, 2025):

@zippeurfou ahh that's for webfetch not read tool, separate issue but we should fix that too

@rekram1-node commented on GitHub (Oct 2, 2025): @zippeurfou ahh that's for webfetch not read tool, separate issue but we should fix that too
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#992