/session/status always empty #3997

Closed
opened 2026-02-16 17:42:14 -05:00 by yindo · 4 comments
Owner

Originally created by @fcrisafulli-dev on GitHub (Dec 30, 2025).

Originally assigned to: @thdxr on GitHub.

Description

after updating to version opencode-ai@1.0.213 /session/status no longer returns any information for any active or inactive sessions.

OpenCode version

1.0.213

Steps to reproduce

  • start a long running task, I tested with "create a bash file that sleeps for 100 seconds and prints hello world at the end and run the file"
  • GET /session/status

my response is always an empty dictionary {}

Screenshot and/or share link

Image

Operating System

Windows 11

Terminal

Windows Terminal

Originally created by @fcrisafulli-dev on GitHub (Dec 30, 2025). Originally assigned to: @thdxr on GitHub. ### Description after updating to version opencode-ai@1.0.213 `/session/status` no longer returns any information for any active or inactive sessions. ### OpenCode version 1.0.213 ### Steps to reproduce - start a long running task, I tested with "create a bash file that sleeps for 100 seconds and prints hello world at the end and run the file" - GET /session/status my response is always an empty dictionary `{}` ### Screenshot and/or share link <img width="1762" height="255" alt="Image" src="https://github.com/user-attachments/assets/41ec52d0-6db3-413a-abd4-5ffee2b665e2" /> ### Operating System Windows 11 ### Terminal Windows Terminal
yindo added the windowsbug labels 2026-02-16 17:42:14 -05:00
yindo closed this issue 2026-02-16 17:42:14 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 30, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #3026: /sessions shows empty despite sessions existing in storage (v0.14.6)

This is a similar API-related issue where session endpoints returned empty responses. Feel free to ignore if this doesn't address your specific case.

@github-actions[bot] commented on GitHub (Dec 30, 2025): This issue might be a duplicate of existing issues. Please check: - #3026: /sessions shows empty despite sessions existing in storage (v0.14.6) This is a similar API-related issue where session endpoints returned empty responses. Feel free to ignore if this doesn't address your specific case.
Author
Owner

@fcrisafulli-dev commented on GitHub (Dec 30, 2025):

Update: I did some more digging; it seems that to reproduce what I'm running into you need to also set the directory query key when creating a new session via the api/sdk.

works as expected:

const client = createOpencodeClient({
  baseUrl: "http://localhost:8005",
});
const session = await client.session.create();

/session/status will always be blank if a session is created like below

const client = createOpencodeClient({
  baseUrl: "http://localhost:8005",
});
const session = await client.session.create({
   query: {
     directory: "/workspace/project1",
   },
});
@fcrisafulli-dev commented on GitHub (Dec 30, 2025): Update: I did some more digging; it seems that to reproduce what I'm running into you need to also set the `directory` query key when creating a new session via the api/sdk. works as expected: ```ts const client = createOpencodeClient({ baseUrl: "http://localhost:8005", }); const session = await client.session.create(); ``` /session/status will always be blank if a session is created like below ```ts const client = createOpencodeClient({ baseUrl: "http://localhost:8005", }); const session = await client.session.create({ query: { directory: "/workspace/project1", }, }); ```
Author
Owner

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

Yeah this is expected, the server boots up as global, sessions arent necessarily global.

Also there is no sessionid param needed or accepted

@rekram1-node commented on GitHub (Dec 30, 2025): Yeah this is expected, the server boots up as global, sessions arent necessarily global. Also there is no sessionid param needed or accepted
Author
Owner

@TomCC7 commented on GitHub (Feb 16, 2026):

A clarification to later visitors:

  1. only sessions attaching to this server will appear in the result
  2. idle status gets automatically removed from the list

So to retrieve value from the API, the simplest test is to create a session that attach to the server using opencode attach <server-url> (or create from webui) and let agent start doing stuff, then query /session/status.

@TomCC7 commented on GitHub (Feb 16, 2026): A clarification to later visitors: 1. only sessions attaching to this server will appear in the result 2. idle status gets automatically removed from the list So to retrieve value from the API, the simplest test is to create a session that attach to the server using `opencode attach <server-url>` (or create from webui) and let agent start doing stuff, then query `/session/status`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3997