Skip to content

fix(opencode): expose single session status endpoint#29165

Open
wccyzxy wants to merge 1 commit into
anomalyco:devfrom
wccyzxy:fix/session-status-endpoint
Open

fix(opencode): expose single session status endpoint#29165
wccyzxy wants to merge 1 commit into
anomalyco:devfrom
wccyzxy:fix/session-status-endpoint

Conversation

@wccyzxy
Copy link
Copy Markdown

@wccyzxy wccyzxy commented May 25, 2026

Issue for this PR

Closes #29166

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The session status service already had a get(sessionID) method for querying a single session's runtime status (idle/busy/retry), but it was only wired up to the bulk /session/status endpoint which returns all non-idle statuses as a record. If you needed just one session status you had to fetch the entire list and filter client-side.

This PR adds GET /session/:sessionID/status that calls that existing get() method directly. It follows the same pattern as other single-session endpoints like GET /session/:sessionID/todo — validate session existence with requireSession(), then delegate to the service.
Two files changed:

  • groups/session.ts — added route path and endpoint definition
  • handlers/session.ts — added handler + registered in chain

How did you verify your code works?

Ran opencode serve locally and hit the endpoint against a known session ID. Returns { "type": "idle" } for inactive sessions and the correct busy/retry state for active ones.

Screenshots / recordings

N/A, backend-only change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Add GET /session/:sessionID/status HTTP endpoint to query individual
session runtime status (idle/busy/retry).

The SessionStatus.Service.get() method already existed but was not
exposed via HTTP API. Previously only a bulk /session/status endpoint
was available, requiring clients to filter the full status map.
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels May 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label May 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Session status service has get() method but no single-session HTTP endpoint

1 participant