Unable to access Api Resource on Test Server - Discovery Endpoint unavailable

[x ] I read and understood how to enable logging

Issue / Steps to reproduce the problem
Hi,
I have a Xamarin.Forms project with a native login (which is why I'm using password grant), I can login to our application just fine, get access token, and claims. I can also access the api resource, and return a list of objects. This all works great locally, web application running on Kestrel, mobile application running on my iphone.
However, when I deploy to our test server, I can login and get an access token, but the api resource is throwing an error (An unhandled exception has occurred: Discovery endpoint https://mysite.com/.well-known/openid-configuration is unavailable: ).
For our test/production SSL is on, I can access https://mysite.com/.well-known/openid-configuration from the browser.
Odd things I've noted:
If you check the logs all the requests comming in are for http://mysite.com/connect/.... work fine, but you can see that when the api get's hit (http://johndoe.mysite.com/api/customers, we are using a multitenancy structure), identity server tries to located the discover doc using https and fails.
All the requests from the client are https, why are they being logged as http?
Why would a request to https://mysite.com/.well-known/openid-configuration fail when i can access it in the browser?
I've exhausted google and I'm out of ideas. Please help.
Startup.cs
// Adds IdentityServer
	services.AddIdentityServer()
		.AddSigningCredential(IdSvrConfig.GetSigningCertificate(Env, Config)) // this is a self signed certificate
		.AddInMemoryClients(IdSvrConfig.GetClients())
		.AddInMemoryIdentityResources(IdSvrConfig.GetIdentityResources())
		.AddInMemoryApiResources(IdSvrConfig.GetApiResources())
		.AddOperationalStore(builder => builder.UseSqlServer(Connections.Host))
		.AddAspNetIdentity<UserProfile>()
		.AddProfileService<IdentityServerProfileService>(); // for custom claims

	...
    app.UseIdentityServer();
	JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();
	app.UseIdentityServerAuthentication(new IdentityServerAuthenticationOptions
	{
		Authority = "https://mysite.com",
		AllowedScopes = new[] { "myappapi" },
		ApiSecret = "secret",
		ApiName = "myappapi",

		AutomaticAuthenticate = true,
		AutomaticChallenge = true,

		SupportedTokens = IdentityServer4.AccessTokenValidation.SupportedTokens.Both

#if DEBUG
		,
		RequireHttpsMetadata = false
#endif
	});

Client & Resource
Client
	...
	new Client
	{
		ClientId = "myappmobile",

		ClientName = "My Mobile Application",
		AllowedGrantTypes = GrantTypes.ResourceOwnerPassword,
		AccessTokenType = AccessTokenType.Reference,
		AccessTokenLifetime = 60 * 60 * 24 * 30,
		ClientSecrets =
		{
			new Secret("secret".Sha256())
		},
		AllowedScopes =
		{
			"myappapi"
		},
		AlwaysIncludeUserClaimsInIdToken = true,
		AlwaysSendClientClaims = true
	},
	...

	Api Resource
	new ApiResource("myappapi")
	{
		ApiSecrets = new List<Secret>()
		{
			new Secret("secret".Sha256())
		},
		// claims to be included in the access token
		UserClaims =
		{
			"role",
			"name"
		}
	}

Relevant parts of the log file
2017-05-17 08:32:35.489 -04:00 [Information] Request starting HTTP/1.1 GET http://johndoe.mysite.com/api/customers
2017-05-17 08:32:35.489 -04:00 [Verbose] Performing protect operation to key {4a6d3644-6bb2-4389-9bfd-191d377f12c1} with purposes "('C:\Octopus\Applications\MyOneApp Test\MyOneApp\<IP_ADDRESS>_1', 'SessionMiddleware')".
2017-05-17 08:32:35.489 -04:00 [Debug] The request path "/api/customers" does not match a supported file type
2017-05-17 08:32:35.489 -04:00 [Debug] AuthenticationScheme: "Identity.Application" was not authenticated.
2017-05-17 08:32:35.489 -04:00 [Verbose] No endpoint entry found for request path: "/api/customers"
2017-05-17 08:32:56.532 -04:00 [Error] An unhandled exception has occurred: Discovery endpoint https://mysite.com/.well-known/openid-configuration is unavailable: System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond XXX.XX.XXX.XXX:443
   at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Net.Http.HttpClient.<FinishSendAsync>d__58.MoveNext()

All logs
2017-05-17 08:25:15.977 -04:00 [Information] Request starting HTTP/1.1 GET http://mysite.com/.well-known/openid-configuration
2017-05-17 08:25:15.977 -04:00 [Verbose] Performing protect operation to key {4a6d3644-6bb2-4389-9bfd-191d377f12c1} with purposes "('C:\Octopus\Applications\MyOneApp Test\MyOneApp\<IP_ADDRESS>_1', 'SessionMiddleware')".
2017-05-17 08:25:15.978 -04:00 [Debug] The request path "/.well-known/openid-configuration" does not match a supported file type
2017-05-17 08:25:15.978 -04:00 [Debug] AuthenticationScheme: "Identity.Application" was not authenticated.
2017-05-17 08:25:15.978 -04:00 [Debug] Request path "/.well-known/openid-configuration" matched to endpoint type Discovery
2017-05-17 08:25:15.978 -04:00 [Debug] Mapping found for endpoint: Discovery, creating handler: "IdentityServer4.Endpoints.DiscoveryEndpoint"
2017-05-17 08:25:15.978 -04:00 [Information] Invoking IdentityServer endpoint: "IdentityServer4.Endpoints.DiscoveryEndpoint" for "/.well-known/openid-configuration"
2017-05-17 08:25:15.978 -04:00 [Verbose] Processing discovery request.
2017-05-17 08:25:15.978 -04:00 [Debug] Start discovery request
2017-05-17 08:25:15.978 -04:00 [Verbose] Invoking result: "IdentityServer4.Endpoints.Results.DiscoveryDocumentResult"
2017-05-17 08:25:15.979 -04:00 [Debug] Connection id ""0HL4T3OM9KDJ6"" completed keep alive response.
2017-05-17 08:25:15.979 -04:00 [Information] Request finished in 2.0123ms 200 application/json
2017-05-17 08:25:16.050 -04:00 [Information] Request starting HTTP/1.1 GET http://mysite.com/.well-known/openid-configuration/jwks
2017-05-17 08:25:16.050 -04:00 [Verbose] Performing protect operation to key {4a6d3644-6bb2-4389-9bfd-191d377f12c1} with purposes "('C:\Octopus\Applications\MyOneApp Test\MyOneApp\<IP_ADDRESS>_1', 'SessionMiddleware')".
2017-05-17 08:25:16.050 -04:00 [Debug] The request path "/.well-known/openid-configuration/jwks" does not match a supported file type
2017-05-17 08:25:16.050 -04:00 [Debug] AuthenticationScheme: "Identity.Application" was not authenticated.
2017-05-17 08:25:16.050 -04:00 [Debug] Request path "/.well-known/openid-configuration/jwks" matched to endpoint type Discovery
2017-05-17 08:25:16.050 -04:00 [Debug] Mapping found for endpoint: Discovery, creating handler: "IdentityServer4.Endpoints.DiscoveryEndpoint"
2017-05-17 08:25:16.051 -04:00 [Information] Invoking IdentityServer endpoint: "IdentityServer4.Endpoints.DiscoveryEndpoint" for "/.well-known/openid-configuration/jwks"
2017-05-17 08:25:16.051 -04:00 [Verbose] Processing discovery request.
2017-05-17 08:25:16.051 -04:00 [Debug] Start key discovery request
2017-05-17 08:25:16.051 -04:00 [Verbose] Invoking result: "IdentityServer4.Endpoints.Results.JsonWebKeysResult"
2017-05-17 08:25:16.051 -04:00 [Debug] Connection id ""0HL4T3OM9KDJ6"" completed keep alive response.
2017-05-17 08:25:16.051 -04:00 [Information] Request finished in 1.4252ms 200 application/json
2017-05-17 08:25:16.464 -04:00 [Information] Request starting HTTP/1.1 POST http://mysite.com/connect/token application/x-www-form-urlencoded 80
2017-05-17 08:25:16.464 -04:00 [Verbose] Performing protect operation to key {4a6d3644-6bb2-4389-9bfd-191d377f12c1} with purposes "('C:\Octopus\Applications\MyOneApp Test\MyOneApp\<IP_ADDRESS>_1', 'SessionMiddleware')".
2017-05-17 08:25:16.464 -04:00 [Debug] "POST" requests are not supported
2017-05-17 08:25:16.464 -04:00 [Debug] AuthenticationScheme: "Identity.Application" was not authenticated.
2017-05-17 08:25:16.464 -04:00 [Debug] Request path "/connect/token" matched to endpoint type Token
2017-05-17 08:25:16.464 -04:00 [Debug] Mapping found for endpoint: Token, creating handler: "IdentityServer4.Endpoints.TokenEndpoint"
2017-05-17 08:25:16.466 -04:00 [Information] Invoking IdentityServer endpoint: "IdentityServer4.Endpoints.TokenEndpoint" for "/connect/token"
2017-05-17 08:25:16.466 -04:00 [Verbose] Processing token request.
2017-05-17 08:25:16.466 -04:00 [Debug] Start token request.
2017-05-17 08:25:16.466 -04:00 [Debug] Start client validation
2017-05-17 08:25:16.466 -04:00 [Debug] Start parsing Basic Authentication secret
2017-05-17 08:25:16.466 -04:00 [Debug] Parser found secret: "BasicAuthenticationSecretParser"
2017-05-17 08:25:16.466 -04:00 [Debug] Secret id found: "myappmobile"
2017-05-17 08:25:16.466 -04:00 [Debug] Secret validator success: "HashedSharedSecretValidator"
2017-05-17 08:25:16.466 -04:00 [Debug] Client validation success
2017-05-17 08:25:16.468 -04:00 [Debug] Start token request validation
2017-05-17 08:25:16.468 -04:00 [Debug] Start resource owner password token request validation
2017-05-17 08:25:16.469 -04:00 [Debug] Opening connection to database 'HostSql' on server 'SQLMain\TestApplication'.

2017-05-17 08:25:16.469 -04:00 [Debug] Closing connection to database 'HostSql' on server 'SQLMain\TestApplication'.
2017-05-17 08:25:16.470 -04:00 [Information] Credentials validated for username: "JohnDoe"
2017-05-17 08:25:16.470 -04:00 [Debug] Resource owner password token request validation success.
2017-05-17 08:25:16.470 -04:00 [Verbose] Calling into custom request validator: "IdentityServer4.Validation.DefaultCustomTokenRequestValidator"
2017-05-17 08:25:16.470 -04:00 [Information] Token request validation success
"{
  \"ClientId\": \"myappmobile\",
  \"ClientName\": \"MyOneApp Mobile Application\",
  \"GrantType\": \"password\",
  \"Scopes\": \"myappapi\",
  \"UserName\": \"JohnDoe\",
  \"Raw\": {
    \"grant_type\": \"password\",
    \"username\": \"JohnDoe\",
    \"password\": \"***REDACTED***\",
    \"scope\": \"myappapi\"
  }
}"
2017-05-17 08:25:16.470 -04:00 [Verbose] Creating token response
2017-05-17 08:25:16.471 -04:00 [Verbose] Processing token request
2017-05-17 08:25:16.471 -04:00 [Verbose] Creating access token
2017-05-17 08:25:16.471 -04:00 [Debug] Getting claims for access token for client: "myappmobile"
2017-05-17 08:25:16.471 -04:00 [Debug] Getting claims for access token for subject: "4"
2017-05-17 08:25:16.473 -04:00 [Debug] Opening connection to database 'HostSql' on server 'SQLMain\TestApplication'.

2017-05-17 08:25:16.486 -04:00 [Debug] Committing transaction.
2017-05-17 08:25:16.487 -04:00 [Debug] Closing connection to database 'HostSql' on server 'SQLMain\TestApplication'.
2017-05-17 08:25:16.488 -04:00 [Verbose] Access token issued for "myappmobile (MyOneApp Mobile Application)" / "4": "bbf8265a7f46122fb989a6d187c9940fb4abdbec095ae1f79087d2b70d7f2fe0"
2017-05-17 08:25:16.488 -04:00 [Debug] Token request success.
2017-05-17 08:25:16.488 -04:00 [Verbose] Invoking result: "IdentityServer4.Endpoints.Results.TokenResult"
2017-05-17 08:25:16.488 -04:00 [Debug] Connection id ""0HL4T3OM9KDJ6"" completed keep alive response.
2017-05-17 08:25:16.489 -04:00 [Information] Request finished in 24.7049ms 200 application/json
2017-05-17 08:25:17.268 -04:00 [Information] Request starting HTTP/1.1 POST http://mysite.com/connect/introspect application/x-www-form-urlencoded 70
2017-05-17 08:25:17.268 -04:00 [Verbose] Performing protect operation to key {4a6d3644-6bb2-4389-9bfd-191d377f12c1} with purposes "('C:\Octopus\Applications\MyOneApp Test\MyOneApp\<IP_ADDRESS>_1', 'SessionMiddleware')".
2017-05-17 08:25:17.268 -04:00 [Debug] "POST" requests are not supported
2017-05-17 08:25:17.268 -04:00 [Debug] AuthenticationScheme: "Identity.Application" was not authenticated.
2017-05-17 08:25:17.268 -04:00 [Debug] Request path "/connect/introspect" matched to endpoint type Introspection
2017-05-17 08:25:17.268 -04:00 [Debug] Mapping found for endpoint: Introspection, creating handler: "IdentityServer4.Endpoints.IntrospectionEndpoint"
2017-05-17 08:25:17.270 -04:00 [Information] Invoking IdentityServer endpoint: "IdentityServer4.Endpoints.IntrospectionEndpoint" for "/connect/introspect"
2017-05-17 08:25:17.270 -04:00 [Verbose] Processing introspection request.
2017-05-17 08:25:17.270 -04:00 [Debug] Starting introspection request.
2017-05-17 08:25:17.270 -04:00 [Verbose] Start API validation
2017-05-17 08:25:17.270 -04:00 [Debug] Start parsing Basic Authentication secret
2017-05-17 08:25:17.270 -04:00 [Debug] Parser found secret: "BasicAuthenticationSecretParser"
2017-05-17 08:25:17.270 -04:00 [Debug] Secret id found: "myappapi"
2017-05-17 08:25:17.270 -04:00 [Debug] Secret validator success: "HashedSharedSecretValidator"
2017-05-17 08:25:17.270 -04:00 [Debug] API resource validation success
2017-05-17 08:25:17.270 -04:00 [Debug] Introspection request validation started.
2017-05-17 08:25:17.270 -04:00 [Verbose] Start access token validation
2017-05-17 08:25:17.271 -04:00 [Debug] Opening connection to database 'HostSql' on server 'SQLMain\TestApplication'.

2017-05-17 08:25:17.271 -04:00 [Debug] Closing connection to database 'HostSql' on server 'SQLMain\TestApplication'.
2017-05-17 08:25:17.271 -04:00 [Debug] "b/4LOoSrq7Sz+8yXUZqqnoZDhl4dA749M+uGNC6Vpsw=" found in database: True
2017-05-17 08:25:17.275 -04:00 [Debug] Opening connection to database 'HostSql' on server 'SQLMain\TestApplication'.

2017-05-17 08:25:17.276 -04:00 [Debug] Closing connection to database 'HostSql' on server 'SQLMain\TestApplication'.
2017-05-17 08:25:17.276 -04:00 [Debug] Token validation success
"{
  \"ValidateLifetime\": true,
  \"AccessTokenType\": \"Reference\",
  \"TokenHandle\": \"bbf8265a7f46122fb989a6d187c9940fb4abdbec095ae1f79087d2b70d7f2fe0\",
  \"Claims\": {
    \"iss\": \"https://mysite.com\",
    \"nbf\":<PHONE_NUMBER>,
    \"exp\":<PHONE_NUMBER>,
    \"aud\": [
      \"https://mysite.com/resources\",
      \"myappapi\"
    ],
    \"client_id\": \"myappmobile\",
    \"scope\": \"myappapi\",
    \"sub\": \"4\",
    \"auth_time\":<PHONE_NUMBER>,
    \"idp\": \"local\",
    \"amr\": \"pwd\",
    \"name\": \"johndoe\",
    \"role\": [
      \"Administrator\",
      \"Role1\",
      \"Role2\",
      \"Role3\"
    ],
    \"companyId\": \"10000\",
    \"prefix\": \"johndoe\"
  }
}"
2017-05-17 08:25:17.276 -04:00 [Debug] Introspection request validation successful.
2017-05-17 08:25:17.276 -04:00 [Verbose] Creating introspection response
2017-05-17 08:25:17.276 -04:00 [Debug] Creating introspection response for active token.
2017-05-17 08:25:17.276 -04:00 [Information] Success token introspection. Token status: "active", for API name: "myappapi"
2017-05-17 08:25:17.276 -04:00 [Verbose] Invoking result: "IdentityServer4.Endpoints.Results.IntrospectionResult"
2017-05-17 08:25:17.277 -04:00 [Debug] Connection id ""0HL4T3OM9KDJ6"" completed keep alive response.
2017-05-17 08:25:17.277 -04:00 [Information] Request finished in 9.2073ms 200 application/json
2017-05-17 08:25:19.489 -04:00 [Information] Request starting HTTP/1.1 POST http://mysite.com/connect/revocation application/x-www-form-urlencoded 99
2017-05-17 08:25:19.489 -04:00 [Verbose] Performing protect operation to key {4a6d3644-6bb2-4389-9bfd-191d377f12c1} with purposes "('C:\Octopus\Applications\MyOneApp Test\MyOneApp\<IP_ADDRESS>_1', 'SessionMiddleware')".
2017-05-17 08:25:19.490 -04:00 [Debug] "POST" requests are not supported
2017-05-17 08:25:19.490 -04:00 [Debug] AuthenticationScheme: "Identity.Application" was not authenticated.
2017-05-17 08:25:19.490 -04:00 [Debug] Request path "/connect/revocation" matched to endpoint type Revocation
2017-05-17 08:25:19.490 -04:00 [Debug] Mapping found for endpoint: Revocation, creating handler: "IdentityServer4.Endpoints.RevocationEndpoint"
2017-05-17 08:25:19.490 -04:00 [Information] Invoking IdentityServer endpoint: "IdentityServer4.Endpoints.RevocationEndpoint" for "/connect/revocation"
2017-05-17 08:25:19.490 -04:00 [Verbose] Processing revocation request.
2017-05-17 08:25:19.490 -04:00 [Debug] Start revocation request.
2017-05-17 08:25:19.490 -04:00 [Debug] Start client validation
2017-05-17 08:25:19.490 -04:00 [Debug] Start parsing Basic Authentication secret
2017-05-17 08:25:19.490 -04:00 [Debug] Parser found secret: "BasicAuthenticationSecretParser"
2017-05-17 08:25:19.490 -04:00 [Debug] Secret id found: "myappmobile"
2017-05-17 08:25:19.490 -04:00 [Debug] Secret validator success: "HashedSharedSecretValidator"
2017-05-17 08:25:19.490 -04:00 [Debug] Client validation success
2017-05-17 08:25:19.490 -04:00 [Verbose] Client validation successful
2017-05-17 08:25:19.491 -04:00 [Verbose] ValidateRequestAsync called
2017-05-17 08:25:19.491 -04:00 [Debug] Token type hint found in request: "access_token"
2017-05-17 08:25:19.491 -04:00 [Debug] ValidateRequestAsync result: "IdentityServer4.Validation.TokenRevocationRequestValidationResult"
2017-05-17 08:25:19.491 -04:00 [Verbose] Hint was for access token
2017-05-17 08:25:19.491 -04:00 [Debug] Opening connection to database 'HostSql' on server 'SQLMain\TestApplication'.

2017-05-17 08:25:19.492 -04:00 [Debug] Closing connection to database 'HostSql' on server 'SQLMain\TestApplication'.
2017-05-17 08:25:19.492 -04:00 [Debug] "b/4LOoSrq7Sz+8yXUZqqnoZDhl4dA749M+uGNC6Vpsw=" found in database: True
2017-05-17 08:25:19.495 -04:00 [Debug] Access token revoked
2017-05-17 08:25:19.495 -04:00 [Debug] Opening connection to database 'HostSql' on server 'SQLMain\TestApplication'.

2017-05-17 08:25:19.496 -04:00 [Debug] Closing connection to database 'HostSql' on server 'SQLMain\TestApplication'.
2017-05-17 08:25:19.496 -04:00 [Debug] removing "b/4LOoSrq7Sz+8yXUZqqnoZDhl4dA749M+uGNC6Vpsw=" persisted grant from database
2017-05-17 08:25:19.496 -04:00 [Debug] Opening connection to database 'HostSql' on server 'SQLMain\TestApplication'.
2017-05-17 08:25:19.496 -04:00 [Debug] Beginning transaction with isolation level 'Unspecified'.

2017-05-17 08:25:19.497 -04:00 [Debug] Committing transaction.
2017-05-17 08:25:19.498 -04:00 [Debug] Closing connection to database 'HostSql' on server 'SQLMain\TestApplication'.
2017-05-17 08:25:19.498 -04:00 [Information] Token successfully revoked
2017-05-17 08:25:19.498 -04:00 [Verbose] Invoking result: "IdentityServer4.Endpoints.Results.StatusCodeResult"
2017-05-17 08:25:19.499 -04:00 [Debug] Connection id ""0HL4T3OM9KDJ6"" completed keep alive response.
2017-05-17 08:25:19.499 -04:00 [Information] Request finished in 9.8606ms 200
2017-05-17 08:26:39.473 -04:00 [Debug] Connection id ""0HL4T3OM9KDJ6"" received FIN.
2017-05-17 08:26:39.473 -04:00 [Debug] Connection id ""0HL4T3OM9KDJ6"" disconnecting.
2017-05-17 08:26:39.473 -04:00 [Debug] Connection id ""0HL4T3OM9KDJ6"" sending FIN.
2017-05-17 08:26:39.473 -04:00 [Debug] Connection id ""0HL4T3OM9KDJ6"" sent FIN with status "0".
2017-05-17 08:26:39.473 -04:00 [Debug] Connection id ""0HL4T3OM9KDJ6"" stopped.
2017-05-17 08:28:48.703 -04:00 [Debug] Aggregating records in 'Counter' table...
2017-05-17 08:28:48.704 -04:00 [Verbose] Records from the 'Counter' table aggregated.
2017-05-17 08:32:31.348 -04:00 [Debug] Connection id ""0HL4T3OM9KDJ7"" started.
2017-05-17 08:32:31.348 -04:00 [Information] Request starting HTTP/1.1 POST http://mysite.com/connect/token application/x-www-form-urlencoded 80
2017-05-17 08:32:31.348 -04:00 [Verbose] Performing protect operation to key {4a6d3644-6bb2-4389-9bfd-191d377f12c1} with purposes "('C:\Octopus\Applications\MyOneApp Test\MyOneApp\<IP_ADDRESS>_1', 'SessionMiddleware')".
2017-05-17 08:32:31.348 -04:00 [Debug] "POST" requests are not supported
2017-05-17 08:32:31.349 -04:00 [Debug] AuthenticationScheme: "Identity.Application" was not authenticated.
2017-05-17 08:32:31.349 -04:00 [Debug] Request path "/connect/token" matched to endpoint type Token
2017-05-17 08:32:31.349 -04:00 [Debug] Mapping found for endpoint: Token, creating handler: "IdentityServer4.Endpoints.TokenEndpoint"
2017-05-17 08:32:31.353 -04:00 [Information] Invoking IdentityServer endpoint: "IdentityServer4.Endpoints.TokenEndpoint" for "/connect/token"
2017-05-17 08:32:31.353 -04:00 [Verbose] Processing token request.
2017-05-17 08:32:31.353 -04:00 [Debug] Start token request.
2017-05-17 08:32:31.353 -04:00 [Debug] Start client validation
2017-05-17 08:32:31.353 -04:00 [Debug] Start parsing Basic Authentication secret
2017-05-17 08:32:31.353 -04:00 [Debug] Parser found secret: "BasicAuthenticationSecretParser"
2017-05-17 08:32:31.353 -04:00 [Debug] Secret id found: "myappmobile"
2017-05-17 08:32:31.353 -04:00 [Debug] Secret validator success: "HashedSharedSecretValidator"
2017-05-17 08:32:31.353 -04:00 [Debug] Client validation success
2017-05-17 08:32:31.353 -04:00 [Debug] Start token request validation
2017-05-17 08:32:31.353 -04:00 [Debug] Start resource owner password token request validation
2017-05-17 08:32:31.354 -04:00 [Debug] Opening connection to database 'HostSql' on server 'SQLMain\TestApplication'.

2017-05-17 08:32:31.355 -04:00 [Debug] Closing connection to database 'HostSql' on server 'SQLMain\TestApplication'.
2017-05-17 08:32:31.356 -04:00 [Information] Credentials validated for username: "JohnDoe"
2017-05-17 08:32:31.356 -04:00 [Debug] Resource owner password token request validation success.
2017-05-17 08:32:31.356 -04:00 [Verbose] Calling into custom request validator: "IdentityServer4.Validation.DefaultCustomTokenRequestValidator"
2017-05-17 08:32:31.356 -04:00 [Information] Token request validation success
"{
  \"ClientId\": \"myappmobile\",
  \"ClientName\": \"MyOneApp Mobile Application\",
  \"GrantType\": \"password\",
  \"Scopes\": \"myappapi\",
  \"UserName\": \"JohnDoe\",
  \"Raw\": {
    \"grant_type\": \"password\",
    \"username\": \"JohnDoe\",
    \"password\": \"***REDACTED***\",
    \"scope\": \"myappapi\"
  }
}"
2017-05-17 08:32:31.356 -04:00 [Verbose] Creating token response
2017-05-17 08:32:31.356 -04:00 [Verbose] Processing token request
2017-05-17 08:32:31.356 -04:00 [Verbose] Creating access token
2017-05-17 08:32:31.356 -04:00 [Debug] Getting claims for access token for client: "myappmobile"
2017-05-17 08:32:31.356 -04:00 [Debug] Getting claims for access token for subject: "4"
2017-05-17 08:32:31.359 -04:00 [Debug] Opening connection to database 'HostSql' on server 'SQLMain\TestApplication'.
2017-05-17 08:32:31.360 -04:00 [Information] Executed DbCommand (0ms) [Parameters=[@__userId_0='?'], CommandType='Text', CommandTimeout='30']

2017-05-17 08:32:31.373 -04:00 [Debug] Closing connection to database 'HostSql' on server 'SQLMain\TestApplication'.
2017-05-17 08:32:31.373 -04:00 [Debug] "is1BD9nKkItJLHBSHwEw0odl9Uo0nSEf0dGefiyKFTE=" not found in database
2017-05-17 08:32:31.373 -04:00 [Debug] Opening connection to database 'HostSql' on server 'SQLMain\TestApplication'.
2017-05-17 08:32:31.373 -04:00 [Debug] Beginning transaction with isolation level 'Unspecified'.
2017-05-17 08:32:31.374 -04:00 [Information] Executed DbCommand (0ms) [Parameters=[@p0='?' (Size = 200), @p1='?' (Size = 200), @p2='?', @p3='?' (Size = 4000), @p4='?', @p5='?' (Size = 200), @p6='?' (Size = 50)], CommandType='Text', CommandTimeout='30']

2017-05-17 08:32:31.374 -04:00 [Debug] Committing transaction.
2017-05-17 08:32:31.376 -04:00 [Debug] Closing connection to database 'HostSql' on server 'SQLMain\TestApplication'.
2017-05-17 08:32:31.376 -04:00 [Verbose] Access token issued for "myappmobile (MyOneApp Mobile Application)" / "4": "300f317854714a507c691dd9864cc907308da78c42c02badc6648c7857056739"
2017-05-17 08:32:31.376 -04:00 [Debug] Token request success.
2017-05-17 08:32:31.376 -04:00 [Verbose] Invoking result: "IdentityServer4.Endpoints.Results.TokenResult"
2017-05-17 08:32:31.377 -04:00 [Debug] Connection id ""0HL4T3OM9KDJ7"" completed keep alive response.
2017-05-17 08:32:31.377 -04:00 [Information] Request finished in 28.8258ms 200 application/json
2017-05-17 08:32:31.616 -04:00 [Information] Request starting HTTP/1.1 POST http://mysite.com/connect/introspect application/x-www-form-urlencoded 70
2017-05-17 08:32:31.616 -04:00 [Verbose] Performing protect operation to key {4a6d3644-6bb2-4389-9bfd-191d377f12c1} with purposes "('C:\Octopus\Applications\MyOneApp Test\MyOneApp\<IP_ADDRESS>_1', 'SessionMiddleware')".
2017-05-17 08:32:31.617 -04:00 [Debug] "POST" requests are not supported
2017-05-17 08:32:31.617 -04:00 [Debug] AuthenticationScheme: "Identity.Application" was not authenticated.
2017-05-17 08:32:31.617 -04:00 [Debug] Request path "/connect/introspect" matched to endpoint type Introspection
2017-05-17 08:32:31.617 -04:00 [Debug] Mapping found for endpoint: Introspection, creating handler: "IdentityServer4.Endpoints.IntrospectionEndpoint"
2017-05-17 08:32:31.618 -04:00 [Information] Invoking IdentityServer endpoint: "IdentityServer4.Endpoints.IntrospectionEndpoint" for "/connect/introspect"
2017-05-17 08:32:31.618 -04:00 [Verbose] Processing introspection request.
2017-05-17 08:32:31.618 -04:00 [Debug] Starting introspection request.
2017-05-17 08:32:31.618 -04:00 [Verbose] Start API validation
2017-05-17 08:32:31.618 -04:00 [Debug] Start parsing Basic Authentication secret
2017-05-17 08:32:31.618 -04:00 [Debug] Parser found secret: "BasicAuthenticationSecretParser"
2017-05-17 08:32:31.618 -04:00 [Debug] Secret id found: "myappapi"
2017-05-17 08:32:31.618 -04:00 [Debug] Secret validator success: "HashedSharedSecretValidator"
2017-05-17 08:32:31.618 -04:00 [Debug] API resource validation success
2017-05-17 08:32:31.619 -04:00 [Debug] Introspection request validation started.
2017-05-17 08:32:31.619 -04:00 [Verbose] Start access token validation
2017-05-17 08:32:31.619 -04:00 [Debug] Opening connection to database 'HostSql' on server 'SQLMain\TestApplication'.
2017-05-17 08:32:31.619 -04:00 [Information] Executed DbCommand (0ms) [Parameters=[@__key_0='?' (Size = 200)], CommandType='Text', CommandTimeout='30']

2017-05-17 08:32:31.620 -04:00 [Debug] Closing connection to database 'HostSql' on server 'SQLMain\TestApplication'.
2017-05-17 08:32:31.620 -04:00 [Debug] "is1BD9nKkItJLHBSHwEw0odl9Uo0nSEf0dGefiyKFTE=" found in database: True
2017-05-17 08:32:31.623 -04:00 [Debug] Opening connection to database 'HostSql' on server 'SQLMain\TestApplication'.
2017-05-17 08:32:31.624 -04:00 [Information] Executed DbCommand (0ms) [Parameters=[@__get_Item_0='?'], CommandType='Text', CommandTimeout='30']

