Skip to content

Commit 4e90264

Browse files
SummerOneTwoclaude
andcommitted
fix: 修复 CI 测试和类型检查失败
- test_interactor: 使用 get_exe_extension() 获取正确的可执行文件后缀 - interactor: 修复 comm_task.result() 可能为 None 的类型错误 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent eff6719 commit 4e90264

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/autocode_mcp/tools/interactor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ async def _run_interactor_test(
242242
# 获取通信结果
243243
if comm_task and not comm_task.cancelled():
244244
result = comm_task.result()
245-
return result
245+
if result:
246+
return result
246247

247248
except TimeoutError:
248249
interactor.kill()

tests/test_tools/test_interactor.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ async def test_interactor_with_reference_solution():
114114
pytest.skip("g++ not available")
115115

116116
from autocode_mcp.tools.solution import SolutionBuildTool
117+
from autocode_mcp.utils.platform import get_exe_extension
117118

118119
tool = InteractorBuildTool()
119120
sol_tool = SolutionBuildTool()
@@ -123,9 +124,9 @@ async def test_interactor_with_reference_solution():
123124
build_result = await tool.execute(problem_dir=tmpdir, code=INTERACTOR_CODE)
124125
assert build_result.success
125126

126-
# 构建正确的参考解法 - solution_build 保存到 solutions/sol.exe
127+
# 构建正确的参考解法 - solution_build 保存到 solutions/sol<exe>
127128
await sol_tool.execute(problem_dir=tmpdir, solution_type="sol", code=SIMPLE_SOLUTION)
128-
correct_sol_exe = os.path.join(tmpdir, "solutions", "sol.exe")
129+
correct_sol_exe = os.path.join(tmpdir, "solutions", f"sol{get_exe_extension()}")
129130

130131
# 验证正确解法
131132
result = await tool.execute(

0 commit comments

Comments
 (0)