PhoneWork/tests/features/agent/routing.feature
Yuyao Huang (Sam) 8dab229aaf feat: 添加测试框架及功能测试用例
test: 实现BDD测试框架及功能测试
docs: 添加测试配置文件及文档
refactor: 重构命令处理逻辑以支持测试
2026-03-29 04:24:27 +08:00

36 lines
1.3 KiB
Gherkin

Feature: LLM smart routing — agent routes messages to correct tools
Background:
Given user "user_abc123" is in smart mode
And run_claude returns "I created the component for you."
@vcr
Scenario: Agent creates new session for project task
Given vcr cassette "agent/routing_new_session.yaml"
When user sends agent message "create a React app in todo_app folder"
Then agent created a session for user "user_abc123"
And reply is not empty
@vcr
Scenario: Agent answers general question without creating session
Given vcr cassette "agent/routing_general_qa.yaml"
When user sends agent message "what is a Python generator?"
Then no session is created for user "user_abc123"
And reply is not empty
@vcr
Scenario: Agent sends follow-up to existing session
Given user has active session "sess01" in "/tmp/proj1"
And vcr cassette "agent/routing_follow_up.yaml"
When user sends agent message "now add tests for that"
Then run_claude was called
And reply is not empty
@vcr
Scenario: Agent answers direct QA without tools when no active session
Given no active session for user "user_abc123"
And vcr cassette "agent/routing_direct_qa.yaml"
When user sends agent message "explain async/await in Python"
Then reply is not empty
And reply does not contain "Max iterations"