2017-05-17 08:32:31.624 -04:00 [Debug] Closing connection to database 'HostSql' on server 'SQLMain\TestApplication'.
2017-05-17 08:32:31.624 -04:00 [Debug] Token validation success
"{
  \"ValidateLifetime\": true,
  \"AccessTokenType\": \"Reference\",
  \"TokenHandle\": \"300f317854714a507c691dd9864cc907308da78c42c02badc6648c7857056739\",
  \"Claims\": {
    \"iss\": \"https://mysite.com\",
    \"nbf\":<PHONE_NUMBER>,
    \"exp\":<PHONE_NUMBER>,
    \"aud\": [
      \"https://mysite.com/resources\",
      \"myappapi\"
    ],
    \"client_id\": \"myappmobile\",
    \"scope\": \"myappapi\",
    \"sub\": \"4\",
    \"auth_time\":<PHONE_NUMBER>,
    \"idp\": \"local\",
    \"amr\": \"pwd\",
    \"name\": \"johndoe\",
    \"role\": [
      \"Administrator\",
      \"Role1\",
      \"Role2\",
      \"Role3\"
    ],
    \"companyId\": \"10000\",
    \"prefix\": \"johndoe\"
  }
}"
2017-05-17 08:32:31.624 -04:00 [Debug] Introspection request validation successful.
2017-05-17 08:32:31.624 -04:00 [Verbose] Creating introspection response
2017-05-17 08:32:31.624 -04:00 [Debug] Creating introspection response for active token.
2017-05-17 08:32:31.625 -04:00 [Information] Success token introspection. Token status: "active", for API name: "myappapi"
2017-05-17 08:32:31.625 -04:00 [Verbose] Invoking result: "IdentityServer4.Endpoints.Results.IntrospectionResult"
2017-05-17 08:32:31.625 -04:00 [Debug] Connection id ""0HL4T3OM9KDJ7"" completed keep alive response.
2017-05-17 08:32:31.625 -04:00 [Information] Request finished in 9.1068ms 200 application/json
2017-05-17 08:32:35.489 -04:00 [Information] Request starting HTTP/1.1 GET http://johndoe.mysite.com/api/customers
2017-05-17 08:32:35.489 -04:00 [Verbose] Performing protect operation to key {4a6d3644-6bb2-4389-9bfd-191d377f12c1} with purposes "('C:\Octopus\Applications\MyOneApp Test\MyOneApp\<IP_ADDRESS>_1', 'SessionMiddleware')".
2017-05-17 08:32:35.489 -04:00 [Debug] The request path "/api/customers" does not match a supported file type
2017-05-17 08:32:35.489 -04:00 [Debug] AuthenticationScheme: "Identity.Application" was not authenticated.
2017-05-17 08:32:35.489 -04:00 [Verbose] No endpoint entry found for request path: "/api/customers"
2017-05-17 08:32:56.532 -04:00 [Error] An unhandled exception has occurred: Discovery endpoint https://mysite.com/.well-known/openid-configuration is unavailable: System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond XXX.XX.XXX.XXX:443
   at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Net.Http.HttpClient.<FinishSendAsync>d__58.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Net.Http.HttpClient.<GetContentAsync>d__32`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at IdentityModel.AspNetCore.OAuth2Introspection.OAuth2IntrospectionMiddleware.<GetIntrospectionEndpointFromDiscoveryDocument>d__6.MoveNext()
System.InvalidOperationException: Discovery endpoint https://mysite.com/.well-known/openid-configuration is unavailable: System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond XXX.XX.XXX.XXX:443
   at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Net.Http.HttpClient.<FinishSendAsync>d__58.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Net.Http.HttpClient.<GetContentAsync>d__32`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at IdentityModel.AspNetCore.OAuth2Introspection.OAuth2IntrospectionMiddleware.<GetIntrospectionEndpointFromDiscoveryDocument>d__6.MoveNext()
   at IdentityModel.AspNetCore.OAuth2Introspection.OAuth2IntrospectionMiddleware.<GetIntrospectionEndpointFromDiscoveryDocument>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at IdentityModel.AspNetCore.OAuth2Introspection.OAuth2IntrospectionMiddleware.<InitializeIntrospectionClient>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at IdentityModel.AspNetCore.OAuth2Introspection.OAuth2IntrospectionHandler.<LoadClaimsForToken>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at IdentityModel.AspNetCore.OAuth2Introspection.OAuth2IntrospectionHandler.<HandleAuthenticateAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.<InitializeAsync>d__52.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at IdentityServer4.AccessTokenValidation.IdentityServerAuthenticationMiddleware.<Invoke>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at IdentityServer4.Hosting.IdentityServerMiddleware.<Invoke>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at IdentityServer4.Hosting.FederatedSignOutMiddleware.<Invoke>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at IdentityServer4.Hosting.AuthenticationMiddleware.<Invoke>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.<Invoke>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at IdentityServer4.Hosting.BaseUrlMiddleware.<Invoke>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.<Invoke>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>d__6.MoveNext()

I  think UseIdentityServerAuthentication part is for securing  API  Resources

Thanks, yes it is. My web api, web app, and identity server are all within the same application. This model works fine locally, but fails when deployed to our web farm


Add sock_accept() support

I would be super interested in being able to have socket support in order to be able to implement network applications, such as a pure WASI HTTP server in https://github.com/sdeleuze/kowasm which leverages Node WASI API. I am not a C developer so I create this issue is case somebody would be interested to help on this, since there are a lot of use cases that require it. The support would be initially single-threaded but https://github.com/WebAssembly/wasi-threads is moving again so there is hope that limitation could be removed later.
This can be done by supporting sock_accept() which has been added pretty late to the spec. I previously leveraged that in a Rust + Mio HTTP server prototype which was running on Wasmtime. That would allow to anticipate WASI preview2 support which will provide more first class and standardized networking support.

Related - https://github.com/nodejs/uvwasi/issues/187

Closing this has been implemented.

That's maybe not the right place to ask, but since I am not sure where I should raise this, is it possible to share if Node.js is able to preopen a Socket and how this should be declared in JavaScript?

@sdeleuze while we've added the sock_ methods to uvwasi, their use has not yet been integrated into Node.js itself. That is somethig I've had on my TODO wish list but have not yet gotten to it.


Ex 3: Clarifications about formula

Based on the README, I have two questions regarding the provided formulas: Firstly what does speed_t means. Does it mean to replace T with t or to calculate the difference only for t and t-1. Secondly, why do we divide by T-2 instead of T-1 in the definition of s_speed?

Have you figured it out? I was wondering the same

The equation in Ex. 3 uses the central difference (you may check https://math.stackexchange.com/a/888280/1123371) to calculate the velocity for the frames [1, T-2]. Since we use central difference, we ignore the first frame 0, and the last frame T-1. Thus we have T-2 frames in total.
The definition of speed^t is the L2 norm of the velocity at frame t.

In this case shouldn't s_speed be summed up to t=T-2 instead of t=T-1, since the last frame is ignored?

yes, there was a typo in the equation and is now corrected in the readme. It should sum up to T-2.


[Chore] Update embit; refactor BIP-85 flow to use embit

BIP-85 support added to embit: https://github.com/diybitcoinhardware/embit/pull/35
Included in the latest embit release.
We should update to the latest embit and remove our BIP-85 implementation in favor of calling the implementation in embit.

I have not been watching that repo long enough to form an opinion on historical "stability" of embit api's as soon as a new feature is added... but I notice that it's in pypi since last week.
Normally, I'd say "There is no prize to be won for being the very first to add stability to someone else's api." and would rather let others go first, because the cost of not doing so is that your own api is also not stable... in our case, it just means making local changes at worst case, I see that embit's bip85 mnemonic app passes the tests that it needs to pass, that every other lib passes.

Stepan is pretty quick about updating Specter-DIY and the Specter team generally takes up embit updates into Specter Desktop quickly.
But regardless, part of the chore here is to review his changes and assess possible impact, as you've done/begun to do. @jdlcdl can you provide a link to the specific embit line number that caught your eye?
As for "visibiilty", that should be PR'ed out!

can you provide a link to the specific embit line number that caught your eye?

It's a harmless/petty style-ism that caught my eye, where I dont notice similar whitespace use in other lists/list-comprehensions within that file (and haven't noticed it elsewhere in that code base) -- as well as a space/comma all at line 18 in src/embit/bip85.py.
https://github.com/diybitcoinhardware/embit/pull/35/files
Had I noticed it before merge, I might have left a comment on that line... or I might have just parsed it in my head and thought: "harmless".
As for the "visibiilty" typo on 3 lines in our codebase, I was waiting for the chance to review any pr that touched settings_definitions and the settings view, so I could add a comment like: "boyscout rule: check it in cleaner than it was checked out while peers' eyes will be looking at it... typo on word 'visibiilty'" instead of fixing something that isn't broken.  I don't want to condition fellow devs to NOT peer review by asking them to peer review something that isnt really a fix.

As for the "visibiilty" typo on 3 lines in our codebase...

As a former English teacher, I consider any PR that fixes a typo as an immediate ACK.
My first PR in a Bitcoin Core BIP was to amend an errant apostrophe: https://github.com/bitcoin/bips/commit/99ca1c887686f3881db6e1206d9442f775545400

I've left my thoughts/questions about embit/bip85 for Stepan, but not sure if I've left them in the right places.
https://github.com/cryptoadvance/specter-diy/issues/72
and
https://github.com/diybitcoinhardware/embit/commit/41f0a38f83f9df77bee7e0ddece4b32e3d935879


Duplicate and Error Handling for delete command

Multiple matches is dependent on add command implementation so not changed yet


Add test for malformed rows about types and some messages for them

In this PR, I added some warning messages when it fails to parse malformed rows about types.
Also, I added some tests for them. Additionally, I also changed some tests and the name of the test.

Current coverage is 84.50%

Merging #38 into master will decrease coverage by -0.43% as of 1776aef

@@            master    #38   diff @@
=====================================
  Files           12     12
  Stmts          498    510    +12
  Branches        97     97
  Methods          0      0
=====================================
+ Hit            423    431     +8
  Partial          0      0
- Missed          75     79     +4

Review entire Coverage Diff as of 1776aef

Powered by Codecov. Updated on successful CI builds.

Merged.


feat: make chain_id a storage variable and set it in main contract constructor

Feature Request
Describe the Feature Request
Currently, the chain_id is hardcoded as the constants 'KKRT' (0x4b4b5254) in ASCII.
We would like to make chain_id a storage variable and set it in the main contract constructor.
Describe Preferred Solution
Make chain_id a storage variable and set it in the main contract constructor.

