Commit 1ff7c3c
fix(research): Add Brotli compression support and fix MCP parameter passing
This commit resolves the investigation hang issue by implementing multiple fixes:
**Compression Infrastructure:**
- Add brotli crate dependency for decompression
- Implement automatic Brotli decompression in MCP bridge
- Detect and handle compressed responses (_compressed: "brotli")
- Base64 decode and decompress transparently
**AI Service Improvements:**
- Add maxTokens parameter to AiRequest struct
- Set maxTokens to 4269 to prevent response truncation
- Add comprehensive HTTP request/response debug logging
- Enable debugging of AI API interactions
**Research Agent Parameter Fixes:**
- Update AI prompts to require correct parameter names:
* Use 'address' instead of 'account' for wallet queries
* Require limit: 500 (API maximum)
* Require compress: true (enable Brotli compression)
- Fix OVSM script generation to use AI decision parameters dynamically
- Convert JSON parameters to OVSM map syntax properly
- Update fallback actions with correct parameters
**MCP Bridge Enhancements:**
- Add Brotli decompression capability
- Handle compressed responses automatically
- Log compression statistics (bytes before/after)
**Impact:**
- Investigations now complete successfully instead of hanging
- 500 transfers: 182KB → 13.6KB (92.6% compression)
- Fits in default 64KB pipe buffers
- No more MCP communication deadlocks
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 57eb518 commit 1ff7c3c
File tree
5 files changed
+113
-26
lines changed- src
- services
- utils
5 files changed
+113
-26
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
574 | 576 | | |
575 | 577 | | |
576 | 578 | | |
| 579 | + | |
577 | 580 | | |
578 | 581 | | |
579 | 582 | | |
| |||
599 | 602 | | |
600 | 603 | | |
601 | 604 | | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
602 | 612 | | |
603 | 613 | | |
604 | 614 | | |
| |||
617 | 627 | | |
618 | 628 | | |
619 | 629 | | |
620 | | - | |
621 | | - | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
622 | 636 | | |
623 | 637 | | |
624 | 638 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1250 | 1250 | | |
1251 | 1251 | | |
1252 | 1252 | | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
1253 | 1258 | | |
1254 | 1259 | | |
1255 | 1260 | | |
| |||
1268 | 1273 | | |
1269 | 1274 | | |
1270 | 1275 | | |
1271 | | - | |
| 1276 | + | |
1272 | 1277 | | |
1273 | 1278 | | |
1274 | 1279 | | |
| |||
1631 | 1636 | | |
1632 | 1637 | | |
1633 | 1638 | | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
1634 | 1657 | | |
1635 | 1658 | | |
1636 | 1659 | | |
1637 | 1660 | | |
1638 | | - | |
| 1661 | + | |
1639 | 1662 | | |
1640 | 1663 | | |
1641 | 1664 | | |
1642 | 1665 | | |
1643 | 1666 | | |
1644 | | - | |
| 1667 | + | |
1645 | 1668 | | |
1646 | 1669 | | |
1647 | 1670 | | |
1648 | 1671 | | |
| 1672 | + | |
1649 | 1673 | | |
1650 | 1674 | | |
1651 | 1675 | | |
| |||
2992 | 3016 | | |
2993 | 3017 | | |
2994 | 3018 | | |
2995 | | - | |
| 3019 | + | |
2996 | 3020 | | |
2997 | 3021 | | |
2998 | 3022 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
| 137 | + | |
137 | 138 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
| 139 | + | |
| 140 | + | |
145 | 141 | | |
146 | 142 | | |
147 | 143 | | |
148 | | - | |
| 144 | + | |
149 | 145 | | |
150 | 146 | | |
151 | 147 | | |
152 | 148 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | 149 | | |
163 | 150 | | |
164 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
165 | 191 | | |
166 | 192 | | |
167 | 193 | | |
| |||
0 commit comments