You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Valid PDF tool results can be forwarded to models without PDF input support #21908
A valid PDF can be attached by read.ts, then forwarded back into model context from MessageV2.toModelMessagesEffect() even when the selected model does not support input.pdf. In the failing session, that led to a bogus The file you uploaded is badly formatted or corrupted verdict on a healthy PDF.
Important context: this session was running with the Oh My OpenAgent plugin enabled. The repeated OH-MY-OPENCODE - TODO CONTINUATION / continuation-style spam should therefore be treated as plugin-influenced behavior, not as a pure OpenCode core symptom by itself. The core issue I am reporting here is the incorrect PDF handling path, not the plugin-layer session spam.
The same file later read successfully and hashes as a healthy PDF:
Current upstream packages/opencode/src/tool/read.ts does not parse PDFs into text; it returns PDF read successfully plus a PDF attachment. The risky step is later, when packages/opencode/src/session/message-v2.ts forwards completed tool-result attachments without checking model.capabilities.input.pdf.
Plugins
Oh My OpenAgent plugin enabled
OpenCode version
dev branch (observed against local clone bf601628db3c187478ff853fe33b91cec652355e)
Steps to reproduce
Start a session with a model that does not support PDF input.
Run the read tool on a valid PDF so the tool result contains PDF read successfully plus a PDF attachment.
Let the session continue so MessageV2.toModelMessagesEffect() rebuilds model messages from the stored tool result.
Observe that the PDF attachment can be forwarded back into model context even though the model does not support input.pdf.
In the failing plugin-augmented session I inspected (ses_28910d89cffepa6F6x95rQ8dmb), that produced: The file you uploaded is badly formatted or corrupted. Please fix the file and try again.
Screenshot and/or share link
No share link. Relevant failing session: ses_28910d89cffepa6F6x95rQ8dmb
The issue does not use one of the required issue templates (Bug Report, Feature Request, or Question). Please resubmit using the Bug Report template, which requires filling in the designated fields (e.g., Description, Steps to Reproduce, etc.).
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
If you believe this was flagged incorrectly, please let a maintainer know.
Additional evidence from the affected session (ses_28910d89cffepa6F6x95rQ8dmb) that it became effectively unable to continue meaningful work:
This session was running with the Oh My OpenAgent plugin enabled, so the final continuation spam should be treated as plugin-influenced behavior.
The session did not end with normal assistant progress or a stable completion state. Near the end, it received repeated plugin/system continuation injections instead:
2026-04-10T15:59:56.324Z: [SYSTEM DIRECTIVE: OH-MY-OPENCODE - TODO CONTINUATION]
2026-04-10T16:00:27.839Z: [SYSTEM DIRECTIVE: OH-MY-OPENCODE - TODO CONTINUATION]
Both late injections repeated the same directive:
Incomplete tasks remain in your todo list. Continue working on the next pending task.
The last recoverable exported work state still showed unfinished work rather than convergence:
=== Todos ===
[x] [completed] Inspect the current CV contact block markup and print styling
[x] [completed] Implement the homepage-style grouped phone/WhatsApp rows in the CV header
[-] [in_progress] Build and verify the CV page and exported PDF layout
Session metadata also shows this was a long, degraded run rather than a quick isolated failure:
341 messages
988 transcript entries
duration from 2026-04-10T10:27:58.023Z to 2026-04-10T16:00:27.875Z
So the strongest conclusion is:
the false PDF/capability mismatch still looks like the most plausible OpenCode-core bug being fixed by this PR
the session becoming unable to continue further is supported by evidence, but that terminal looping behavior appears to be plugin-influenced rather than something I can confidently attribute to OpenCode core alone
I’m adding this here because the practical user-visible failure was not just the bad PDF verdict — it was that after enough state churn, the session stopped making meaningful forward progress and collapsed into repeated continuation directives.
Activity
github-actions commentedon Apr 10, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
If you believe this was flagged incorrectly, please let a maintainer know.
github-actions commentedon Apr 10, 2026
Thanks for updating the issue - it now meets the contributing guidelines. The
needs:compliancelabel has been removed.rekram1-node commentedon Apr 10, 2026
The pdf results are actually dropped already, see
We can change the tool to say something other than success tho.
50sotero commentedon Apr 10, 2026
@rekram1-node the problem is after an error like this occurs, the session is blocked from progressing further
50sotero commentedon Apr 10, 2026
Additional evidence from the affected session (
ses_28910d89cffepa6F6x95rQ8dmb) that it became effectively unable to continue meaningful work:2026-04-10T15:59:56.324Z:[SYSTEM DIRECTIVE: OH-MY-OPENCODE - TODO CONTINUATION]2026-04-10T16:00:27.839Z:[SYSTEM DIRECTIVE: OH-MY-OPENCODE - TODO CONTINUATION]Incomplete tasks remain in your todo list. Continue working on the next pending task.=== Todos ===[x] [completed] Inspect the current CV contact block markup and print styling[x] [completed] Implement the homepage-style grouped phone/WhatsApp rows in the CV header[-] [in_progress] Build and verify the CV page and exported PDF layout341 messages988 transcript entries2026-04-10T10:27:58.023Zto2026-04-10T16:00:27.875ZSo the strongest conclusion is:
I’m adding this here because the practical user-visible failure was not just the bad PDF verdict — it was that after enough state churn, the session stopped making meaningful forward progress and collapsed into repeated continuation directives.
shaked8634 commentedon Jun 28, 2026
I had the same error and ended with the same result where the session was stuck.
The reason was that the PDF files were encrypted.
I managed to recover the session by removing the last history messages.
github-actions commentedon Aug 28, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.