MCPcopy Index your code
hub / github.com/docker/docker-agent / getSession

Method getSession

pkg/server/server.go:277–294  ·  view source on GitHub ↗
(c echo.Context)

Source from the content-addressed store, hash-verified

275}
276
277func (s *Server) getSession(c echo.Context) error {
278 sess, err := s.sm.GetSession(c.Request().Context(), c.Param("id"))
279 if err != nil {
280 return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("session not found: %v", err))
281 }
282
283 return c.JSON(http.StatusOK, api.SessionResponse{
284 ID: sess.ID,
285 Title: sess.Title,
286 CreatedAt: sess.CreatedAt,
287 Messages: sess.GetAllMessages(),
288 ToolsApproved: sess.ToolsApproved,
289 InputTokens: sess.InputTokens,
290 OutputTokens: sess.OutputTokens,
291 WorkingDir: sess.WorkingDir,
292 Permissions: sess.Permissions,
293 })
294}
295
296// getSessionStatus returns the session's current runtime state. With
297// ?wait=<duration> it blocks until the session's runtime is attached (ready

Callers

nothing calls this directly

Calls 3

ContextMethod · 0.80
GetAllMessagesMethod · 0.80
GetSessionMethod · 0.65

Tested by

no test coverage detected