Important update: we are gathering some bugs in the Kakarot v0 codebase, we need to make sure each issue and each PR in Kakarot-ssj is aware of the lists of known bugs. Look at this link everytime you take an issue and check your issue isn't targeted by a known bug.

Important update: we are gathering some bugs in the Kakarot v0 codebase, we need to make sure each issue and each PR in Kakarot-ssj is aware of the lists of known bugs. Look at this tracking issue everytime you take an issue and check your issue isn't targeted by a known bug. Will add this reminder in many places to make sure we keep track of known bugs.


Upcloud as a cloud provider

Problem description
It would be nice to have Upcloud as a provider

Probably belongs to https://github/pulumi/pulumi but I can't seem to move it there...

Thanks created new issue https://github.com/pulumi/pulumi/issues/5772


Add support for Koharu

Possible to add support for Koharu dot to?

added: support: koharu.to

fixed: include separate domain of kaharu.to


#23 Feature request: show description of service (and make it searchable)

What Changed?
Added the the description into the DataGridView and allowed the filter utility to search on those fields as well.
Its worth noting that the description field is not exposed by the GetServices() function, so it is a bit slower than before. Not much, but definitely noticeable.
Screenshots

Issues Closed
#23

@Jonatan-B your branch has conflicts, you need to rebase on the top of master.

I'll rebase my fork and re-add the changes. Then submit a new pull request.

@Jonatan-B I've got some work I'm testing to help with background usage of wmi.
Using wmi on background refresh is really costly to CPU, I observed a spike of 10-20 percent every refresh.
You might want to wait for that so you can extend on top of that as description needs wmi

Cool, the way i implemented it wasn't so bad, especially because the filter didn't call Refresh every time, but I'll keep an eye out of that. 👍

It's more the heartbeat background refresh which causes issues.
With the filter, quite like the way you implemented that, very clever 👍
I'll comment here when my performance changes are into master, and will wait for your pr before doing the next release 🙂

Awesome. Thank you! Looking forward to it.
Sent from my iPhone

On Dec 7, 2017, at 1:47 AM, Chris Blyth<EMAIL_ADDRESS>wrote:
It's more the heartbeat background refresh which causes issues.
With the filter, quite like the way you implemented that, very clever 👍
I'll comment here when my performance changes are into master, and will wait for your pr before doing the next release 🙂
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@Jonatan-B the performance changes are now in.
I also put the filtering logic from this PR is also added as i wanted to test something with it :)


feat(scoped-elements): allow define by using an array of elements

What I did
Allow to define scopedElements with an array of elements, where their tags would be taken from their tagName attribute.

I've added a type definition to support the new feature
I've written new tests to prove the functionality
I've added an example in the documentation

Motivation
In big projects where we're using scopedElements, developers end up using random rules to define tags for custom elements registrations. That's all good and fine, since most of the time these are just instance registries and private properties, but IMHO it makes the code a bit more cluttered and I think defining a default tagName for your components is cleaner.
As an added benefit, this will allow your custom-elements.json manifest to have a single tag that you can then use in your stories, or other features dependant on them, instead of forcing an analyser to guess or infer the tag name from the registry definitions and using the first one it finds.
I'd like to be able to go from this:
class FeatureA extends LitElement {}

class extends ScopedElementsMixin(LitElement) {
  static get scopedElements() {
    return {
      'feature-a': FeatureA
    };
  }

  render() {
    return html`<feature-a></feature-a>`;
  }
}

to this:
class FeatureA extends LitElement {
  static get tagName() {
    return 'feature-a'
  }
}

class extends ScopedElementsMixin(LitElement) {
  static get scopedElements() {
    return [FeatureA]
  }

  render() {
    return html`<feature-a></feature-a>`;
  }
}

As it stands now, without these changes, of course I'll be able to use it with tagNames too:
class FeatureA extends LitElement {}

class extends ScopedElementsMixin(LitElement) {
  static get scopedElements() {
    return {
      [FeatureA.tagName]: FeatureA
    };
  }

  render() {
    return html`<feature-a></feature-a>`;
  }
}

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.Daniel Vivar seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.You have signed the CLA already but the status is still pending? Let us recheck it.


fix: validate endpoint protocol prefix in qiniu.go

Ensure the configuration's endpoint starts with either 'http://' or 'https://'. This validation check prevents errors related to invalid endpoint formats, enhancing the robustness of the connection setup process.

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.


Can not add attributes to definitions

E.g. this is not allowed:
markup::define! {
	#[derive(Clone)]
	MyMarkup {
		"hi"
	}
}

I think this affects documentation comments too.

@L-as I've not needed this yet, but it was a simple change so I added it. Check this out. Let me know if anything doesn't work.


Checking Remote capacity -> Closing Channel Popup window harder than Closing Channel.

Is your feature request related to a problem? Please describe.
When checking the remote channel capacity that is available for invoicing, you cannot see Remote Capacity in the Channels overview, since that only shows the local capacity.
Entering the channel details does show the remote capacity, which is ok, but far away in the app.
When you viewed the details and need to close the popup window, the size of the "Close Channel" option is much bigger and easier to hit than closing the Popup window. This leads to choosing the wrong button 80% of the time and Closing the Channel is not the most wanted action when checking channel info.
Describe the solution you'd like
Option 1: Show the Remote Capacity of the channel like the local capacity in the Channel overview. This way you do not need to open details for info you need for quick reference.
Option 2: Anticipating AMP, show a total of Local- AND Remote Capacity on all active Channels on the Wallet Tab.
Describe alternatives you've considered
When opening the Receive option for Lightning, you might show the actual remote channel capacity available in active channels.

good point, we need to work on channel UI / UX


Sub-heading numbering with non-numbered heading

Description
Basically i would like my heading numbering as follows:
= Past Paper (2022/2023)
== My first question title
=== My first sub-question

to yeild
Past Paper (2022/2023)
1 My first question title
1.a) My first sub-question
this is so i can compile all my past paper answers into one consistent sheet
maybe there could be a no numbering charecter in the numbering string e.g "-1.a)"

this is the closest i could get to what i want to achieve:
#set heading(numbering: (a,..nums)=> numbering("1.a)", ..nums))

but this was still an issue as it creates a bracket where i do not want one:

thank you, close enough, i belive this is the answer I am looking for:
#set heading(numbering: (a, ..nums) => {
  let level = nums.pos().len()
  let pattern = if level == 1 {
    "1"
  } else if level == 2 {
    "1.a)"
  }
  if pattern != none {
    numbering(pattern, ..nums)
  }
})

I think this could also be solved with this
https://github.com/typst/typst/issues/2461


Assignment 6.2 Quickstart - 2

Add the Quickstart guide for the To-do service.
This PR replaces #26.

Rebased PR to current main branch.


add hooks to export

I would like to create my own components that access Stage and Component contexts, this would allow me to do so.

Thank you for submitting a PR. Merged!


Dummy test issue

This is just to test whether the issue will enter OSS Triaging board automatically once created. https://github.com/orgs/stackrox/projects/2/views/1

Feel free to close it any time.


feature/create-repo-gcloud

Insert final dot in these lines: 195,197, 218, 242, 247, 250, 252, 254, 398, 425, 432, 434, 436, 443, 449,464,468. Use capital letter in these lines: 254, 449

You are not specifying which file.

Insert final dot in these lines: 195,197, 218, 242, 247, 250, 252, 254, 398, 425, 432, 434, 436, 443, 449,464,468. Use capital letter in these lines: 254, 449

I thought we were friends.. xD Done.


Getting translation issue while moving configurable and simple product from wishlist to cart.

Bug report
Title
Getting translation issue while moving configurable/simple product from wishlist to cart.
Issue Description:
Getting translation issue while moving configurable& simple product from wishlist to cart.
Preconditions:
1. framework Version. v 0.1.8

Steps to reproduce
1. step1: add configurable/simple product to wishlist
2. step2: move to cart from wishlist

Expected result:
correct message should be displayed
Actual result
translation issue
configurable product:-

Simple Product:-

same issue found while moving product to wishlist from cart.

Fixed in master

Still same issue in master

Fixed in master


Example of Configuration.yaml in Corpora Schema guide is outdated

This was reported by @jahilton.
The schema version is 1.1.0, but the sample configuration.yaml in the Corpora Schema Guide has not been updated to reflect the changes, including some deprecations of fields.

