Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 26, 2026

The Go SDK was missing session enumeration and deletion capabilities that exist in Python and .NET SDKs.

Changes

  • Types: Added SessionMetadata type with fields for session ID, timestamps, summary, and remote status
  • Client methods:
    • ListSessions() - Returns all sessions known to the server via session.list RPC
    • DeleteSession(sessionID) - Permanently deletes a session via session.delete RPC, removes from local session map
  • Tests: Added e2e tests matching Python SDK test coverage
  • Documentation: Updated README with new API methods

Usage

// List all sessions
sessions, err := client.ListSessions()
if err != nil {
    log.Fatal(err)
}

for _, session := range sessions {
    fmt.Printf("Session: %s (modified: %s)\n", 
        session.SessionID, session.ModifiedTime)
}

// Delete a session
if err := client.DeleteSession("session-123"); err != nil {
    log.Fatal(err)
}

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
    • Triggering command: /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

This section details on the original issue you should resolve

<issue_title>ListSessions missing in the Go SDK</issue_title>
<issue_description>Similar to #143

Image</issue_description>

<agent_instructions>Similar to #153 you need to implement listSessions and deleteSessions in the golang sdk, you should also add tests for those methods, you can look at the python implementation. Make sure to run the tests, lint and format.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 26, 2026 21:46
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>
Copilot AI changed the title [WIP] Add listSessions and deleteSessions to Go SDK Add ListSessions and DeleteSession methods to Go SDK Jan 26, 2026
Copilot AI requested a review from friggeri January 26, 2026 21:53
@friggeri friggeri marked this pull request as ready for review January 26, 2026 22:10
@friggeri friggeri requested a review from a team as a code owner January 26, 2026 22:10
Copilot AI review requested due to automatic review settings January 26, 2026 22:10
@friggeri friggeri enabled auto-merge January 26, 2026 22:10
Copy link
Contributor

Copilot AI left a 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 SessionMetadata type and related response types for session operations
  • Implemented ListSessions() and DeleteSession() 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.

Comment on lines +1 to +6
{
"name": "test",
"lockfileVersion": 3,
"requires": true,
"packages": {}
}
Copy link

Copilot AI Jan 26, 2026

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.

Suggested change
{
"name": "test",
"lockfileVersion": 3,
"requires": true,
"packages": {}
}

Copilot uses AI. Check for mistakes.
Comment on lines +393 to +397
// DeleteSessionRequest is the request for session.delete
type DeleteSessionRequest struct {
SessionID string `json:"sessionId"`
}

Copy link

Copilot AI Jan 26, 2026

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.

Suggested change
// DeleteSessionRequest is the request for session.delete
type DeleteSessionRequest struct {
SessionID string `json:"sessionId"`
}

Copilot uses AI. Check for mistakes.
@friggeri friggeri added this pull request to the merge queue Jan 27, 2026
Merged via the queue into main with commit d51def4 Jan 27, 2026
33 checks passed
@friggeri friggeri deleted the copilot/add-list-sessions-method branch January 27, 2026 00:43
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.

ListSessions missing in the Go SDK

3 participants