Show recorded OpenCode models in the chat list
This commit is contained in:
@@ -42,11 +42,13 @@ type Chat struct {
|
||||
// operation and status on the shared connection, so two calls must not
|
||||
// overlap; the permission poller runs alongside the read loop's
|
||||
// prompt/interrupt/reply calls.
|
||||
mu sync.Mutex
|
||||
usageMu sync.Mutex
|
||||
usageModels map[string]usageModelCache
|
||||
modeMu sync.Mutex
|
||||
agents map[string]string
|
||||
mu sync.Mutex
|
||||
usageMu sync.Mutex
|
||||
usageModels map[string]usageModelCache
|
||||
modeMu sync.Mutex
|
||||
agents map[string]string
|
||||
modelMu sync.Mutex
|
||||
sessionModels map[string]sessionModelCache
|
||||
}
|
||||
|
||||
// NewChat brokers chat for one owned OpenCode endpoint. The connection must be
|
||||
@@ -234,6 +236,9 @@ func (c *Chat) SwitchModel(ctx context.Context, id, provider, model string) erro
|
||||
}
|
||||
return err
|
||||
}
|
||||
c.modelMu.Lock()
|
||||
delete(c.sessionModels, id)
|
||||
c.modelMu.Unlock()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user