Skip to content

/session/status always empty #6447

Closed
Closed

Description

@fcrisafulli-dev

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

Activity

  1. github-actions commented on Dec 30, 2025

    @github-actions
    Contributor

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

    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.

  2. fcrisafulli-dev commented on Dec 30, 2025

    @fcrisafulli-dev
    Author

    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",
       },
    });
  3. rekram1-node commented on Dec 30, 2025

    @rekram1-node
    Contributor

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

    Also there is no sessionid param needed or accepted

  4. TomCC7 commented on Feb 16, 2026

    @TomCC7

    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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwindows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions