Skip to content

feat(ops): P1-4 LLM intent router with rule fallback - #235

Merged
Cyning12 merged 6 commits into
mainfrom
task/ops-chat-session-sink-p0-p1
Jul 10, 2026
Merged

feat(ops): P1-4 LLM intent router with rule fallback#235
Cyning12 merged 6 commits into
mainfrom
task/ops-chat-session-sink-p0-p1

Conversation

@Cyning12

Copy link
Copy Markdown
Owner

Summary

  • 新增 api/ops/intent_router.py:轻量 JSON LLM intent router,输出 intent / slots / confidence
  • api/ops/orchestrator/core.py:当 OPS_CHAT_LLM_ROUTER=1classify_intent 优先走 LLM router,否则保持原规则不变
  • 低置信度 / 非法 JSON / LLM 异常时降级为规则 fallback,并记录 intent_router.fallback event
  • 默认未开启时行为完全向后兼容

Test plan

  • pytest tests/ops tests/ops_desk -m "not intent_eval and not intent_benchmark" -q && ruff check api/ops
  • 316 passed, 10 skipped, 1 warning
  • ruff 全绿
  • pytest tests/ops/test_intent_router.py -k fallback -q → 3 passed

Scope

仅 P1-4;未改 P1-1 artifact、P1-2 checkpoint、P1-3 clarify、Session 生产图、Agently lab、前端。


Harness 30/40/50 全链通过;HG-TASK-DRAFT / HG-AUDIT-R1 approved。

CyningMM added 6 commits July 10, 2026 09:42
…le fallback

- Add api/ops/intent_router.py: JSON intent / slots / confidence via LLM.
- Wire classify_intent in core.py to use LLM router when OPS_CHAT_LLM_ROUTER=1.
- Fallback to rule classifier on low confidence or LLM error.
- Record intent_router.fallback events via append_event when run_id/store provided.
- Add tests/ops/test_intent_router.py covering success, low confidence, invalid JSON,
  timeout, disabled, and classify_intent integration.
- Include 30 invoke and 40 self-check prompt.
Generate 50-self-check invoke snapshot for P1-4 LLM Router.
Backfill 40 commit 5c4f05c into 50-self-check invoke.
Add 40-self-check invoke snapshot for P1-4 LLM Router.
@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ai-ink-brain-api-python Building Building Preview, Comment Jul 10, 2026 2:05am

@Cyning12
Cyning12 merged commit d4516db into main Jul 10, 2026
6 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants