feat: manage global memsearch config via chezmoi - #874
Conversation
Onnx embedding, cross-encoder reranker, and shared user_profile maintenance (claude-code + opencode) writing to one global USER.md. Exclude modify_*.toml from taplo-format since it's a Go template, not valid TOML on its own.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR adds a new chezmoi template defining memsearch configuration (embedding provider, reranker model, and user profile plugins), a modify-template that merges this config with existing stdin TOML via mergeOverwrite, and a pre-commit exclusion rule for matching modify_*.toml files. ChangesMemsearch configuration setup
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅
|
| Descriptor | Linter | Files | Fixed | Errors | Warnings | Elapsed time |
|---|---|---|---|---|---|---|
| ✅ BASH | shfmt | 3 | 0 | 0 | 0 | 0.02s |
| prettier | 9 | 0 | 1 | 0 | 0.47s | |
| markdownlint | 6 | 0 | 2 | 0 | 0.56s | |
| ✅ MARKDOWN | markdown-table-formatter | 6 | 0 | 0 | 0 | 0.17s |
| ✅ YAML | prettier | 10 | 0 | 0 | 0 | 0.58s |
Detailed Issues
⚠️ MARKDOWN / markdownlint - 2 errors
chezmoi/private_dot_claude/modify_CLAUDE.md:1 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "{{- /*chezmoi:modify-template*..."]
chezmoi/private_dot_config/opencode/modify_AGENTS.md:1 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "{{- /*chezmoi:modify-template*..."]
⚠️ JSON / prettier - 1 error
chezmoi/.chezmoitemplates/claude-settings.json 84ms (unchanged)
chezmoi/.chezmoitemplates/mcp_servers.json 5ms (unchanged)
chezmoi/.chezmoitemplates/opencode-tui.json 3ms (unchanged)
chezmoi/.chezmoitemplates/opencode.json 5ms (unchanged)
[error] chezmoi/private_dot_claude/modify_settings.json: SyntaxError: Unexpected token (1:2)
[error] > 1 | {{- /* chezmoi:modify-template */ -}}
[error] | ^
[error] 2 | {{- $current := dict -}}
[error] 3 | {{- if .chezmoi.stdin | trim -}}
[error] 4 | {{- $current = fromJson .chezmoi.stdin -}}
[error] chezmoi/private_dot_config/mcp/modify_mcp_servers.json: SyntaxError: Unexpected token (1:2)
[error] > 1 | {{- /* chezmoi:modify-template */ -}}
[error] | ^
[error] 2 | {{- $current := dict -}}
[error] 3 | {{- if .chezmoi.stdin | trim -}}
[error] 4 | {{- $current = fromJson .chezmoi.stdin -}}
[error] chezmoi/private_dot_config/opencode/modify_opencode.json: SyntaxError: Unexpected token (1:2)
[error] > 1 | {{- /* chezmoi:modify-template */ -}}
[error] | ^
[error] 2 | {{- $current := dict -}}
[error] 3 | {{- if .chezmoi.stdin | trim -}}
[error] 4 | {{- $current = fromJson .chezmoi.stdin -}}
[error] chezmoi/private_dot_config/opencode/modify_tui.json: SyntaxError: Unexpected token (1:2)
[error] > 1 | {{- /* chezmoi:modify-template */ -}}
[error] | ^
[error] 2 | {{- $current := dict -}}
[error] 3 | {{- if .chezmoi.stdin | trim -}}
[error] 4 | {{- $current = fromJson .chezmoi.stdin -}}
renovate.json 5ms (unchanged)
Notices
📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)
See detailed reports in MegaLinter artifacts
Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)
- Documentation: Custom Flavors
- Command:
npx mega-linter-runner@9.5.0 --custom-flavor-setup --custom-flavor-linters BASH_SHFMT,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,YAML_PRETTIER

