MCPcopy Index your code
hub / github.com/github/copilot-sdk / GetEvents

Method GetEvents

go/session.go:1620–1632  ·  view source on GitHub ↗

GetEvents retrieves all events from this session's history. This returns the complete conversation history including user messages, assistant responses, tool executions, and other session events in chronological order. Returns an error if the session has been disconnected or the connection fails.

(ctx context.Context)

Source from the content-addressed store, hash-verified

1618// }
1619// }
1620func (s *Session) GetEvents(ctx context.Context) ([]SessionEvent, error) {
1621
1622 result, err := s.client.Request(ctx, "session.getMessages", sessionGetMessagesRequest{SessionID: s.SessionID})
1623 if err != nil {
1624 return nil, fmt.Errorf("failed to get events: %w", err)
1625 }
1626
1627 var response sessionGetMessagesResponse
1628 if err := json.Unmarshal(result, &response); err != nil {
1629 return nil, fmt.Errorf("failed to unmarshal get events response: %w", err)
1630 }
1631 return response.Events, nil
1632}
1633
1634// Disconnect closes this session and releases all in-memory resources (event
1635// handlers, tool handlers, permission handlers).

Callers 14

TestPendingWorkResumeE2EFunction · 0.80
TestSessionFSE2EFunction · 0.80
TestRPCSessionStateE2EFunction · 0.80
waitForFleetCompletionFunction · 0.80
TestEventFidelityE2EFunction · 0.80
TestSessionE2EFunction · 0.80
lastUserAttachmentFunction · 0.80
TestStreamingFidelityE2EFunction · 0.80

Calls 1

RequestMethod · 0.45

Tested by 13

TestPendingWorkResumeE2EFunction · 0.64
TestSessionFSE2EFunction · 0.64
TestRPCSessionStateE2EFunction · 0.64
waitForFleetCompletionFunction · 0.64
TestEventFidelityE2EFunction · 0.64
TestSessionE2EFunction · 0.64
lastUserAttachmentFunction · 0.64
TestStreamingFidelityE2EFunction · 0.64