We're moving this to the single-cell-curation repo (which will be public shortly), and the guide has been updated.

You can use Transfer issue to accomplish that task.

Issue moved to chanzuckerberg/single-cell-curation #17 via ZenHub


Pass helper class instance into PageObject

I am new to page-object, cucumber, and watir so I might be missing something that is not related to page-object. Here is my qustion:
How do I make the BrowserHelper class instance available for my BasePage class during runtime?
I have these page objects:
class BasePage
  include PageObject

  page_url "bla"
end

class LoginPage < BasePage
  page_url "bla/login"

  text_field(:username, id: "user")
  button(:login, id: "submit")

  def do_login
    self.username = "abc"
    @browser_helper.take_screenshot
    login
  end
end

Part of my env.rb:
require "page-object"
require "page-object/page_factory"

@browser_helper = BrowserHelper.new
@browser = browser_helper.instance

In my env.rb, I have assign the driver instance to @browser and my helper class instance to @browser_helper. I would like this @browser_helper to be available in my page objects. Can I achieve this somehow? Or should I optimize my design?

My issue was not understanding Ruby enough. I just wanted to have access to modules I included in my env.rb via the world command (like World(My helper))) fromage objects. I found it is possible via MyWorld.method(), for example.


Nightly doc is not working anymore.

Before submitting the issue

[X] I have searched among the existing issues
[X] I am using a Python virtual environment

Description of the bug
See the nightly-docs history.
The documentation from the main branch is built properly but is not deployed.

Steps To Reproduce
N/A.
Which Operating System are you using?
Windows
Which Python version are you using?
3.7
Installed packages
N/A.

Related with https://github.com/pyansys/actions/pull/131

Using pyansys/actions@v3 should fix this issue.

@jorgepiloto exactly. I have launched the build with one of my branch embedding the v3.
Thanks @jorgepiloto for the new release of pyansys/actions.


injects visual detail？

In readme.md m-kplug is an extension of the pre-trained model k-plug, which simply injects the visual signals to the decoder layer.
Can you explain in detail how it is injected into the Decoder?

Sorry for the late response. Here is a simple implementation: https://github.com/WaveLi123/m-kplug/blob/9888e67ac85888a16a6ad069d1de4b5877c92bc8/m_kplug/model/transformer_mass.py#L99

The different from Standard Decoding is:

input of standard decoder: the preview token embedding.
input of visual decoder: g * preview token embedding + (1 -g) * visual embedding.

as the picture shows:

that's the only difference, is right?


[SPARK-29453][WEBUI] Improve tooltips information for SQL tab.

What changes were proposed in this pull request?
Adding tooltip to SQL tab for better usability.
Why are the changes needed?
There are a few common points of confusion in the UI that could be clarified with tooltips. We should add tooltips to explain.
Does this PR introduce any user-facing change?
Yes.

How was this patch tested?

Unit tests (written unit test cases to verify changes).
Manual test.

Can one of the admins verify this patch?

Can one of the admins verify this patch?

@AmplabJenkins ,Thank you , please help me to review my PR.

