JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.
Python
merge dev-stable into agentserver bugfix backport
guozirui15ba1d0da1364
diff --cc tests/unit_tests/agentserver/test_chat_steering_core_integration.pyindex 6e130bf205,c09d89dbe3..13e74a4f97--- a/tests/unit_tests/agentserver/test_chat_steering_core_integration.py+++ b/tests/unit_tests/agentserver/test_chat_steering_core_integration.py@@@ -42,28 -41,10 +42,31 @@@ from jiuwenswarm.server.runtime.agent_a# marker so a broken capability implementation in a newer SDK still fails._CORE_HAS_STEERING = find_spec("openjiuwen.core.single_agent.schema.steering") is not None+ # CI 全量并行下真实 Core 启动偏慢;超时过紧会偶发 TimeoutError。+ _WAIT_S = 60++class _FastTokenCounter(TokenCounter):+ """Deterministic counter for a test that does not exercise tokenization."""++ def count(self, text, *, model="", **kwargs):+ return len(text)++ def count_messages(self, messages, *, model="", **kwargs):+ return sum(self.count(str(message.content)) for message in messages)++ def count_tools(self, tools, *, model="", **kwargs):+ return len(tools)++[email protected](autouse=True)+def _use_fast_token_counter(monkeypatch):+ """Keep Core integration tests independent of tiktoken cache warm-up."""+ from openjiuwen.core.context_engine.token import tiktoken_counter++ monkeypatch.setattr(tiktoken_counter, "TiktokenCounter", _FastTokenCounter)++class _BlockingTool(Tool):def __init__(self):super().__init__(ToolCard(name="blocked_tool", description="Wait for test"))@@@ -261,15 -239,7 +262,17 @@@ async def test_chat_pipeline_steers_reamain_task = asyncio.create_task(pipeline.dispatch_parsed_request(original_context, original))- await asyncio.wait_for(tool.entered.wait(), _WAIT_S)+ tool_entered_task = asyncio.create_task(tool.entered.wait())+ done, _ = await asyncio.wait(+ {main_task, tool_entered_task},- timeout=10,++ timeout=_WAIT_S,+ return_when=asyncio.FIRST_COMPLETED,+ )+ if main_task in done:+ await main_task- assert tool_entered_task in done, "Core did not enter the tool within 10 seconds"++ assert tool_entered_task in done, (++ f"Core did not enter the tool within {_WAIT_S} seconds"++ )active_task = core.active_round.task_idowner = core._interaction_output.current_lease()