Show us your support by starring ⭐ the repository
There was a problem hiding this comment.
Code Review
This pull request introduces a new configuration template for memsearch and a chezmoi modify-template script to merge it with local configurations, while also updating pre-commit settings to exclude these files from formatting. Feedback points out a critical bug in the merge logic where mergeOverwrite is used instead of merge, which would incorrectly overwrite local user configurations with the template defaults instead of preserving them.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| {{- $current = fromToml .chezmoi.stdin -}} | ||
| {{- end -}} | ||
| {{- $template := includeTemplate "memsearch_config.toml" . | fromToml -}} | ||
| {{- $merged := mergeOverwrite $current $template -}} |
There was a problem hiding this comment.
Using mergeOverwrite $current $template causes the template values ($template) to overwrite the existing local configuration ($current), which is the opposite of the intended behavior of preserving local overrides. In Sprig, mergeOverwrite gives precedence from right to left (the rightmost argument overwrites the leftmost). To preserve local overrides, you should use merge $current $template instead. In Sprig, merge gives precedence to the destination dictionary (the first argument), meaning any existing keys in $current will be preserved, and only missing keys from $template will be added.
{{- $merged := merge $current $template -}}
✅
|
| Descriptor | Linter | Files | Fixed | Errors | Warnings | Elapsed time |
|---|---|---|---|---|---|---|
| ✅ BASH | bash-exec | 3 | 0 | 0 | 0.01s | |
| ✅ BASH | shellcheck | 3 | 0 | 0 | 0.14s | |
| ✅ REPOSITORY | checkov | yes | no | no | 22.5s | |
| ✅ REPOSITORY | devskim | yes | no | no | 1.86s | |
| ✅ REPOSITORY | dustilock | yes | no | no | 0.03s | |
| ✅ REPOSITORY | gitleaks | yes | no | no | 1.6s | |
| ✅ REPOSITORY | grype | yes | no | no | 48.88s | |
| ✅ REPOSITORY | kingfisher | yes | no | no | 9.84s | |
| osv-scanner | yes | 1 | no | 0.08s | ||
| ✅ REPOSITORY | secretlint | yes | no | no | 1.94s | |
| ✅ REPOSITORY | syft | yes | no | no | 2.35s | |
| ✅ REPOSITORY | trivy | yes | no | no | 10.88s | |
| ✅ REPOSITORY | trivy-sbom | yes | no | no | 0.09s | |
| ✅ REPOSITORY | trufflehog | yes | no | no | 3.45s |
Detailed Issues
⚠️ REPOSITORY / osv-scanner - 1 error
Scanning dir .
Starting filesystem walk for root: /
End status: 41 dirs visited, 144 inodes visited, 0 Extract calls, 2.935336ms elapsed, 2.935566ms wall time
No package sources found, --help for usage information.
Notices
📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)
See detailed reports in MegaLinter artifacts
Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)
- Documentation: Custom Flavors
- Command:
npx mega-linter-runner@9.5.0 --custom-flavor-setup --custom-flavor-linters BASH_EXEC,BASH_SHELLCHECK,REPOSITORY_CHECKOV,REPOSITORY_DEVSKIM,REPOSITORY_DUSTILOCK,REPOSITORY_GITLEAKS,REPOSITORY_GRYPE,REPOSITORY_OSV_SCANNER,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,REPOSITORY_KINGFISHER