Thank you for your contribution, @07ARB . I updated the PR title. You can see the available labels here (https://github.com/apache/spark/labels). We need to use use WEBUI tag.

ok to test

Test build #112489 has started for PR 26216 at commit bd6b62f.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/17455/
Test PASSed.

Test build #112489 has finished for PR 26216 at commit bd6b62f.

This patch fails Scala style tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test FAILed.

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/112489/
Test FAILed.

Thank you for your contribution, @07ARB . I updated the PR title. You can see the available labels here (https://github.com/apache/spark/labels). We need to use use WEBUI tag.
Thank you, and from next time onward I will remember to use correct labels.

Test build #112490 has started for PR 26216 at commit ebef6d6.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/17456/
Test PASSed.

Test build #112490 has finished for PR 26216 at commit ebef6d6.

This patch fails Spark unit tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test FAILed.

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/112490/
Test FAILed.

retest this please

Test build #112512 has started for PR 26216 at commit ebef6d6.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/17476/
Test PASSed.

ok

@07ARB . I updated the PR description a little.

Thank you all , i will work on given comments and will raise PR again.

Test build #112512 has finished for PR 26216 at commit ebef6d6.

This patch fails due to an unknown error code, -9.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test FAILed.

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/112512/
Test FAILed.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/17501/
Test PASSed.

Test build #112537 has started for PR 26216 at commit 7123a2f.

Test build #112537 has finished for PR 26216 at commit 7123a2f.

This patch fails Scala style tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test FAILed.

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/112537/
Test FAILed.

Test build #112553 has started for PR 26216 at commit 811083a.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/17517/
Test PASSed.

Test build #112556 has started for PR 26216 at commit cbcab45.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/17520/
Test PASSed.

Test build #112553 has finished for PR 26216 at commit 811083a.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/112553/
Test PASSed.

@dongjoon-hyun, please review the latest changes.

Test build #112556 has finished for PR 26216 at commit cbcab45.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/112556/
Test PASSed.

screenshot after fixed all the review comments

Test build #112666 has started for PR 26216 at commit 0eeb5df.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/17622/
Test PASSed.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/17624/
Test PASSed.

Test build #112668 has started for PR 26216 at commit 0d5062f.

Test build #112670 has started for PR 26216 at commit e958370.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/17626/
Test PASSed.

Test build #112670 has finished for PR 26216 at commit e958370.

This patch fails Scala style tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test FAILed.

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/112670/
Test FAILed.

Test build #112666 has finished for PR 26216 at commit 0eeb5df.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/112666/
Test PASSed.

Test build #112668 has finished for PR 26216 at commit 0d5062f.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/112668/
Test PASSed.


Leaderboard Update, in sync with BFCL April 28th

This PR updates website leaderboard according with newly added model snowflake/arctic from #397
This PR DOES change the leaderboard score.

Mention in the description, the value for other rows stays the same. Only the addition of a new entry.


Upload current version of the MS Visio DFD

This way we can continually make changes to the DFD and use the latest version for our screenshots

InitialDFD.vsdx uploaded to repo.


Ollama: support tools in streaming mode

Issue

Closes #1971
Change

Add support for tool calling in Ollama in streaming scenario.
General checklist

[x] There are no breaking changes
[x] I have added unit and integration tests for my change
[x] I have manually run all the unit and integration tests in the module I have added/changed, and they are all green
[ ] I have manually run all the unit and integration tests in the core and main modules, and they are all green

[ ] I have added/updated the documentation
[ ] I have added an example in the examples repo (only for "big" features)
[ ] I have added/updated Spring Boot starter(s) (if applicable)

Checklist for adding new maven module

[ ] I have added my new module in the root pom.xml and langchain4j-bom/pom.xml

Checklist for adding new embedding store integration

[ ] I have added a {NameOfIntegration}EmbeddingStoreIT that extends from either EmbeddingStoreIT or EmbeddingStoreWithFilteringIT
[ ] I have added a {NameOfIntegration}EmbeddingStoreRemovalIT that extends from EmbeddingStoreWithRemovalIT

Checklist for changing existing embedding store integration

[ ] I have manually verified that the {NameOfIntegration}EmbeddingStore works correctly with the data persisted using the latest released version of LangChain4j

I don't have much experience with thread safe code, so please pay attentions to OllamaStreamingResponseBuilder. Is creation of simple array list sufficient ?

@bidek thanks a lot!
While this PR is still in progress, there is already a comprehensive set of integration tests that each model should pass. It would be awesome if you could checkout new-chat-model-api branch, open OllamaStreamingChatModelIT from dev.langchain4j.model.ollama.common package, change supportsTools() to return true and run it. Thank you in advance!🙏

@langchain4j
I merged the current version of this branch into the specified PR.
It fails on the following line:
assertThat(streamingMetadata2.timesOnPartialResponseWasCalled()).isGreaterThan(1);

For some reason, the model responds without a streaming answer and returns the entire answer instead.
Here are logs from whole comunication:
2024-12-07 12:59:27 [OkHttp http://localhost:32860/...] dev.langchain4j.model.ollama.OllamaRequestLoggingInterceptor.log()
DEBUG: Request:
- method: POST
- url: http://localhost:32860/api/chat
- headers:
- body: {
  "model" : "llama3.1",
  "messages" : [ {
    "role" : "user",
    "content" : "What is the weather in Munich?"
  } ],
  "options" : {
    "temperature" : 0.0
  },
  "stream" : true,
  "tools" : [ {
    "type" : "function",
    "function" : {
      "name" : "weather",
      "parameters" : {
        "type" : "object",
        "properties" : {
          "city" : {
            "type" : "string"
          }
        },
        "required" : [ ]
      }
    }
  } ]
}
2024-12-07 12:59:29 [OkHttp http://localhost:32860/...] dev.langchain4j.model.ollama.OllamaClient.onResponse()
DEBUG: Streaming partial response: {"model":"llama3.1","created_at":"2024-12-07T11:59:29.810997963Z","message":{"role":"assistant","content":"","tool_calls":[{"function":{"name":"weather","arguments":{"city":"Munich"}}}]},"done":false}
2024-12-07 12:59:29 [OkHttp http://localhost:32860/...] dev.langchain4j.model.ollama.OllamaClient.onResponse()
DEBUG: Streaming partial response: {"model":"llama3.1","created_at":"2024-12-07T11:59:29.842415026Z","message":{"role":"assistant","content":""},"done_reason":"stop","done":true,"total_duration":2186487985,"load_duration":1581888985,"prompt_eval_count":152,"prompt_eval_duration":140000000,"eval_count":18,"eval_duration":460000000}
2024-12-07 13:01:20 [OkHttp http://localhost:32860/...] dev.langchain4j.model.ollama.OllamaRequestLoggingInterceptor.log()
DEBUG: Request:
- method: POST
- url: http://localhost:32860/api/chat
- headers:
- body: {
  "model" : "llama3.1",
  "messages" : [ {
    "role" : "user",
    "content" : "What is the weather in Munich?"
  }, {
    "role" : "assistant",
    "tool_calls" : [ {
      "function" : {
        "name" : "weather",
        "arguments" : {
          "city" : "Munich"
        }
      }
    } ]
  }, {
    "role" : "tool",
    "content" : "sunny"
  } ],
  "options" : {
    "temperature" : 0.0
  },
  "stream" : true,
  "tools" : [ {
    "type" : "function",
    "function" : {
      "name" : "weather",
      "parameters" : {
        "type" : "object",
        "properties" : {
          "city" : {
            "type" : "string"
          }
        },
        "required" : [ ]
      }
    }
  } ]
}
2024-12-07 13:01:21 [OkHttp http://localhost:32860/...] dev.langchain4j.model.ollama.OllamaClient.onResponse()
DEBUG: Streaming partial response: {"model":"llama3.1","created_at":"2024-12-07T12:01:21.606583703Z","message":{"role":"assistant","content":"I called the weather API to get the current conditions for Munich, and it appears that it's sunny there."},"done_reason":"stop","done":true,"total_duration":644920680,"load_duration":17185139,"prompt_eval_count":93,"prompt_eval_duration":2000000,"eval_count":23,"eval_duration":624000000}

@bidek thanks a lot for looking into it!
Perhaps this is how Ollama handles tool calls in the streaming mode? Does it behave the same way when used via python SDK/curl?

Hey @bidek for your work!
And thanks to both of you for integrating streaming tool support.
This PR is very hot right now and we really need this. We were waiting for the ollama change for while.
Is there any way I can help you guys bring this to a new release?

@dkraemerwork thank you, it would help if you could find docu and/or investigate how Ollama does streaming when calling tools. From the logs @bidek provided it seems that it behaves differently from all other LLM providers. It would be great to understand the reason for that discrepancy and if there Ollama team has plans to change that. The implementation in this PR will depend on the answer.

OK, I dug through Ollama issues on GitHub and found this:
https://github.com/ollama/ollama/issues/5796#issuecomment-2508764074
This confirms that this is the expected behavior.
Here is a discussion about changing this behavior sometime in the future:
https://github.com/ollama/ollama/issues/7886
Additionally, I tested it through Postman.
Sending this request with tools attached in the body.
{
  "model" : "llama3.1",
  "messages" : [ {
    "role" : "user",
    "content" : "What is the weather in Munich?"
  }, {
    "role" : "assistant",
    "tool_calls" : [ {
      "function" : {
        "name" : "weather",
        "arguments" : {
          "city" : "Munich"
        }
      }
    } ]
  }, {
    "role" : "tool",
    "content" : "sunny"
  } ],
  "options" : {
    "temperature" : 0.0
  },
  "stream" : true,
  "tools" : [ {
    "type" : "function",
    "function" : {
      "name" : "weather",
      "parameters" : {
        "type" : "object",
        "properties" : {
          "city" : {
            "type" : "string"
          }
        },
        "required" : [ ]
      }
    }
  } ]
}

Respond as:
{
    "model": "llama3.1",
    "created_at": "2024-12-10T13:49:29.344085844Z",
    "message": {
        "role": "assistant",
        "content": "I called the weather API to get the current conditions for Munich, and it appears that it's sunny there."
    },
    "done_reason": "stop",
    "done": true,
    "total_duration": 586547065,
    "load_duration": 13519019,
    "prompt_eval_count": 93,
    "prompt_eval_duration": 15000000,
    "eval_count": 23,
    "eval_duration": 555000000
}

Sending the same request without the tools section.
{
  "model" : "llama3.1",
  "messages" : [ {
    "role" : "user",
    "content" : "What is the weather in Munich?"
  }, {
    "role" : "assistant",
    "tool_calls" : [ {
      "function" : {
        "name" : "weather",
        "arguments" : {
          "city" : "Munich"
        }
      }
    } ]
  }, {
    "role" : "tool",
    "content" : "sunny"
  } ],
  "options" : {
    "temperature" : 0.0
  },
  "stream" : true
}

Response:
{
    "model": "llama3.1",
    "created_at": "2024-12-10T13:50:47.477730927Z",
    "message": {
        "role": "assistant",
        "content": "I"
    },
    "done": false
}
{
    "model": "llama3.1",
    "created_at": "2024-12-10T13:50:47.497021853Z",
    "message": {
        "role": "assistant",
        "content": " can"
    },
    "done": false
}
{
    "model": "llama3.1",
    "created_at": "2024-12-10T13:50:47.514400368Z",
    "message": {
        "role": "assistant",
        "content": "'t"
    },
    "done": false
}
{
    "model": "llama3.1",
    "created_at": "2024-12-10T13:50:47.533297663Z",
    "message": {
        "role": "assistant",
        "content": " provide"
    },
    "done": false
}
{
    "model": "llama3.1",
    "created_at": "2024-12-10T13:50:47.55636412Z",
    "message": {
        "role": "assistant",
        "content": " real"
    },
    "done": false
}
{
    "model": "llama3.1",
    "created_at": "2024-12-10T13:50:47.579407917Z",
    "message": {
        "role": "assistant",
        "content": "-time"
    },
    "done": false
}
{
    "model": "llama3.1",
    "created_at": "2024-12-10T13:50:47.60343883Z",
    "message": {
        "role": "assistant",
        "content": " weather"
    },
    "done": false
}
{
    "model": "llama3.1",
    "created_at": "2024-12-10T13:50:47.626355687Z",
    "message": {
        "role": "assistant",
        "content": " information"
    },
    "done": false
}
{
    "model": "llama3.1",
    "created_at": "2024-12-10T13:50:47.650716075Z",
    "message": {
        "role": "assistant",
        "content": "."

    },
    "done": false
}
{
    "model": "llama3.1",
    "created_at": "2024-12-10T13:50:48.963060656Z",
    "message": {
        "role": "assistant",
        "content": ""
    },
    "done_reason": "stop",
    "done": true,
    "total_duration":<PHONE_NUMBER>,
    "load_duration": 12088173,
    "prompt_eval_count": 46,
    "prompt_eval_duration": 43000000,
    "eval_count": 62,
    "eval_duration":<PHONE_NUMBER>
}

To conclude:
When a tool execution request occurs, Ollama sends two "packets": one for the tool execution request and another indicating that streaming is complete.
However, when tools are attached to the request but the model does not request tool execution, Ollama sends only one "packet," even if streaming is enabled.

@bidek thanks a lot for digging into it!

Here is a discussion about changing this behavior sometime in the future:
https://github.com/ollama/ollama/issues/7886

Hmm, it does not seem to mention anything about returning tool calls in one vs multiple SSE events/"packets"

However, when tools are attached to the request but the model does not request tool execution, Ollama sends only one "packet," even if streaming is enabled.

So this means that the streaming is "broken" if tools are used (even if no tool is called)?

Does this mean we are unable to use Streaming Responses for Tool calls using Ollama? Is there some workaround possible?

@dkraemerwork what do you mean?
This PR adds the support for tools in streaming mode

I think it is good for the first iteration, wouls like to include it in the next release