chore: create Multica handoff checkpoint

This commit is contained in:
leefer
2026-08-06 22:54:46 +08:00
parent bd97ba1829
commit 33f9db43b1
51 changed files with 3054 additions and 2883 deletions
+29
View File
@@ -103,6 +103,35 @@ class MentorStreamTests(unittest.TestCase):
)
self.assertEqual(chunks, ["first", " second"])
def test_follow_up_block_is_collected_without_leaking_into_answer(self):
lines = [
'data: {"choices":[{"delta":{"content":"先看承接,再等确认。\\n<XIAOBAI_FOL"}}]}\n'.encode(),
'data: {"choices":[{"delta":{"content":"LOW_UPS>\\n[\\"什么信号代表承接有效?\\",\\"这个判断何时失效?\\"]\\n</XIAOBAI_FOLLOW_UPS>"}}]}\n'.encode(),
b"data: [DONE]\n",
]
follow_ups: list[str] = []
with patch(
"backend.llm.transport.urllib.request.urlopen",
return_value=FakeStreamResponse(lines),
):
chunks = list(
stream_with_mentor(
self.skill,
{},
"question",
[],
"key",
"https://example.test/v1",
"model",
follow_ups=follow_ups,
)
)
self.assertEqual("".join(chunks), "先看承接,再等确认。\n")
self.assertEqual(
follow_ups,
["什么信号代表承接有效?", "这个判断何时失效?"],
)
if __name__ == "__main__":
unittest.main()