opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Session is Busy Error Message

Open captjt opened this issue 1 year ago • 13 comments

While working in a long session, I get an error that says "Error: Session session_id is busy", but my chat is not "working..." and I can still run /compact on the session. I assume there is a mechanism that isn't quite updating that the session is actually unlocked now. Here are some logs and a screenshot that might be useful. This is on a Mac, but if there are any other things that might help reproduce this please let me know -- I can add more details.

Image
INFO  2025-07-08T14:44:33 +0ms service=session sessionID=ses_815a2734cfferqJAknKIO6uGQ6 unlocking
INFO  2025-07-08T14:44:33 +0ms service=bus type=session.idle publishing
INFO  2025-07-08T14:44:33 +0ms service=server duration=20443 response
INFO  2025-07-08T14:44:41 +7942ms service=server method=GET path=/find/file request
INFO  2025-07-08T14:44:41 +33ms service=server duration=32 response
INFO  2025-07-08T14:44:41 +179ms service=server method=GET path=/find/file request
INFO  2025-07-08T14:44:41 +12ms service=server duration=12 response
INFO  2025-07-08T14:44:41 +5ms service=server method=GET path=/find/file request
INFO  2025-07-08T14:44:41 +17ms service=server duration=16 response
INFO  2025-07-08T14:44:42 +104ms service=server method=GET path=/find/file request
INFO  2025-07-08T14:44:42 +10ms service=server duration=10 response
INFO  2025-07-08T14:44:42 +50ms service=server method=GET path=/find/file request
INFO  2025-07-08T14:44:42 +10ms service=server duration=9 response
INFO  2025-07-08T14:44:42 +51ms service=server method=GET path=/find/file request
INFO  2025-07-08T14:44:42 +8ms service=server duration=8 response
INFO  2025-07-08T14:44:42 +197ms service=server method=GET path=/find/file request
INFO  2025-07-08T14:44:42 +11ms service=server duration=11 response
INFO  2025-07-08T14:44:42 +35ms service=server method=GET path=/find/file request
INFO  2025-07-08T14:44:42 +10ms service=server duration=9 response
INFO  2025-07-08T14:44:44 +1654ms service=server method=POST path=/session/ses_815a2734cfferqJAknKIO6uGQ6/message request
INFO  2025-07-08T14:44:44 +0ms service=session sessionID=ses_815a2734cfferqJAknKIO6uGQ6 locking
INFO  2025-07-08T14:44:44 +0ms service=session session=ses_815a2734cfferqJAknKIO6uGQ6 chatting
INFO  2025-07-08T14:44:44 +4ms service=session sessionID=ses_815a2734cfferqJAknKIO6uGQ6 locking
INFO  2025-07-08T14:44:44 +0ms service=session sessionID=ses_815a2734cfferqJAknKIO6uGQ6 unlocking
INFO  2025-07-08T14:44:44 +1ms service=bus type=session.idle publishing
INFO  2025-07-08T14:44:44 +0ms service=server duration=5 response
INFO  2025-07-08T14:44:58 +14312ms service=bus type=* unsubscribing
INFO  2025-07-08T14:44:58 +0ms service=server event disconnected
INFO  2025-07-08T14:44:58 +3ms service=app name=lsp shutdown
INFO  2025-07-08T14:44:58 +0ms service=lsp.client serverID=golang shutting down
INFO  2025-07-08T14:44:58 +0ms service=lsp.client serverID=golang shutdown
INFO  2025-07-08T14:44:58 +0ms service=app name=file.watcher shutdown
INFO  2025-07-08T14:44:58 +0ms service=app name=session shutdown

captjt avatar Jul 08 '25 14:07 captjt

same

MendyLanda avatar Jul 08 '25 18:07 MendyLanda

Same:

 failed to send message: POST                       
 "http://127.0.0.1:59808/session/ses_81edb10f7ffedc 
 vbJvp8MW4xrJ/message": 400 Bad Request             
 {"name":"UnknownError","data":{"message":"Error:   
 Session ses_81edb10f7ffedcvbJvp8MW4xrJ is busy"}}  

No further messages are sending. I've restarted opencode, using v0.2.13

simon-marcus avatar Jul 09 '25 03:07 simon-marcus

Yep, same here

adambuchweitz avatar Jul 09 '25 13:07 adambuchweitz

Same here, sharing in case it's useful.

  • Long session
  • Still see the error after existing and starting opencode again
Image

luqven avatar Jul 09 '25 21:07 luqven

same error here, I've gotten this message during multiple sessions today. v0.2.6 ... generally pops up after long sessions, but it happens regardless of how long its been since my last message -- I'm not trying to ask questions while a response is being generated.

Image

reedbender avatar Jul 10 '25 00:07 reedbender

Generally resolved with /new , but session context is lost

reedbender avatar Jul 10 '25 00:07 reedbender

I wonder if this has anything to do with this open issue...? Any chance the session isn't actually being released in some instances, leading to a memory leak? https://github.com/sst/opencode/issues/804#issue-3216651391

reedbender avatar Jul 10 '25 00:07 reedbender

Got the same on 0.2.18, claude-opus-4-20250514. Noticed it in two sessions, both were long, certainly at more than 60% context.

almirsarajcic avatar Jul 10 '25 10:07 almirsarajcic

fixed in v0.2.19

thdxr avatar Jul 10 '25 11:07 thdxr

Unfortunately, I still see this when I'm trying to add a message to the queue.

Btw., I can't interrupt it while it's working - that's why I even tried to queue up a message. But I get that "session is busy" message, and I have to wait for it to finish the work it's doing until I can continue prompting.

I'm on version 0.2.20.

almirsarajcic avatar Jul 10 '25 13:07 almirsarajcic

v0.2.27 — also can't queue a message while it's working (sonnet 3.7 via bedrock)

markjaquith avatar Jul 11 '25 16:07 markjaquith

Should I create a new issue for this? I can't add a message to the queue.

If there's no ability to queue messages (or an intent to support that feature), maybe we should be forced to interrupt the session before being able to type into the textarea.

I'm on version 0.3.18, Claude Sonnet 4.

almirsarajcic avatar Jul 17 '25 19:07 almirsarajcic

we're going to add queueing, just haven't gotten to it yet

adamdotdevin avatar Jul 17 '25 21:07 adamdotdevin