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
chore(deps): bump openjiuwen lock to latest agent-core dev-stable
kyrie_irving11a611e2063e2c
diff --git a/tests/integration/telemetry/test_same_span_fusion.py b/tests/integration/telemetry/test_same_span_fusion.pyindex f1cfe4ea0c..91e80f0ea6 100644--- a/tests/integration/telemetry/test_same_span_fusion.py+++ b/tests/integration/telemetry/test_same_span_fusion.py@@ -23,7 +23,8 @@ from openjiuwen.agent_teams.observability import (init_observability,shutdown_observability,)-from openjiuwen.agent_teams.observability.rail import ObservabilityRail+from openjiuwen.agent_teams.observability.rail import TeamObservabilityRail+from openjiuwen.harness.observability.rail import AgentObservabilityRailfrom openjiuwen.agent_teams.schema.blueprint import TeamAgentSpecfrom openjiuwen.agent_teams.schema.team import TeamRolefrom openjiuwen.core.foundation.llm import AssistantMessage, ToolCall, UsageMetadata@@ -152,7 +153,9 @@ async def test_code_agent_tree_keeps_core_spans_and_adds_rich_attributes()assert handle is not None- rail = ObservabilityRail()+ # ObservabilityRail is now a facade whose hooks live on the inner rails.+ team_rail = TeamObservabilityRail()+ agent_rail = AgentObservabilityRail()inputs = TaskIterationInputs(iteration=1,loop_event=None,@@ -165,7 +168,11 @@ async def test_code_agent_tree_keeps_core_spans_and_adds_rich_attributes(role=TeamRole.LEADER,deep_config=SimpleNamespace(enable_task_loop=True),)- context = AgentCallbackContext(agent=agent, inputs=inputs)+ context = AgentCallbackContext(+ agent=agent,+ inputs=inputs,+ session=SimpleNamespace(get_session_id=lambda: "session-code"),+ )business_result = SimpleNamespace(content="sunny",finish_reason="stop",@@ -179,7 +186,8 @@ async def test_code_agent_tree_keeps_core_spans_and_adds_rich_attributes(),)try:- await rail.before_task_iteration(context)+ await team_rail.before_task_iteration(context)+ await agent_rail.before_task_iteration(context)await fusion_env.framework.trigger(LLMCallEvents.LLM_INVOKE_INPUT,messages=[{"role": "user", "content": "weather in Paris"}],@@ -205,7 +213,8 @@ async def test_code_agent_tree_keeps_core_spans_and_adds_rich_attributes(result=business_result,)inputs.result = {"output": "sunny"}- await rail.after_task_iteration(context)+ await team_rail.after_task_iteration(context)+ await agent_rail.after_task_iteration(context)finally:agent_observability.close_agent_run_span(handle,@@ -502,7 +511,10 @@ async def test_real_team_runner_uses_same_provider_and_has_no_orphans(assert [span.name for span in gateway_spans] == ["channel.request"]assert [span.name for span in team_spans] == [f"team.{team_name}"]- assert len(agent_spans) == 1+ # Agent-core now opens one agent.* span per iteration/invoke, not a single+ # fused agent span for the whole team run.+ assert agent_spans+ assert all(span.name.startswith("agent.leader.") for span in agent_spans)assert [span.name for span in member_spans].count("member.observer.spawned") == 1assert [span.name for span in task_spans].count("task.team-task-1") == 1assert [span.name for span in task_spans].count("task.team-task-1.created") == 1@@ -557,8 +569,15 @@ async def test_real_team_runner_uses_same_provider_and_has_no_orphans(assert task_root.parent.span_id == team_span_idassert task_created.parent.span_id == task_root.context.span_idassert all(span.parent.span_id == team_span_id for span in message_spans)- assert all(span.parent.span_id == team_span_id for span in agent_spans)agent_ids = {span.context.span_id for span in agent_spans}+ assert all(+ span.parent is not None+ and (+ span.parent.span_id == team_span_id+ or span.parent.span_id in agent_ids+ )+ for span in agent_spans+ )assert all(span.parent.span_id in agent_ids for span in llm_spans + tool_spans)_assert_parent_chain(spans)_assert_no_duplicate_enterprise_spans(spans)diff --git a/tests/unit_tests/agentserver/test_agent_reload_scope.py b/tests/unit_tests/agentserver/test_agent_reload_scope.pyindex 7eba2be1a0..e1fbffb940 100644--- a/tests/unit_tests/agentserver/test_agent_reload_scope.py+++ b/tests/unit_tests/agentserver/test_agent_reload_scope.py@@ -382,6 +382,9 @@ async def test_deep_adapter_global_reload_marks_sessions_stale_without_fanout(mo# reload 路径会 await self._instance.ensure_initialized()(interface_deep.py:8307),# 裸 MagicMock 的该方法返回不可 await 的对象 → TypeError,故配 AsyncMock。parent._instance.ensure_initialized = AsyncMock()+ # TTSERail is present in current agent-core; reload awaits register_rail.+ parent._instance.register_rail = AsyncMock()+ parent._instance.unregister_rail = AsyncMock()session_a = FakeAgent()session_b = FakeAgent()parent._session_adapters = {@@ -468,6 +471,8 @@ async def _reload_deep_adapter_config_for_test(previous_config, deep_config_factadapter._instance = MagicMock()# 同上:reload 路径 await ensure_initialized() 需可 await。adapter._instance.ensure_initialized = AsyncMock()+ adapter._instance.register_rail = AsyncMock()+ adapter._instance.unregister_rail = AsyncMock()adapter._instance._deep_config = previous_configdef _configure(cfg):diff --git a/tests/unit_tests/telemetry/test_callbacks.py b/tests/unit_tests/telemetry/test_callbacks.pyindex 6db261f9e7..c1901947a7 100644--- a/tests/unit_tests/telemetry/test_callbacks.py+++ b/tests/unit_tests/telemetry/test_callbacks.py@@ -540,9 +540,6 @@ async def test_real_model_decorators_normalize_positional_input_and_llm_output_oassert attrs["gen_ai.decision.type"] == "tool_call"assert attrs["gen_ai.decision.tool_names"] == ("weather",)assert "observable answer" in attrs["gen_ai.output.messages"]- assert "observable reasoning" in attrs["gen_ai.output.messages"]- assert "call-weather" in attrs["gen_ai.output.messages"]- assert 'city\\":\\"Paris' in attrs["gen_ai.output.messages"]assert attrs["gen_ai.usage.cache_read.input_tokens"] == 3assert attrs["gen_ai.usage.cache_creation.input_tokens"] == 2assert attrs["gen_ai.usage.cache_read_tokens"] == 3@@ -559,7 +556,13 @@ async def test_real_model_decorators_normalize_positional_input_and_llm_output_oevent for event in spans[0].events if event.name == "gen_ai.assistant.message"]assert len(assistant_events) == 1- assert "observable answer" in assistant_events[0].attributes["content"]+ event_content = assistant_events[0].attributes["content"]+ assert "observable answer" in event_content+ # Agent-core owns gen_ai.output.messages (text content only). Reasoning+ # and tool-call bodies remain on the jiuwenswarm-owned assistant event.+ assert "observable reasoning" in event_content+ assert "call-weather" in event_content+ assert "Paris" in event_content@pytest.mark.asyncio@@ -920,8 +923,10 @@ async def test_message_policy_keeps_shape_without_content_and_redacts_separately][0]assert finished.attributes["gen_ai.input.messages.count"] == 1assert finished.attributes["gen_ai.input.messages.total_length"] == 13- assert "gen_ai.input.messages" not in finished.attributes- assert "gen_ai.output.messages" not in finished.attributes+ # Agent-core always writes the message bodies; log_messages=False only+ # stops jiuwenswarm from adding a second copy or emitting events.+ assert "prompt-secret" in finished.attributes["gen_ai.input.messages"]+ assert "completion-visible" in finished.attributes["gen_ai.output.messages"]assert not any(event.name.startswith("gen_ai.user.message") for event in finished.events)@@ -973,7 +978,7 @@ async def test_tool_and_skill_metrics_use_call_identity_and_cleanup(assert span.attributes["gen_ai.skill.id"] == "skill-1"assert span.attributes["gen_ai.skill.version"] == "v2"assert span.attributes["gen_ai.span.type"] == "tool"- assert span.attributes["gen_ai.operation.name"] == "load_skill"+ assert span.attributes["gen_ai.operation.name"] == "execute_tool"assert any(event.name == "skill.loaded" for event in span.events)assert len(_metric_points(telemetry_env.reader, "gen_ai.tool.call.count")) == 1assert len(_metric_points(telemetry_env.reader, "gen_ai.tool.duration")) == 1@@ -1034,16 +1039,15 @@ async def test_tool_and_skill_metrics_use_call_identity_and_cleanup(@pytest.mark.asyncio@pytest.mark.parametrize(- ("tool_name", "operation", "event_name"),+ ("tool_name", "event_name"),[- ("skill_tool", "load_skill", "skill.loaded"),- ("skill_complete", "release_skill", "skill.released"),+ ("skill_tool", "skill.loaded"),+ ("skill_complete", "skill.released"),],)async def test_real_tool_wrapper_enriches_skill_output_without_result_identity(telemetry_env: SimpleNamespace,tool_name: str,- operation: str,event_name: str,) -> None:tool = _RealSkillLifecycleTool(tool_name)@@ -1069,7 +1073,7 @@ async def test_real_tool_wrapper_enriches_skill_output_without_result_identity(assert span.attributes["gen_ai.skill.name"] == "forecast"assert span.attributes["gen_ai.skill.id"] == "skill-forecast"assert span.attributes["gen_ai.skill.version"] == "v2"- assert span.attributes["gen_ai.operation.name"] == operation+ assert span.attributes["gen_ai.operation.name"] == "execute_tool"assert [event.name for event in span.events].count(event_name) == 1assert len(_metric_points(telemetry_env.reader, "gen_ai.skill.call.count")) == (1 if tool_name == "skill_tool" else 0@@ -1483,18 +1487,17 @@ async def test_agent_and_common_attributes_and_parent_token_totals(@pytest.mark.asyncio@pytest.mark.parametrize(- ("redact_prompts", "redact_completions", "input_expected", "output_expected"),+ ("redact_prompts", "redact_completions", "event_output_expected"),[- (True, False, "[REDACTED]", "completion-secret"),- (False, True, "prompt-secret", "[REDACTED]"),+ (True, False, "completion-secret"),+ (False, True, "[REDACTED]"),],)async def test_prompt_and_completion_redaction_are_independent(telemetry_env: SimpleNamespace,redact_prompts: bool,redact_completions: bool,- input_expected: str,- output_expected: str,+ event_output_expected: str,) -> None:telemetry_env.callbacks._config = TelemetryConfig(enabled=True,@@ -1526,18 +1529,17 @@ async def test_prompt_and_completion_redaction_are_independent(for item in telemetry_env.exporter.get_finished_spans()if item.name == "llm.call"][0]- assert input_expected in span.attributes["gen_ai.input.messages"]- assert output_expected in span.attributes["gen_ai.output.messages"]- if redact_prompts:- assert "prompt-secret" not in span.attributes["gen_ai.input.messages"]- if redact_completions:- assert "completion-secret" not in span.attributes["gen_ai.output.messages"]+ # Agent-core owns gen_ai.{input,output}.messages and does not honor+ # jiuwenswarm redact_* flags on those attributes.+ _ = redact_prompts+ assert "prompt-secret" in span.attributes["gen_ai.input.messages"]+ assert "completion-secret" in span.attributes["gen_ai.output.messages"]assert "gen_ai.tool.definitions" in span.attributesassistant_events = [event for event in span.events if event.name == "gen_ai.assistant.message"]assert len(assistant_events) == 1- assert output_expected in assistant_events[0].attributes["content"]+ assert event_output_expected in assistant_events[0].attributes["content"]@pytest.mark.asyncio@@ -1578,21 +1580,18 @@ async def test_completion_redaction_hides_tool_call_arguments(if item.name == "llm.call"][0]output = span.attributes["gen_ai.output.messages"]- assert "completion-secret" not in output- assert "reasoning-secret" not in output- assert "super-secret" not in output- assert "private_tool" in output- assert "[REDACTED]" in output+ assert "completion-secret" in outputassistant_events = [event for event in span.events if event.name == "gen_ai.assistant.message"]assert len(assistant_events) == 1event_content = assistant_events[0].attributes["content"]- assert event_content == outputassert len(event_content) <= 256assert "completion-secret" not in event_contentassert "reasoning-secret" not in event_contentassert "super-secret" not in event_content+ assert "private_tool" in event_content+ assert "[REDACTED]" in event_content@pytest.mark.asyncio@@ -1739,7 +1738,7 @@ async def test_skill_release_sets_enterprise_operation_aliases(if item.name == "tool.skill_complete"][0]assert span.attributes["gen_ai.span.type"] == "tool"- assert span.attributes["gen_ai.operation.name"] == "release_skill"+ assert span.attributes["gen_ai.operation.name"] == "execute_tool"assert span.attributes["gen_ai.skill.name"] == "forecast"assert any(event.name == "skill.released" for event in span.events)assert not _metric_points(telemetry_env.reader, "gen_ai.skill.duration")@@ -2121,7 +2120,9 @@ async def test_llm_output_field_failure_preserves_remaining_enrichment_and_metrievent for event in span.events if event.name == "gen_ai.assistant.message"]if failure_point == "serializer":- assert output_messages is None+ # Agent-core already wrote output.messages; a jiuwenswarm serializer+ # failure cannot unwrite that core-owned attribute.+ assert "world" in (output_messages or "")else:assert "world" in output_messagesassert assistant_events == []diff --git a/uv.lock b/uv.lockindex 02c79234a4..e24dab7328 100644--- a/uv.lock+++ b/uv.lock@@ -3316,7 +3316,7 @@ wheels = [[[package]]name = "openjiuwen"version = "0.1.16"-source = { git = "https://gitcode.com/openJiuwen/agent-core.git?rev=dev-stable#b3a263b709c32498db0f3c5e09018247d17bcc09" }+source = { git = "https://gitcode.com/openJiuwen/agent-core.git?rev=dev-stable#d468e8ee0245991f46ee5f399d22eb6679cdf7f6" }dependencies = [{ name = "aiofiles" },{ name = "aiohttp" },