summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoradamdottv <[email protected]>2025-06-16 10:51:01 -0500
committeradamdottv <[email protected]>2025-06-16 10:51:01 -0500
commit2d15c683e0db98fb5079aeb85f4fe12497bd677d (patch)
tree3784fda62ab1dbad6e8ef7dc8a652ff037a862ee
parent3c94d265701c710e3f5ad13f2212cb8476c6a674 (diff)
downloadopencode-2d15c683e0db98fb5079aeb85f4fe12497bd677d.tar.gz
opencode-2d15c683e0db98fb5079aeb85f4fe12497bd677d.zip
fix: default provider and model
-rw-r--r--packages/tui/internal/app/app.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/packages/tui/internal/app/app.go b/packages/tui/internal/app/app.go
index 5bc8eb656..7602bfa17 100644
--- a/packages/tui/internal/app/app.go
+++ b/packages/tui/internal/app/app.go
@@ -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,