mirror of
https://github.com/sst/opencode.git
synced 2025-08-04 05:28:16 +00:00
fix: default provider and model
This commit is contained in:
parent
3c94d26570
commit
2d15c683e0
1 changed files with 8 additions and 5 deletions
|
@ -38,11 +38,10 @@ var Info AppInfo
|
|||
func New(ctx context.Context, version string, httpClient *client.ClientWithResponses) (*App, error) {
|
||||
appInfoResponse, _ := httpClient.PostAppInfoWithResponse(ctx)
|
||||
appInfo := appInfoResponse.JSON200
|
||||
Info = AppInfo{Version: version}
|
||||
Info.Git = appInfo.Git
|
||||
Info.Path = appInfo.Path
|
||||
Info.Time = appInfo.Time
|
||||
Info.User = appInfo.User
|
||||
Info = AppInfo{
|
||||
AppInfo: *appInfo,
|
||||
Version: version,
|
||||
}
|
||||
|
||||
providersResponse, err := httpClient.PostProviderListWithResponse(ctx)
|
||||
if err != nil {
|
||||
|
@ -97,6 +96,10 @@ func New(ctx context.Context, version string, httpClient *client.ClientWithRespo
|
|||
}
|
||||
}
|
||||
}
|
||||
if currentProvider == nil || currentModel == nil {
|
||||
currentProvider = defaultProvider
|
||||
currentModel = defaultModel
|
||||
}
|
||||
|
||||
app := &App{
|
||||
ConfigPath: appConfigPath,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue