MCPcopy
hub / github.com/kagent-dev/kagent / createSession

Method createSession

go/core/cli/internal/tui/workspace.go:176–187  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

174}
175
176func (m *workspaceModel) createSession(name string) tea.Cmd {
177 return func() tea.Msg {
178 res, err := m.client.Session.CreateSession(context.Background(), &api.SessionRequest{
179 Name: new(name),
180 AgentRef: new(m.agentRef),
181 })
182 if err != nil {
183 return createSessionMsg{session: nil, err: err}
184 }
185 return createSessionMsg{session: res.Data, err: nil}
186 }
187}
188
189func (m *workspaceModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
190 // Forward to dialog manager first; if a dialog is open, it captures input

Callers 2

UpdateMethod · 0.95

Calls 1

CreateSessionMethod · 0.65

Tested by 1