@@ -8,11 +8,13 @@ import (
88 "github.com/docker/cli/cli/config/types"
99)
1010
11+ const ctxSeparator = "///"
12+
1113type CredentialType string
1214
1315const (
1416 CredentialTypeTool CredentialType = "tool"
15- CredentialTypeModelProvider CredentialType = "modelprovider "
17+ CredentialTypeModelProvider CredentialType = "modelProvider "
1618)
1719
1820type Credential struct {
@@ -50,7 +52,7 @@ func credentialFromDockerAuthConfig(authCfg types.AuthConfig) (Credential, error
5052
5153 // If it's a tool credential or sys.openai, remove the http[s] prefix.
5254 address := authCfg .ServerAddress
53- if credType == string (CredentialTypeTool ) || strings .HasPrefix (address , "https://sys.openai///" ) {
55+ if credType == string (CredentialTypeTool ) || strings .HasPrefix (address , "https://sys.openai" + ctxSeparator ) {
5456 address = strings .TrimPrefix (strings .TrimPrefix (address , "https://" ), "http://" )
5557 }
5658
@@ -68,13 +70,13 @@ func credentialFromDockerAuthConfig(authCfg types.AuthConfig) (Credential, error
6870}
6971
7072func toolNameWithCtx (toolName , credCtx string ) string {
71- return toolName + "///" + credCtx
73+ return toolName + ctxSeparator + credCtx
7274}
7375
7476func toolNameAndCtxFromAddress (address string ) (string , string , error ) {
75- parts := strings .Split (address , "///" )
77+ parts := strings .Split (address , ctxSeparator )
7678 if len (parts ) != 2 {
77- return "" , "" , fmt .Errorf ("error parsing tool name and context %q. Tool names cannot contain '/// '" , address )
79+ return "" , "" , fmt .Errorf ("error parsing tool name and context %q. Tool names cannot contain '%s '" , address , ctxSeparator )
7880 }
7981 return parts [0 ], parts [1 ], nil
8082}
0 commit comments