Repository navigation
Description
Description
Description
I used OpenCode Desktop 1.18.25 with DeepSeek-V4-Flash-0731 for a bounded engineering task: creating and validating a production-oriented ICU Antibiotic Stewardship Excel workbook.
The task required generating an XLSX workbook with multiple relational sheets, formulas, validation rules, conditional formatting, dashboards/worklists, demo data, and automated validation/testing.
The model initially generated a substantial workbook and performed multiple iterations of testing and debugging. However, the session became extremely long and consumed 21,955,093 tokens according to the token provider's usage dashboard.
Despite extensive iterative debugging, the requested final workbook was not successfully delivered.
Environment
- OpenCode Desktop: 1.18.25
- OS: Windows 11
- Model: DeepSeek-V4-Flash-0731
- Project:
workbook-icu-excel
Observed behavior
The model repeatedly entered long generate → test → diagnose → modify → retest cycles.
During debugging, the following was established:
-
The generated XLSX was a valid ZIP/OOXML package and could be read by
openpyxl. -
Excel COM validation initially failed to open the workbook.
-
A bisect process isolated one failure to Data Validation in the
Antibiotic Therapysheet. -
The model replaced cross-sheet Data Validation references with workbook-level Named Ranges.
-
The targeted Data Validation test then passed.
-
Full workbook validation still failed.
-
A further bisect showed that the first 10 data sheets opened successfully in Excel COM.
-
The remaining failure was narrowed to one of:
Alerts-FlagsDashboardWorklistInstructions
-
The session was stopped before the remaining failure was isolated and the final workbook was delivered.
Impact
The task was bounded and had a clearly defined deliverable, but the agent consumed:
21,955,093 tokens (~21.96M)
without reaching a completed final artifact.
This is particularly concerning because the model demonstrated meaningful debugging progress, including successfully isolating and fixing one Excel compatibility problem, but continued execution did not converge to a completed result.
Related OpenCode reports
This appears potentially related to existing DeepSeek-V4-Flash issues involving repetition, looping, or excessive token consumption:
- deepseek flash v4 (opencode go) is broken. #43146 — DeepSeek V4 Flash enters an endless reply loop.
- bug or repetative tests using up tokens #43661 — DeepSeek V4 Flash repeatedly generates code and consumes tokens.
- Manual /compact with DeepSeek V4 Flash degenerates into thousands of repeated lines #41801 — DeepSeek V4 Flash enters a severe repetition loop during compaction.
The current report differs in that the failure occurred during a substantial multi-step engineering task involving tool calls, file generation, Excel validation, and iterative debugging.
Evidence
OpenCode shared session:
https://opncd.ai/share/aHlGUPVV
The complete OpenCode session was also exported as JSON.
Token usage:
21,955,093 tokens
according to the token provider's usage dashboard.
Expected behavior
For a bounded engineering task, the agent should either:
- complete the requested artifact and validate it successfully, or
- detect that progress is no longer converging and stop with a clear failure state.
It should not consume tens of millions of tokens through prolonged iterative execution without completing the task.
Request
Please investigate whether this behavior is related to the known DeepSeek-V4-Flash repetition/looping issues in OpenCode, particularly when the model is performing long-running tool-assisted engineering tasks.
I would also like to know whether OpenCode has any safeguards for detecting non-convergent agent behavior, excessive repeated tool execution, or unusually high token consumption.
Plugins
No response
OpenCode version
No response
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
Activity
github-actions commentedon Sep 4, 2026
This issue might be a duplicate of, or closely related to, existing open issues. Please check:
These share the same core symptom: no convergence detection or circuit breaker to halt runaway agent execution before excessive token consumption occurs.
thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