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

Function newSession

go/session.go:362–378  ·  view source on GitHub ↗

newSession creates a new session wrapper with the given session ID and client.

(sessionID string, client *jsonrpc2.Client, workspacePath string)

Source from the content-addressed store, hash-verified

360
361// newSession creates a new session wrapper with the given session ID and client.
362func newSession(sessionID string, client *jsonrpc2.Client, workspacePath string) *Session {
363 s := &Session{
364 SessionID: sessionID,
365 workspacePath: workspacePath,
366 client: client,
367 clientSessionAPIs: &rpc.ClientSessionAPIHandlers{},
368 handlers: make([]sessionHandler, 0),
369 toolHandlers: make(map[string]ToolHandler),
370 commandHandlers: make(map[string]CommandHandler),
371 eventCh: make(chan SessionEvent, 128),
372 RPC: rpc.NewSessionRPC(client, sessionID),
373 }
374 s.clientSessionAPIs.Canvas = newCanvasClientSessionAdapter(s)
375 s.clientSessionAPIs.ProviderToken = newProviderTokenClientSessionAdapter(s)
376 go s.processEvents()
377 return s
378}
379
380// Send sends a message to this session and waits for the response.
381//

Callers 2

CreateSessionMethod · 0.85

Calls 3

processEventsMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…