mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-15 00:21:58 +00:00
问数据时间线的分析一步、协作成员的分析:编号照实说是哪一层。Agent 工具那一步标题写「变化拆解(可加) · 本节点 A1」——编号是这份 Agent 自己的分析容器里的(交回模型的「【分析 A1】」),报告目录里的 A1 按整次运行的台账编,图里还有分析卡时就不是同一个,不再冒充报告里的编号;分析卡的一项照旧写这一项的标识。协作成员的分析不带编号(成员的结论还进不了台账,照它写「· A1」会和报告里点名的结论对不上),event_view 交回 alias=None。check-decode、check-stream、协作成员那条测试照新写法改
This commit is contained in:
@@ -462,9 +462,10 @@ async def run_supervisor(state: GraphState, ctx: NodeContext) -> dict[str, Any]:
|
||||
agent=name, call_id=cid, preview=content[:1500],
|
||||
duration_ms=int((time.perf_counter() - started) * 1000), **failure,
|
||||
**({"checks": checks} if checks else {}),
|
||||
# 判定的那一小段同 Agent 节点(event_view);编号是成员自己的分析容器里的,紧接着 _numbered 按它编
|
||||
# 判定的那一小段同 Agent 节点(event_view)。不带编号:成员自己的分析容器里的 A1 不是报告目录里的
|
||||
# A1(协作成员的结论还进不了台账),时间线上照它写「· A1」会和报告里点名的结论对不上
|
||||
**({"analysis_artifact": analysis["artifact"],
|
||||
"analysis": event_view(analysis["result"], scope.next_alias())} if analysis else {}))
|
||||
"analysis": event_view(analysis["result"])} if analysis else {}))
|
||||
if analysis is not None and analysis["result"].get("status") == "refused":
|
||||
ctx.emit(EventType.LOG, level="warn", code=ANALYSIS_REFUSED, agent=name, call_id=cid, tool=tname,
|
||||
reason_code=analysis["result"].get("reason_code"),
|
||||
|
||||
@@ -70,7 +70,7 @@ async def test_tool_end_carries_the_phrase_and_the_same_number_the_model_got(mon
|
||||
assert error["call_error"] == "unknown_column" and "analysis" not in error
|
||||
|
||||
|
||||
async def test_a_team_member_numbers_its_own_analyses(monkeypatch, shop):
|
||||
async def test_a_team_member_analysis_carries_no_number(monkeypatch, shop):
|
||||
Script(monkeypatch, [(TOOL, {"sql": SQL}), (DECOMPOSE, DECOMPOSE_ARGS)],
|
||||
route={"assignments": [{"agent": "分析员", "instruction": "拆一下销售额的变化"}], "done": False})
|
||||
nodes = [node("start", "input"),
|
||||
@@ -82,7 +82,10 @@ async def test_a_team_member_numbers_its_own_analyses(monkeypatch, shop):
|
||||
input_payload={})
|
||||
row = await wait(run.id)
|
||||
assert row.status == "succeeded", row.error
|
||||
[end] = [e for e in await events(row.id, "tool.end", "team") if e.get("analysis_artifact")]
|
||||
assert end["agent"] == "分析员"
|
||||
assert (end["analysis"]["alias"], end["analysis"]["op"], end["analysis"]["verdict"]) == ("A1", "decompose", "driver")
|
||||
ends = [e for e in await events(row.id, "tool.end", "team") if e.get("analysis_artifact")]
|
||||
assert [e["agent"] for e in ends] == ["分析员"]
|
||||
end = ends[0]
|
||||
# 不带编号:成员自己的分析容器里的 A1 不是报告目录里的 A1(协作成员的结论还进不了台账),报告目录另按整次运行的台账编
|
||||
assert end["analysis"]["alias"] is None
|
||||
assert (end["analysis"]["op"], end["analysis"]["verdict"]) == ("decompose", "driver")
|
||||
assert json.dumps(end["analysis"], ensure_ascii=False).count("下降是不是集中在某个地区") == 0, "Agent 写的假设不带"
|
||||
|
||||
Reference in New Issue
Block a user