Repository navigation
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
Hi,
When working on a small repo, opencode is stuck after i get a notification "bufio.Scanner: token too long"
After that it's stuck on "Generating..."
in the logs i see:
ERROR 2025-10-24T12:46:16 +40ms service=tui error=bufio.Scanner: token too long Error streaming events
INFO 2025-10-24T12:46:16 +43ms service=snapshot hash=1a759a0149a0c3129b2cc0c5c0bd1da90352e796
cwd=/Users/antmarqu3/workspace-perso/qa-gitlab git=/Users/antmarqu3/.local/share/opencode/snapshot/d07b7ad4b93274723e8059e42f36a2fca2e70f17 tracking
INFO 2025-10-24T12:46:16 +1ms service=bus type=message.part.updated publishing
INFO 2025-10-24T12:46:16 +0ms service=session.prompt session=ses_5e9bf06d4ffeCJMWSIdbfCDK7v type=reasoning-start part
INFO 2025-10-24T12:46:16 +5ms service=session.prompt session=ses_5e9bf06d4ffeCJMWSIdbfCDK7v type=reasoning-delta part
INFO 2025-10-24T12:46:16 +2ms service=bus type=message.part.updated publishing
INFO 2025-10-24T12:46:16 +0ms service=session.prompt session=ses_5e9bf06d4ffeCJMWSIdbfCDK7v type=reasoning-delta part
INFO 2025-10-24T12:46:16 +0ms service=bus type=message.part.updated publishing
INFO 2025-10-24T12:46:16 +0ms service=session.prompt session=ses_5e9bf06d4ffeCJMWSIdbfCDK7v type=reasoning-delta part
INFO 2025-10-24T12:46:16 +1ms service=bus type=message.part.updated publishing
INFO 2025-10-24T12:46:16 +0ms service=session.prompt session=ses_5e9bf06d4ffeCJMWSIdbfCDK7v type=reasoning-delta part
INFO 2025-10-24T12:46:16 +0ms service=bus type=message.part.updated publishing
INFO 2025-10-24T12:46:16 +0ms service=session.prompt session=ses_5e9bf06d4ffeCJMWSIdbfCDK7v type=reasoning-delta part
INFO 2025-10-24T12:46:16 +0ms service=bus type=message.part.updated publishing
INFO 2025-10-24T12:46:16 +0ms service=session.prompt session=ses_5e9bf06d4ffeCJMWSIdbfCDK7v type=reasoning-delta part
OpenCode version
No response
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
Reacted by Mel Massadian, Aleksa Radovic, Taylor Ninesling, antoinejs and Jeremy Forest
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
github-actions commentedon Oct 24, 2025
This issue might be a duplicate of existing issues. Please check:
Generating#2137: Message generation interrupted, stuck atGenerating- similar stuck behavior during generationFeel free to ignore if none of these address your specific case.
rekram1-node commentedon Oct 24, 2025
Hm that's interesting. This will be fixed very soon because all the go code is about to die
melMass commentedon Oct 26, 2025
@rekram1-node is there anything to do? This is among a lot of things that currently stale whole sessions (exiting/resuming it doesn't work)
melMass commentedon Oct 26, 2025
It's actually sneaky.. It does run the request/edit file if in edit mode. The UI is just stuck, queued message are also ran, but the UI is "stuck" (only seing my messages stacking up), exiting opencode and going back to the same session I can see the answers/tool calls
Panic Stack on exit:
here
rekram1-node commentedon Oct 26, 2025
what version are you on?
melMass commentedon Oct 26, 2025
latest: 0.15.18 on linux and macos
rekram1-node commentedon Oct 26, 2025
hm okay Ill try to find cause so we can fix it
yudgnahk commentedon Oct 28, 2025
Hi @rekram1-node,
I already tried and made a PR to fix this bug.
I hope you can review my PR. Thanks!
rekram1-node commentedon Oct 28, 2025
I checked it out, unfortunately editing the sdk directly wont' work since it is auto generated
ShadowArcanist commentedon Oct 29, 2025
I am also experiencing the same issue on opencode v0.15.23 (macOS 13.7.8 (22H730))
rekram1-node commentedon Oct 30, 2025
should be fixed by: #3531
Will be in next release
benceferdinandy-signifyd commentedon Nov 27, 2025
I had a similar error "prompt is too long: 218083 tokens > 200000 maximum" but I think this is from Anthropic? Yet opencode stops completely instead of trying to resolve
benceferdinandy-signifyd commentedon Nov 27, 2025
it's not possible to recover from here it seems
rekram1-node commentedon Dec 1, 2025
You can "recover" using /undo one or more times but we will fix this in a better way
[-]Opencode stuck after token too long[/-][+]bufio.Scanner: token too long[/+]rekram1-node commentedon Dec 1, 2025
Also @benceferdinandy-signifyd this is about an error w/ bufio, not prompt lengths this was a scanner thingy.
Closing as done since we don't have Go as a dep anymore