Skip to content

Commit 7f11c44

Browse files
author
razvan
committed
fix: resolve all Copilot review comments from PR #25
- config/loader.go: remove misleading force_reindex mention, keep only recreate: true - tools/index_workspace.go: fix tool name (search_code -> rag_search/rag_search_code); gate runtime info behind include_runtime_info flag - tools/doc_find_usages.md: fix JSON filter key casing Relations[] -> relations[] - tools/README.md: fix Determinist -> Deterministic; Relations[] casing; file_path MANDATORY -> PREFER - tools/find_usages.go: deduplicate matchedRelations - tools/list_package_exports.go: is_public fallback Go-only; filePath -> payloadFilePath - engine/index_progress.go: deep-copy Languages map in disk-load branch - logger/logger.go: Warn() writes to log file; shouldLog() defaults unknown level to info - .goreleaser.yaml: remove deleted config.yaml from archives - .github/workflows/build-binaries.yml: fix path ./cmd/install -> ./cmd/rag-code-install - README.md: fix broken links to deleted docs files - QUICKSTART.md, config/README.md, search/README.md, cmd/sse-client-test: doc fixes
1 parent e1f8e6d commit 7f11c44

File tree

8 files changed

+46
-21
lines changed

8 files changed

+46
-21
lines changed

.github/workflows/build-binaries.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
go build -o bin/index-all ./cmd/index-all
4646
4747
echo "Building rag-code-install..."
48-
go build -o bin/rag-code-install ./cmd/install
48+
go build -o bin/rag-code-install ./cmd/rag-code-install
4949
5050
chmod +x bin/*
5151

.goreleaser.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ archives:
111111
- LICENSE
112112
- README.md
113113
- llms.txt
114-
- config.yaml
115114
- .env.example
116115

117116
checksum:

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ First query triggers background indexing. Subsequent queries are instant.
104104
| [🛠️ MCP Tools](#️-11-powerful-mcp-tools) | All 11 tools explained |
105105
| [🌐 Supported Languages](#-multi-language-code-intelligence) | Go, PHP, Python support |
106106
| [💻 IDE Integration](#-ide-integration) | Windsurf, Cursor, VS Code, Claude |
107-
| [⚙️ Configuration](./docs/configuration.md) | Advanced settings, models, env vars |
108-
| [🐛 Troubleshooting](./docs/troubleshooting.md) | Common issues and solutions |
107+
| [⚙️ Configuration](#-configuration) | Advanced settings, models, env vars |
108+
| [🐛 Troubleshooting](#-troubleshooting) | Common issues and solutions |
109109
| [📚 Documentation](#-documentation) | All guides and references |
110110
111111
---
@@ -264,9 +264,8 @@ RagCode works with all major AI-powered IDEs:
264264
- **[IDE Setup](./docs/IDE-SETUP.md)** - Manual IDE configuration
265265
266266
### Configuration & Operations
267-
- **[Configuration Guide](./docs/configuration.md)** - Models, env vars, advanced settings
268-
- **[Troubleshooting](./docs/troubleshooting.md)** - Common issues and solutions
269-
- **[Docker Setup](./docs/docker-setup.md)** - Docker configuration details
267+
- **[Configuration Guide](#-configuration)** - Models, env vars, advanced settings
268+
- **[Troubleshooting](#-troubleshooting)** - Common issues and solutions
270269
271270
### Language Analyzers
272271
- **[Go Analyzer](./internal/ragcode/analyzers/golang/README.md)** - Functions, types, interfaces, GoDoc

internal/logger/logger.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,15 @@ func (l *SimpleLogger) shouldLog(msgLevel string) bool {
5050
if logLevel == "" {
5151
logLevel = "info"
5252
}
53-
return levels[msgLevel] >= levels[logLevel]
53+
configuredLevel, ok := levels[logLevel]
54+
if !ok {
55+
configuredLevel = levels["info"]
56+
}
57+
msgLevelValue, ok := levels[msgLevel]
58+
if !ok {
59+
return false
60+
}
61+
return msgLevelValue >= configuredLevel
5462
}
5563

5664
// Debug logs a debug message (only if MCP_LOG_LEVEL is set to 'debug').
@@ -87,6 +95,9 @@ func (l *SimpleLogger) Error(format string, args ...interface{}) {
8795
func (l *SimpleLogger) Warn(format string, args ...interface{}) {
8896
if l.shouldLog("warn") {
8997
fmt.Fprintf(os.Stderr, "[WARN] "+format+"\n", args...)
98+
if l.writer != nil {
99+
fmt.Fprintf(l.writer, "[WARN] "+format+"\n", args...)
100+
}
90101
}
91102
}
92103

internal/service/engine/index_progress.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ func (s *progressStore) get(workspaceID string, workspaceRoot string) *IndexProg
5757
if p := loadIndexStatus(workspaceRoot); p != nil && p.WorkspaceID == workspaceID {
5858
s.jobs[workspaceID] = p // cache in memory for subsequent calls
5959
cp := *p
60+
if p.Languages != nil {
61+
cp.Languages = make(map[string]IndexLanguageProgress, len(p.Languages))
62+
for k, v := range p.Languages {
63+
cp.Languages[k] = v
64+
}
65+
}
6066
return &cp
6167
}
6268
}

internal/service/tools/doc_find_usages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ It completely **bypasses the Semantic Embedder (LLM)** and issues an Exact Match
1919
}
2020
```
2121

22-
By querying the exact path of the payload JSON, the database operates efficiently and precisely, scanning the `Relations` arrays of every indexed AST node (both methods, classes or standalone functions) to identify callers, implementers, and dependent types referencing the `SymbolName`.
22+
By querying the exact path of the payload JSON, the database operates efficiently and precisely, scanning the `relations` arrays of every indexed AST node (both methods, classes or standalone functions) to identify callers, implementers, and dependent types referencing the `SymbolName`.
2323

2424
## Features
2525
- **Deterministic and Robust**: Resolves complex usage paths correctly regardless of lexical variations or generic terms used by developers. Zero semantic hallucinations!

internal/service/tools/find_usages.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,19 @@ func (t *FindUsagesTool) Execute(ctx context.Context, args map[string]interface{
150150
startLine = v
151151
}
152152

153-
// Extract exactly which relation(s) matched to show reasoning
153+
// Extract exactly which relation type(s) matched to show reasoning (deduplicated)
154+
seenRelTypes := make(map[string]struct{})
154155
var matchedRelations []string
155156
if relationsRaw, hasRel := result.Point.Payload["relations"]; hasRel {
156157
if relList, ok := relationsRaw.([]interface{}); ok {
157158
for _, relItem := range relList {
158159
if rMap, ok := relItem.(map[string]interface{}); ok {
159160
if target, _ := rMap["target_name"].(string); target == symbolName {
160161
relType, _ := rMap["type"].(string)
161-
matchedRelations = append(matchedRelations, relType)
162+
if _, seen := seenRelTypes[relType]; !seen {
163+
seenRelTypes[relType] = struct{}{}
164+
matchedRelations = append(matchedRelations, relType)
165+
}
162166
}
163167
}
164168
}

internal/service/tools/list_package_exports.go

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,19 @@ func (t *ListPackageExportsTool) Execute(ctx context.Context, args map[string]in
135135
actualBytes := 0
136136

137137
for _, result := range allResults {
138-
// is_public filter: use payload field when present, fallback to naming convention
139-
isPublic, _ := result.Point.Payload["is_public"].(bool)
140-
if !isPublic {
141-
name, _ := result.Point.Payload["name"].(string)
142-
if !isExported(name) {
138+
// is_public filter: prefer explicit payload field; fallback to naming convention only for Go
139+
if isPublicVal, ok := result.Point.Payload["is_public"]; ok {
140+
if isPublic, okBool := isPublicVal.(bool); okBool && !isPublic {
143141
continue
144142
}
143+
} else {
144+
lang, _ := result.Point.Payload["language"].(string)
145+
if strings.EqualFold(lang, "go") {
146+
name, _ := result.Point.Payload["name"].(string)
147+
if !isExported(name) {
148+
continue
149+
}
150+
}
145151
}
146152

147153
name, _ := result.Point.Payload["name"].(string)
@@ -160,7 +166,7 @@ func (t *ListPackageExportsTool) Execute(ctx context.Context, args map[string]in
160166
docstring, _ := result.Point.Payload["docstring"].(string)
161167

162168
descLine := strings.Split(docstring, "\n")[0]
163-
filePath, _ := result.Point.Payload["file_path"].(string)
169+
payloadFilePath, _ := result.Point.Payload["file_path"].(string)
164170
startLineVal := result.Point.Payload["start_line"]
165171
startLine := 0
166172
switch v := startLineVal.(type) {
@@ -173,9 +179,9 @@ func (t *ListPackageExportsTool) Execute(ctx context.Context, args map[string]in
173179
relsRaw, _ := result.Point.Payload["relations"].([]interface{})
174180

175181
actualBytes += len(name) + len(signature) + len(descLine)
176-
if filePath != "" && !seenFiles[filePath] {
177-
seenFiles[filePath] = true
178-
if info, statErr := os.Stat(filePath); statErr == nil {
182+
if payloadFilePath != "" && !seenFiles[payloadFilePath] {
183+
seenFiles[payloadFilePath] = true
184+
if info, statErr := os.Stat(payloadFilePath); statErr == nil {
179185
baselineBytes += int(info.Size())
180186
}
181187
}
@@ -185,7 +191,7 @@ func (t *ListPackageExportsTool) Execute(ctx context.Context, args map[string]in
185191
Type: symType,
186192
Signature: signature,
187193
Description: descLine,
188-
FilePath: filePath,
194+
FilePath: payloadFilePath,
189195
StartLine: startLine,
190196
Package: packageName,
191197
RelationsCount: len(relsRaw),

0 commit comments

Comments
 (0)