fix(opencode): expose single session status endpoint#29165
Open
wccyzxy wants to merge 1 commit into
Open
Conversation
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.
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #29166
Type of change
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/statusendpoint 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/statusthat calls that existingget()method directly. It follows the same pattern as other single-session endpoints likeGET /session/:sessionID/todo— validate session existence withrequireSession(), then delegate to the service.Two files changed:
groups/session.ts— added route path and endpoint definitionhandlers/session.ts— added handler + registered in chainHow did you verify your code works?
Ran
opencode servelocally 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