test: 修复所有预存的失败测试
- test_auth_routes: monkeypatch 环境为 production 使 phone-session 限速生效 - test_schedule_items_routes: 补充必填 timezone 字段 - test_llm_pricing_service: 更新 deepseek-chat 费率期望值匹配实际 catalog - test_sse_flow_live: 补充 runId 查询参数、改用附件上传 API、修复 history 响应断言、独立 DB session 避免跨事件循环崩溃 - test_agent_prompt: 移除已删除的 project_cli_defaults 断言 - test_toolkit: 更新 action card 断言匹配 module/method 格式
This commit is contained in:
@@ -42,14 +42,12 @@ def test_build_agent_prompt_for_router_contains_identity_and_config() -> None:
|
||||
|
||||
assert "- type: router" in prompt
|
||||
assert "[Router Agent]" in prompt
|
||||
assert "When the task will require project_cli, include canonical tool input defaults in context_summary using the exact shape `project_cli_defaults={\"module\":...,\"method\":...,\"input\":{...}}` whenever they can be determined safely." in prompt
|
||||
assert "Standardize every time value mentioned in context_summary to the exact project_cli input format that would be required downstream: dates as `YYYY-MM-DD`, local datetimes as RFC3339 with timezone offset, and event ids as raw UUID strings." in prompt
|
||||
assert "For relative time requests like today, tomorrow, or next Monday, resolve them using system_time_local and place the resolved standardized value into project_cli_defaults.input instead of leaving natural-language time phrases." in prompt
|
||||
assert "- Set context_summary to a brief but execution-useful summary of the relevant context, including known IDs, dates, time ranges, and prior tool outcomes when they matter." in prompt
|
||||
assert "context_messages.mode=day" in prompt
|
||||
assert "context_messages.count=2" in prompt
|
||||
|
||||
|
||||
def test_build_worker_contract_prompt_prefers_resolved_dates_from_context_summary() -> None:
|
||||
def test_build_worker_contract_prompt_contains_objective_and_context() -> None:
|
||||
prompt = build_worker_contract_prompt(
|
||||
router_output=RouterAgentOutput(
|
||||
objective="查询今天日程",
|
||||
@@ -58,4 +56,7 @@ def test_build_worker_contract_prompt_prefers_resolved_dates_from_context_summar
|
||||
)
|
||||
)
|
||||
|
||||
assert "If context_summary contains project_cli_defaults, prefer using those exact module/method/input values directly." in prompt
|
||||
assert "Keep routed objective unchanged." in prompt
|
||||
assert "Use context_summary to understand conversational background and reuse concrete facts already known from earlier context." in prompt
|
||||
assert "requires_tool_evidence" in prompt
|
||||
assert "2026-04-24" in prompt
|
||||
|
||||
@@ -105,7 +105,8 @@ def test_view_skill_file_reads_calendar_action_card() -> None:
|
||||
block = response.content[0]
|
||||
text = block["text"] if isinstance(block, dict) else block.text
|
||||
assert "get_event" in text
|
||||
assert '"action": "get_event"' in text
|
||||
assert '"method": "read"' in text
|
||||
assert '"mode": "event"' in text
|
||||
assert skill_session.has_read(skill_name="calendar") is True
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user