on main help sign in
Merge branch 'main' into ui
commit268d3e26043f4dc35b11b837bf132d464b7dec2f authorAyman Bagabas <ayman.bagabas@gmail.com> dateMon 24 Nov 2025, 13:58 (1 year ago) parent22040d2a34a8a3
11 files changed+64−17
.github/cla-signatures.json+8 .github/workflows/nightly.yml+1−1 .github/workflows/schema-update.yml+2−2 crush.json+35−1 internal/agent/tools/edit.go+4−4 internal/agent/tools/multiedit.go+3−3 internal/agent/tools/write.go+2−2 internal/lsp/client.go+1−1 internal/tui/components/core/status/status.go+5−1 internal/tui/tui.go+2−2 internal/tui/util/util.go+1
.github/cla-signatures.json+8
@@ -871,6 +871,14 @@
871871 "created_at": "2025-11-19T15:59:07Z",
872872 "repoId": 987670088,
873873 "pullRequestNo": 1478
874+ },
875+ {
876+ "name": "heimoshuiyu",
877+ "id": 22657774,
878+ "comment_id": 3565689668,
879+ "created_at": "2025-11-22T05:23:17Z",
880+ "repoId": 987670088,
881+ "pullRequestNo": 1496
874882 }
875883 ]
876884}
.github/workflows/nightly.yml+1−1
@@ -11,7 +11,7 @@ jobs:
1111 outputs:
1212 should_run: ${{ steps.check.outputs.should_run }}
1313 steps:
14− - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
14+ - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
1515 with:
1616 fetch-depth: 1
1717 - id: check
.github/workflows/schema-update.yml+2−2
@@ -10,10 +10,10 @@ jobs:
1010 update-schema:
1111 runs-on: ubuntu-latest
1212 steps:
13− - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
13+ - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
1414 with:
1515 token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
16− - uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
16+ - uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
1717 with:
1818 go-version-file: go.mod
1919 - run: go run . schema > ./schema.json
crush.json+35−1
@@ -1,6 +1,40 @@
11{
22 "$schema": "https://charm.land/crush.json",
33 "lsp": {
4− "gopls": {}
4+ "gopls": {
5+ "options": {
6+ "gofumpt": true,
7+ "codelenses": {
8+ "gc_details": true,
9+ "generate": true,
10+ "run_govulncheck": true,
11+ "test": true,
12+ "tidy": true,
13+ "upgrade_dependency": true
14+ },
15+ "hints": {
16+ "assignVariableTypes": true,
17+ "compositeLiteralFields": true,
18+ "compositeLiteralTypes": true,
19+ "constantValues": true,
20+ "functionTypeParameters": true,
21+ "parameterNames": true,
22+ "rangeVariableTypes": true
23+ },
24+ "analyses": {
25+ "nilness": true,
26+ "unusedparams": true,
27+ "unusedvariable": true,
28+ "unusedwrite": true,
29+ "useany": true
30+ },
31+ "staticcheck": true,
32+ "directoryFilters": [
33+ "-.git",
34+ "-node_modules"
35+ ],
36+ "semanticTokens": true
37+ }
38+ }
539 }
640}
internal/agent/tools/edit.go+4−4
@@ -163,7 +163,7 @@ func createNewFile(edit editContext, filePath, content string, call fantasy.Tool
163163 _, err = edit.files.CreateVersion(edit.ctx, sessionID, filePath, content)
164164 if err != nil {
165165 // Log error but don't fail the operation
166− slog.Debug("Error creating file history version", "error", err)
166+ slog.Error("Error creating file history version", "error", err)
167167 }
168168
169169 recordFileWrite(filePath)
@@ -290,13 +290,13 @@ func deleteContent(edit editContext, filePath, oldString string, replaceAll bool
290290 // User Manually changed the content store an intermediate version
291291 _, err = edit.files.CreateVersion(edit.ctx, sessionID, filePath, oldContent)
292292 if err != nil {
293− slog.Debug("Error creating file history version", "error", err)
293+ slog.Error("Error creating file history version", "error", err)
294294 }
295295 }
296296 // Store the new version
297297 _, err = edit.files.CreateVersion(edit.ctx, sessionID, filePath, "")
298298 if err != nil {
299− slog.Debug("Error creating file history version", "error", err)
299+ slog.Error("Error creating file history version", "error", err)
300300 }
301301
302302 recordFileWrite(filePath)
@@ -431,7 +431,7 @@ func replaceContent(edit editContext, filePath, oldString, newString string, rep
431431 // Store the new version
432432 _, err = edit.files.CreateVersion(edit.ctx, sessionID, filePath, newContent)
433433 if err != nil {
434− slog.Debug("Error creating file history version", "error", err)
434+ slog.Error("Error creating file history version", "error", err)
435435 }
436436
437437 recordFileWrite(filePath)
internal/agent/tools/multiedit.go+3−3
@@ -196,7 +196,7 @@ func processMultiEditWithCreation(edit editContext, params MultiEditParams, call
196196
197197 _, err = edit.files.CreateVersion(edit.ctx, sessionID, params.FilePath, currentContent)
198198 if err != nil {
199− slog.Debug("Error creating file history version", "error", err)
199+ slog.Error("Error creating file history version", "error", err)
200200 }
201201
202202 recordFileWrite(params.FilePath)
@@ -338,14 +338,14 @@ func processMultiEditExistingFile(edit editContext, params MultiEditParams, call
338338 // User manually changed the content, store an intermediate version
339339 _, err = edit.files.CreateVersion(edit.ctx, sessionID, params.FilePath, oldContent)
340340 if err != nil {
341− slog.Debug("Error creating file history version", "error", err)
341+ slog.Error("Error creating file history version", "error", err)
342342 }
343343 }
344344
345345 // Store the new version
346346 _, err = edit.files.CreateVersion(edit.ctx, sessionID, params.FilePath, currentContent)
347347 if err != nil {
348− slog.Debug("Error creating file history version", "error", err)
348+ slog.Error("Error creating file history version", "error", err)
349349 }
350350
351351 recordFileWrite(params.FilePath)
internal/agent/tools/write.go+2−2
@@ -147,13 +147,13 @@ func NewWriteTool(lspClients *csync.Map[string, *lsp.Client], permissions permis
147147 // User Manually changed the content store an intermediate version
148148 _, err = files.CreateVersion(ctx, sessionID, filePath, oldContent)
149149 if err != nil {
150− slog.Debug("Error creating file history version", "error", err)
150+ slog.Error("Error creating file history version", "error", err)
151151 }
152152 }
153153 // Store the new version
154154 _, err = files.CreateVersion(ctx, sessionID, filePath, params.Content)
155155 if err != nil {
156− slog.Debug("Error creating file history version", "error", err)
156+ slog.Error("Error creating file history version", "error", err)
157157 }
158158
159159 recordFileWrite(filePath)
internal/lsp/client.go+1−1
@@ -417,7 +417,7 @@ func (c *Client) openKeyConfigFiles(ctx context.Context) {
417417 if _, err := os.Stat(file); err == nil {
418418 // File exists, try to open it
419419 if err := c.OpenFile(ctx, file); err != nil {
420− slog.Debug("Failed to open key config file", "file", file, "error", err)
420+ slog.Error("Failed to open key config file", "file", file, "error", err)
421421 } else {
422422 slog.Debug("Opened key config file for initialization", "file", file)
423423 }
internal/tui/components/core/status/status.go+5−1
@@ -82,7 +82,11 @@ func (m *statusCmp) infoMsg() string {
8282 info := ansi.Truncate(m.info.Msg, widthLeft, "…")
8383 message = t.S().Base.Foreground(t.BgOverlay).Width(widthLeft+2).Background(t.Warning).Padding(0, 1).Render(info)
8484 default:
85− infoType = t.S().Base.Foreground(t.BgSubtle).Background(t.Green).Padding(0, 1).Bold(true).Render("HEY!")
85+ note := "OKAY!"
86+ if m.info.Type == util.InfoTypeUpdate {
87+ note = "HEY!"
88+ }
89+ infoType = t.S().Base.Foreground(t.BgSubtle).Background(t.Green).Padding(0, 1).Bold(true).Render(note)
8690 widthLeft := m.width - (lipgloss.Width(infoType) + 2)
8791 info := ansi.Truncate(m.info.Msg, widthLeft, "…")
8892 message = t.S().Base.Background(t.GreenDark).Width(widthLeft+2).Foreground(t.BgSubtle).Padding(0, 1).Render(info)
internal/tui/tui.go+2−2
@@ -380,9 +380,9 @@ func (a *appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
380380 statusMsg = fmt.Sprintf("This is a development version of Crush. The latest version is v%s.", msg.LatestVersion)
381381 }
382382 s, statusCmd := a.status.Update(util.InfoMsg{
383− Type: util.InfoTypeInfo,
383+ Type: util.InfoTypeUpdate,
384384 Msg: statusMsg,
385− TTL: 30 * time.Second,
385+ TTL: 10 * time.Second,
386386 })
387387 a.status = s.(status.StatusCmp)
388388 return a, statusCmd
internal/tui/util/util.go+1
@@ -38,6 +38,7 @@ const (
3838 InfoTypeSuccess
3939 InfoTypeWarn
4040 InfoTypeError
41+ InfoTypeUpdate
4142)
4243
4344func ReportInfo(info string) tea.Cmd {