Commit ef90d60
committed
feat: 全面修复 AutoCode 核心 Bug 并增强功能
修复 6 个已知 Bug,参数化硬编码配置,完善 Interactor 通信,补充集成测试和错误处理。
## Bug 修复 (P0)
- stress_test: 修复对拍时未传 seed 参数导致每轮生成相同数据的问题
改用 run_binary_with_args 传递 seed 作为命令行参数
- generator: 修复 GeneratorRunTool.execute() 参数与 input_schema 不匹配
添加 n_min/n_max/t_min/t_max 到 schema,MCP Client 现在可正确传递参数
- problem: 修复 ProblemGenerateTestsTool 中 test_configs 参数被忽略的问题
现在使用配置中的 seed_offset/type/n_min/n_max/t_min/t_max 调用 generator
## 设计改进 (P1)
- problem: test_configs 参数化,支持通过 API 传入自定义测试配置
提取 _get_default_configs() 方法,保持向后兼容
- interactor: 实现双向管道通信(interactor.stdout <-> solution.stdin)
添加 pipe_data helper,处理 Windows 兼容性降级
## 小修复 (P2)
- problem: problem.xml 中 test-count 从硬编码 20 改为动态计算实际 .in 文件数
- docs: 修复 CONTRIBUTING.md 中项目名称 ACMGO -> AutoCode
## 增强
- 新增 tests/test_integration/ 集成测试模块(3 个端到端测试)
- 改进 compiler.py 超时错误提示,提供具体排查建议
- 改进 stress_test generator 失败错误提示
## 文件变更
- src/autocode_mcp/tools/stress_test.py: seed 传递 + 错误提示
- src/autocode_mcp/tools/generator.py: schema 补全
- src/autocode_mcp/tools/problem.py: test_configs 参数化 + 动态 test-count
- src/autocode_mcp/tools/interactor.py: 双向管道通信
- src/autocode_mcp/utils/compiler.py: 超时错误提示增强
- CONTRIBUTING.md: 项目名称修正
- tests/: 新增 8 个单元测试 + 3 个集成测试1 parent a7ef7fc commit ef90d60
File tree
15 files changed
+680
-94
lines changed- .claude
- src/autocode_mcp
- tools
- utils
- tests
- test_integration
- test_tools
15 files changed
+680
-94
lines changedThis file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
140 | 161 | | |
141 | 162 | | |
142 | 163 | | |
| |||
215 | 236 | | |
216 | 237 | | |
217 | 238 | | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
223 | 246 | | |
224 | 247 | | |
225 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
114 | | - | |
115 | | - | |
116 | | - | |
| 115 | + | |
117 | 116 | | |
118 | 117 | | |
119 | 118 | | |
| |||
127 | 126 | | |
128 | 127 | | |
129 | 128 | | |
130 | | - | |
131 | | - | |
132 | | - | |
| 129 | + | |
133 | 130 | | |
134 | 131 | | |
135 | 132 | | |
| |||
201 | 198 | | |
202 | 199 | | |
203 | 200 | | |
204 | | - | |
| 201 | + | |
205 | 202 | | |
206 | | - | |
| 203 | + | |
207 | 204 | | |
208 | 205 | | |
209 | 206 | | |
| |||
249 | 246 | | |
250 | 247 | | |
251 | 248 | | |
252 | | - | |
| 249 | + | |
253 | 250 | | |
254 | | - | |
255 | | - | |
| 251 | + | |
| 252 | + | |
256 | 253 | | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
257 | 268 | | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
271 | 295 | | |
272 | | - | |
273 | | - | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
0 commit comments