MCPcopy Create free account
hub / github.com/compozy/agh / handleSessionsStop

Method handleSessionsStop

internal/extension/host_api.go:974–992  ·  view source on GitHub ↗
(ctx context.Context, raw json.RawMessage)

Source from the content-addressed store, hash-verified

972}
973
974func (h *HostAPIHandler) handleSessionsStop(ctx context.Context, raw json.RawMessage) (any, error) {
975 var params hostAPISessionTargetParams
976 if err := decodeHostAPIParams(raw, &params); err != nil {
977 return nil, err
978 }
979 if h.sessions == nil {
980 return nil, errors.New("extension: session manager is not configured")
981 }
982 if strings.TrimSpace(params.SessionID) == "" {
983 return nil, invalidParamsRPCError(errors.New("session_id is required"))
984 }
985 if _, err := h.requireHostAPISessionWorkspace(ctx, params.WorkspaceID, params.SessionID); err != nil {
986 return nil, err
987 }
988 if err := h.sessions.Stop(ctx, params.SessionID); err != nil {
989 return nil, err
990 }
991 return struct{}{}, nil
992}
993
994func (h *HostAPIHandler) handleSessionsStatus(ctx context.Context, raw json.RawMessage) (any, error) {
995 var params hostAPISessionTargetParams

Callers

nothing calls this directly

Calls 4

decodeHostAPIParamsFunction · 0.85
invalidParamsRPCErrorFunction · 0.85
StopMethod · 0.65

Tested by

no test coverage detected