Repository navigation
Commit 8b4e11b
Developer
fix(opencode): Add MCP schema sanitization for Kimi K2.5 compatibility
- Add sanitizeSchema() function to filter invalid JSON schemas
- Update convertMcpTool() to sanitize before spreading to Kimi K2.5
- Protects against empty object {} and invalid logical operators
- Ensures all MCP schemas are valid Draft 7 before validation
Resolves: JSON Schema not supported: could not understand the instance '{}'
Ref: OpenCode issue anomalyco#11357 - Kimi K2.5 strict schema validation
This provides complete protection against both:
- Invalid bare list annotations (list → List[str])
- Future MCP servers with invalid schemas1 parent 0f9cd78 commit 8b4e11b
1 file changed
Lines changed: 44 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
111 | 149 | | |
112 | 150 | | |
113 | 151 | | |
114 | 152 | | |
115 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
116 | 157 | | |
117 | | - | |
| 158 | + | |
118 | 159 | | |
119 | | - | |
| 160 | + | |
120 | 161 | | |
121 | 162 | | |
122 | 163 | | |
| |||
0 commit comments