on main help sign in
chore: fix lint
commitd0fcb3f25dc0ec1e0393fe94b3ea7fee1e62306c authorKujtim Hoxha <kujtimii.h@gmail.com> dateMon 30 Jun 2025, 17:26 (1 year ago) parentf3f4d9d
2 files changed+6−5
internal/db/connect.go+2−1 internal/tui/tui.go+4−4
internal/db/connect.go+2−1
@@ -1,6 +1,7 @@
11package db
22
33import (
4+ "context"
45 "database/sql"
56 "fmt"
67 "os"
@@ -15,7 +16,7 @@ import (
1516 "github.com/pressly/goose/v3"
1617)
1718
18−func Connect() (*sql.DB, error) {
19+func Connect(ctx context.Context) (*sql.DB, error) {
1920 dataDir := config.Get().Options.DataDirectory
2021 if dataDir == "" {
2122 return nil, fmt.Errorf("data.dir is not set")
internal/tui/tui.go+4−4
@@ -230,20 +230,20 @@ func (a *appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
230230 contextWindow := model.ContextWindow
231231 usedTokens := session.CompletionTokens + session.PromptTokens
232232 remainingTokens := contextWindow - usedTokens
233−
233+
234234 // Get effective max tokens for this agent (considering overrides)
235235 maxTokens := a.app.CoderAgent.EffectiveMaxTokens()
236−
236+
237237 // Apply 10% margin to max tokens
238238 maxTokensWithMargin := int64(float64(maxTokens) * 1.1)
239−
239+
240240 // Trigger auto-summarize if remaining tokens < max tokens + 10% margin
241241 // Also ensure we have a reasonable minimum threshold to avoid too-frequent summaries
242242 minThreshold := int64(1000) // Minimum 1000 tokens remaining before triggering
243243 if maxTokensWithMargin < minThreshold {
244244 maxTokensWithMargin = minThreshold
245245 }
246−
246+
247247 if remainingTokens < maxTokensWithMargin && !config.Get().Options.DisableAutoSummarize {
248248 // Show compact confirmation dialog
249249 cmds = append(cmds, util.CmdHandler(dialogs.OpenDialogMsg{