on main help sign in
fix: schema incorrectly marks optional fields as required (#1996)

This fixes two schema validation issues: 1. tools.ls incorrectly marked as required - Changed Tools.Ls and Config.Tools from omitzero to omitempty - The invopop/jsonschema library doesn't recognize Go 1.25's omitzero tag 2. lsp.command incorrectly marked as required - Removed jsonschema:"required" tag from LSPConfig.Command - The project's own crush.json doesn't include command field for gopls After this fix, users can use minimal configurations without being forced to specify tools.ls or lsp.command fields.

commit99aabb0179cb65f46166b4add30156360afb0ba9 authorhuaiyuWangh <34158348+huaiyuWangh@users.noreply.github.com> dateWed 28 Jan 2026, 03:30 (9 months ago) parent50ae9f2
2 files changed+6−15
internal/config/config.go+3−3 schema.json+3−12
internal/config/config.go+3−3
@@ -187,7 +187,7 @@ type MCPConfig struct {
187187
188188type LSPConfig struct {
189189 Disabled bool `json:"disabled,omitempty" jsonschema:"description=Whether this LSP server is disabled,default=false"`
190− Command string `json:"command,omitempty" jsonschema:"required,description=Command to execute for the LSP server,example=gopls"`
190+ Command string `json:"command,omitempty" jsonschema:"description=Command to execute for the LSP server,example=gopls"`
191191 Args []string `json:"args,omitempty" jsonschema:"description=Arguments to pass to the LSP server command"`
192192 Env map[string]string `json:"env,omitempty" jsonschema:"description=Environment variables to set to the LSP server command"`
193193 FileTypes []string `json:"filetypes,omitempty" jsonschema:"description=File types this LSP server handles,example=go,example=mod,example=rs,example=c,example=js,example=ts"`
@@ -347,7 +347,7 @@ type Agent struct {
347347}
348348
349349type Tools struct {
350− Ls ToolLs `json:"ls,omitzero"`
350+ Ls ToolLs `json:"ls,omitempty"`
351351}
352352
353353type ToolLs struct {
@@ -380,7 +380,7 @@ type Config struct {
380380
381381 Permissions *Permissions `json:"permissions,omitempty" jsonschema:"description=Permission settings for tool usage"`
382382
383− Tools Tools `json:"tools,omitzero" jsonschema:"description=Tool configurations"`
383+ Tools Tools `json:"tools,omitempty" jsonschema:"description=Tool configurations"`
384384
385385 Agents map[string]Agent `json:"-"`
386386
schema.json+3−12
@@ -92,10 +92,7 @@
9292 }
9393 },
9494 "additionalProperties": false,
95− "type": "object",
96− "required": [
97− "tools"
98− ]
95+ "type": "object"
9996 },
10097 "LSPConfig": {
10198 "properties": {
@@ -162,10 +159,7 @@
162159 }
163160 },
164161 "additionalProperties": false,
165− "type": "object",
166− "required": [
167− "command"
168− ]
162+ "type": "object"
169163 },
170164 "LSPs": {
171165 "additionalProperties": {
@@ -702,10 +696,7 @@
702696 }
703697 },
704698 "additionalProperties": false,
705− "type": "object",
706− "required": [
707− "ls"
708− ]
699+ "type": "object"
709700 }
710701 }
711702}