Show us your support by starring ⭐ the repository
✅
|
| Descriptor | Linter | Files | Fixed | Errors | Warnings | Elapsed time |
|---|---|---|---|---|---|---|
| ✅ ACTION | actionlint | 5 | 0 | 0 | 0.33s | |
| ✅ ACTION | zizmor | 5 | 0 | 0 | 0 | 0.52s |
| ✅ BASH | bash-exec | 3 | 0 | 0 | 0.01s | |
| ✅ BASH | shellcheck | 3 | 0 | 0 | 0.08s | |
| ✅ BASH | shfmt | 3 | 0 | 0 | 0 | 0.02s |
| ✅ COPYPASTE | jscpd | yes | no | no | 0.8s | |
| ✅ EDITORCONFIG | editorconfig-checker | 72 | 0 | 0 | 0.09s | |
| prettier | 9 | 0 | 1 | 0 | 0.95s | |
| ✅ JSON | v8r | 9 | 0 | 0 | 5.88s | |
| markdownlint | 6 | 0 | 2 | 0 | 0.68s | |
| ✅ MARKDOWN | markdown-table-formatter | 6 | 0 | 0 | 0 | 0.2s |
| ✅ REPOSITORY | checkov | yes | no | no | 24.2s | |
| ✅ REPOSITORY | gitleaks | yes | no | no | 1.2s | |
| ✅ REPOSITORY | git_diff | yes | no | no | 0.01s | |
| ✅ REPOSITORY | grype | yes | no | no | 49.2s | |
| osv-scanner | yes | 1 | no | 0.17s | ||
| ✅ REPOSITORY | secretlint | yes | no | no | 1.45s | |
| ✅ REPOSITORY | syft | yes | no | no | 3.2s | |
| ✅ REPOSITORY | trivy | yes | no | no | 9.76s | |
| ✅ REPOSITORY | trivy-sbom | yes | no | no | 0.16s | |
| ✅ REPOSITORY | trufflehog | yes | no | no | 3.56s | |
| lychee | 25 | 2 | 0 | 1.07s | ||
| ✅ YAML | prettier | 10 | 0 | 0 | 0 | 0.65s |
| ✅ YAML | v8r | 10 | 0 | 0 | 8.69s | |
| ✅ YAML | yamllint | 10 | 0 | 0 | 0.42s |
Detailed Issues
⚠️ SPELL / lychee - 2 errors
📝 Summary
---------------------
🔍 Total...........21
🔗 Unique..........16
✅ Successful......19
⏳ Timeouts.........0
🔀 Redirected.......4
👻 Excluded.........0
❓ Unknown..........0
🚫 Errors...........2
⛔ Unsupported......2
Errors in chezmoi/.chezmoitemplates/mcp_servers.json
[406] https://mcp.deepwiki.com/mcp (at 11:15) | Rejected status code: 406 Not Acceptable
Errors in chezmoi/.chezmoitemplates/opencode.json
[406] https://mcp.deepwiki.com/mcp (at 24:15) | Rejected status code: 406 Not Acceptable
Hint: Followed 4 redirects. You might want to consider replacing redirecting URLs with the resolved URLs. Use verbose mode (`-v`/`-vv`) to see redirection details.
Hint: You can configure accepted/rejected response codes with `-a` or `--accept`
⚠️ MARKDOWN / markdownlint - 2 errors
chezmoi/private_dot_claude/modify_CLAUDE.md:1 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "{{- /*chezmoi:modify-template*..."]
chezmoi/private_dot_config/opencode/modify_AGENTS.md:1 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "{{- /*chezmoi:modify-template*..."]
⚠️ REPOSITORY / osv-scanner - 1 error
Scanning dir .
Starting filesystem walk for root: /
End status: 41 dirs visited, 144 inodes visited, 0 Extract calls, 2.740184ms elapsed, 2.740535ms wall time
No package sources found, --help for usage information.
⚠️ JSON / prettier - 1 error
chezmoi/.chezmoitemplates/claude-settings.json 147ms (unchanged)
chezmoi/.chezmoitemplates/mcp_servers.json 9ms (unchanged)
chezmoi/.chezmoitemplates/opencode-tui.json 5ms (unchanged)
chezmoi/.chezmoitemplates/opencode.json 12ms (unchanged)
[error] chezmoi/private_dot_claude/modify_settings.json: SyntaxError: Unexpected token (1:2)
[error] > 1 | {{- /* chezmoi:modify-template */ -}}
[error] | ^
[error] 2 | {{- $current := dict -}}
[error] 3 | {{- if .chezmoi.stdin | trim -}}
[error] 4 | {{- $current = fromJson .chezmoi.stdin -}}
[error] chezmoi/private_dot_config/mcp/modify_mcp_servers.json: SyntaxError: Unexpected token (1:2)
[error] > 1 | {{- /* chezmoi:modify-template */ -}}
[error] | ^
[error] 2 | {{- $current := dict -}}
[error] 3 | {{- if .chezmoi.stdin | trim -}}
[error] 4 | {{- $current = fromJson .chezmoi.stdin -}}
[error] chezmoi/private_dot_config/opencode/modify_opencode.json: SyntaxError: Unexpected token (1:2)
[error] > 1 | {{- /* chezmoi:modify-template */ -}}
[error] | ^
[error] 2 | {{- $current := dict -}}
[error] 3 | {{- if .chezmoi.stdin | trim -}}
[error] 4 | {{- $current = fromJson .chezmoi.stdin -}}
[error] chezmoi/private_dot_config/opencode/modify_tui.json: SyntaxError: Unexpected token (1:2)
[error] > 1 | {{- /* chezmoi:modify-template */ -}}
[error] | ^
[error] 2 | {{- $current := dict -}}
[error] 3 | {{- if .chezmoi.stdin | trim -}}
[error] 4 | {{- $current = fromJson .chezmoi.stdin -}}
renovate.json 8ms (unchanged)
Notices
📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)
See detailed reports in MegaLinter artifacts
Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)
- Documentation: Custom Flavors
- Command:
npx mega-linter-runner@9.5.0 --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,ACTION_ZIZMOR,BASH_EXEC,BASH_SHELLCHECK,BASH_SHFMT,COPYPASTE_JSCPD,EDITORCONFIG_EDITORCONFIG_CHECKER,JSON_V8R,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_GITLEAKS,REPOSITORY_GRYPE,REPOSITORY_OSV_SCANNER,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,SPELL_LYCHEE,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

Show us your support by starring ⭐ the repository
Summary
.chezmoitemplates/memsearch_config.toml— global onnx embedding, cross-encoder reranker, anduser_profilemaintenance (claude-code + opencode) writing to a shared~/.memsearch/USER.md.private_dot_memsearch/modify_config.tomlto merge the template into~/.memsearch/config.tomlonchezmoi apply, preserving any existing local overrides.modify_*.tomlfrom taplo-format (Go template syntax, not valid standalone TOML).Test plan
chezmoi execute-templateresolves template correctlychezmoi applyon a real machineSummary by CodeRabbit
New Features
Chores