Files
cleveragents-core/features/stream_router_agent_tool_coverage.feature
T
CoreRasurae f2f7aa5dc9 feat(core): add v3 lifecycle models, automation levels, subplan support, and security hardening
Implement multiple Stage A/B/E/SEC milestones for the v3 lifecycle system:
- Stage A5.3+A5.4: Add LifecycleActionModel and LifecyclePlanModel SQLAlchemy
  models with to_domain()/from_domain() conversion methods
- Stage A5.6: Implement ActionRepository with full CRUD, namespace/state
  queries, referential integrity checks, and retry decorator
- Stage E1: Add subplan domain models (ExecutionMode, SubplanMergeStrategy,
  SubplanConfig, SubplanStatus, SubplanAttempt, SubplanFailureHandler) with
  computed properties on Plan (is_subplan, is_root_plan, depth, has_subplans)
- Stage A6: Add AutomationLevel enum (MANUAL, REVIEW_BEFORE_APPLY,
  FULL_AUTOMATION), settings integration, PlanLifecycleService auto-progression,
  pause/resume, and CLI commands (--automation-level, set-automation-level)
- Stage SEC1: Remove eval()/exec() from stream_router.py, replace with named
  operation and transform registries; code blocks and unregistered transforms
  now raise StreamRoutingError
- Add langchain-anthropic dependency
- Update BDD tests for security changes and relax ADR directory requirement
2026-02-12 20:19:42 +00:00

77 lines
3.5 KiB
Gherkin

Feature: Stream Router agent and tool coverage
As a developer
I want Behave coverage for SimpleToolAgent and SimpleLLMAgent
So that uncovered agent branches are exercised
Scenario: SimpleToolAgent returns content when tool code is missing
Given a SimpleToolAgent with a tool missing code
When I process "payload" through the SimpleToolAgent
Then the SimpleToolAgent result should be "payload"
Scenario: SimpleToolAgent rejects tool with code block
Given a SimpleToolAgent with a code block tool
When I process "payload" through the SimpleToolAgent expecting rejection
Then the SimpleToolAgent should raise a routing error about code blocks
Scenario: SimpleToolAgent rejects code block via process_message_sync
Given a SimpleToolAgent with a code block tool
When I call process_message_sync with "payload" expecting rejection
Then the SimpleToolAgent should raise a routing error about code blocks
# TODO: Uncomment when step definitions are implemented
# Scenario: SimpleLLMAgent returns empty prompt for blank template
# Given a SimpleLLMAgent for prompt rendering
# When I render the template "<empty>" with context:
# | key | value |
# | name | Ada |
# Then the rendered prompt should be "<empty>"
#
# TODO: Uncomment when step definitions are implemented
# Scenario: SimpleLLMAgent returns raw template when environment is missing
# Given a SimpleLLMAgent for prompt rendering
# And the SimpleLLMAgent template environment is "none"
# When I render the template "Hello" with context:
# | key | value |
# | name | Ada |
# Then the rendered prompt should be "Hello"
#
# TODO: Uncomment when step definitions are implemented
# Scenario: SimpleLLMAgent renders template when environment succeeds
# Given a SimpleLLMAgent for prompt rendering
# And the SimpleLLMAgent template environment is "working"
# When I render the template "Hello {{ name }}" with context:
# | key | value |
# | name | Ada |
# Then the rendered prompt should be "Hello Ada"
#
# TODO: Uncomment when step definitions are implemented
# Scenario: SimpleLLMAgent falls back to template on render failure
# Given a SimpleLLMAgent for prompt rendering
# And the SimpleLLMAgent template environment is "failing"
# When I render the template "Hello {{ name }}" with context:
# | key | value |
# | name | Ada |
# Then the rendered prompt should be "Hello {{ name }}"
Scenario: SimpleLLMAgent resolves LLM with configured kwargs and caching
Given a SimpleLLMAgent with provider config
And a stub provider registry is installed
When I resolve the LLM twice
Then the registry should be called once with the configured kwargs
And the resolved LLM should be cached
Scenario: SimpleLLMAgent raises when LangChain messages are unavailable
Given a SimpleLLMAgent with provider config
And a stub provider registry is installed
And LangChain message classes are unavailable
When I process "ping" through the LLM agent
Then I should receive a stream routing error about missing messages
Scenario: SimpleLLMAgent process_message_sync returns LLM content
Given a SimpleLLMAgent with system prompt and provider config
And a stub provider registry is installed
And LangChain message stubs are installed
When I process 123 through the LLM agent via process_message_sync
Then the LLM should receive system and human messages
And the LLM agent result should be "llm-output"