llm-ai-assistant #1

Merged
202400507116 merged 11 commits from llm-ai-assistant into main 2026-09-07 15:32:15 +08:00
Owner
No description provided.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
端到端发现: 原 _INTENT_SCHEMA.format() 遇到 JSON 字面 { } 抛 KeyError, 仅 LlM_ENABLED=1 时才暴露(单元测试默认关闭未触发)。修复改为 replace 占位符; 新增 is_offtopic 机械兜底, 无关问题(天气/问候/时间等且无经营锚点)->help; 收紧经营锚点避免纯时间词误判。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
完成 LLM 适配层(llm_intent) + ai_query 双层路由映射 + 答非所问兜底; 端到端冒烟全意图通过, 57 passed 无回归。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
根因: _TIME_KEYWORDS['today'] = ['今天','今日','当天','昨'], today 先于
yesterday 被匹配, 导致 '昨天'/'昨日'/'昨晚' 全部落入今日口径。
用户在日常 start.py(LLM_ENABLED 未设)启动的实例上提问「昨天营收多少」,
走了关键词引擎并返回今日营收。

修复: today 移出 '昨'; yesterday 用 '昨' 命中全部变体(昨天/昨日/昨晚)。
新增 test_yesterday_revenue_not_today / test_yesterday_keyword_variants_use_yesterday。
全量 pytest: 59 passed(2 collection errors 为既有 stdlib test_api 名冲突, 与本改动无关)。
HTTP 复验(LLM+关键词双路径): 昨天营收 -> 全网昨日营收 ¥19,229 
- _INTENT_SCHEMA 扩展 day_before_yesterday/rank_pos/hour_window/district_scope/compare, _classify 白名单同步
- _answer_from_llm_spec 分发闭环: rank_pos/hour_window/district_scope 落实到真实 SQL 聚合, intent 白名单加 help
- 环比语义优先路由: compare=true 且完整时间窗口 -> 强制 _answer_metric_simple 差值路径, intent 误判不阻断
- 新映射测试隔离化(_make_station/_drop_stations 自清理), test_this_week_compare 改回归(bad_intent ranking/help 强制转 metric)
- 新增 backend/pytest.ini testpaths=tests 消除根目录冒烟脚本收集冲突
- 验证: 全量 64 passed, HTTP 真实服务器复验 8/8 全对(PID 26416)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
202400507116/smart_charge!1
No description provided.