-
Notifications
You must be signed in to change notification settings - Fork 667
Add ListSessions and DeleteSession methods to Go SDK #213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com>
Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com>
Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds session enumeration and deletion capabilities to the Go SDK, bringing it to feature parity with the Python and .NET SDKs. The implementation follows the existing patterns established in the Python SDK (PR #153) and maintains consistency with the Go SDK's conventions.
Changes:
- Added
SessionMetadatatype and related response types for session operations - Implemented
ListSessions()andDeleteSession()methods on the Client - Added comprehensive e2e tests matching Python SDK test coverage
- Updated README documentation with new API methods
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| go/types.go | Defines SessionMetadata and response types for session list/delete operations |
| go/client.go | Implements ListSessions() and DeleteSession() methods with auto-start support and error handling |
| go/e2e/session_test.go | Adds tests for listing and deleting sessions, following Python SDK test patterns |
| go/README.md | Documents the new ListSessions() and DeleteSession() API methods |
| test/package-lock.json | Empty package-lock.json file created accidentally without corresponding package.json |
| cookbook/go.sum | Go checksum file created without corresponding go.mod file |
Files not reviewed (1)
- test/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| "name": "test", | ||
| "lockfileVersion": 3, | ||
| "requires": true, | ||
| "packages": {} | ||
| } |
Copilot
AI
Jan 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file appears to have been created accidentally. There is no package.json file in the test/ directory, and the repository already has proper Node.js package management in test/harness/ with its own package.json and package-lock.json. This empty package-lock.json file should be removed.
| { | |
| "name": "test", | |
| "lockfileVersion": 3, | |
| "requires": true, | |
| "packages": {} | |
| } |
| // DeleteSessionRequest is the request for session.delete | ||
| type DeleteSessionRequest struct { | ||
| SessionID string `json:"sessionId"` | ||
| } | ||
|
|
Copilot
AI
Jan 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The DeleteSessionRequest type is defined but never used in the codebase. The DeleteSession method builds the request parameters inline at line 795-797 in client.go, which is consistent with other methods in the SDK. Consider removing this unused type definition to reduce code clutter, or use it in the DeleteSession implementation if it was intended for consistency with other request types.
| // DeleteSessionRequest is the request for session.delete | |
| type DeleteSessionRequest struct { | |
| SessionID string `json:"sessionId"` | |
| } |
The Go SDK was missing session enumeration and deletion capabilities that exist in Python and .NET SDKs.
Changes
SessionMetadatatype with fields for session ID, timestamps, summary, and remote statusListSessions()- Returns all sessions known to the server viasession.listRPCDeleteSession(sessionID)- Permanently deletes a session viasession.deleteRPC, removes from local session mapUsage
Implementation follows existing SDK patterns (marshal/unmarshal for RPC responses, auto-start support, error handling).
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
just.systems/usr/bin/curl curl --proto =https --tlsv1.2 -sSf https://just.systems/install.sh(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.