Commit Graph

17 Commits

Author SHA1 Message Date
freemo 6a6ce518bf fix(provider): make LangChainChatProvider name and model_id mutable properties
The LangChainChatProvider class defined name and model_id as read-only
properties without setters, causing AttributeError when PlanService
attempted to set these properties after provider instantiation.

Root Cause:
- LangChainChatProvider.name and .model_id were @property without @setter
- PlanService._resolve_ai_provider_for_actor() attempts to mutate these
  properties at lines 411 and 413
- This caused: AttributeError: property 'name' of 'LangChainChatProvider'
  object has no setter

Solution:
Added property setters for both name and model_id:
  @name.setter
  def name(self, value: str) -> None:
      self._name = value

  @model_id.setter
  def model_id(self, value: str) -> None:
      self._model_id = value

This allows PlanService to correctly resolve provider names and model IDs
without raising AttributeError.

Impact:
- Fixes the agents build command crash when using agents tell
- No regression: existing functionality unchanged
- Properties remain type-safe (str -> str)

ISSUES CLOSED: #1553
2026-04-02 21:12:08 +00:00
freemo 9148590542 fix(providers): add missing module docstring to providers package 2026-03-14 03:33:37 +00:00
freemo a074b4846f fix(provider): remove FakeListLLM defaults
Remove FakeListLLM as a silent fallback in agent graph constructors
(plan_generation.py, context_analysis.py, auto_debug.py). All three now
raise ValueError when llm=None, making missing-provider errors explicit.

Add Settings.mock_providers flag and validate_provider_availability()
method. Update container.get_ai_provider() to check Settings.mock_providers
first, with env-var fallback for backward compatibility.

Add resolve_provider_by_name() helper to the provider registry and export
it from cleveragents.providers. Add structlog trace logging to
ProviderRegistry.get_default_provider_type() to record selection reasoning.

Update all existing behave step files, robot tests, and benchmarks that
relied on the implicit FakeListLLM default to pass an explicit LLM
instance instead.

Add new BDD tests (features/provider_fixes.feature with 17 scenarios),
Robot Framework integration tests (robot/provider_detection_smoke.robot),
and ASV benchmarks (benchmarks/provider_selection_bench.py).

ISSUES CLOSED: #323
2026-02-27 09:47:10 -05:00
freemo 134dce896a feat(provider): add cost controls and fallback
Add token/cost tracking, budget enforcement (per-plan and per-day),
provider fallback selection with capability filtering, and cost
metadata for plan models.

New modules:
- providers/cost_table.py: CostEntry + ProviderCostTable with default
  pricing for OpenAI, Anthropic, Google, Groq, Together, Cohere, Mock
- providers/cost_tracker.py: BudgetStatus enum, BudgetCheckResult,
  CostTracker with warn-at-90%/block-at-100% enforcement
- providers/fallback_selector.py: FallbackSelector with capability
  filtering (tool_calls, streaming, vision, json_mode) and budget
- domain/models/core/cost_metadata.py: CostMetadata + BudgetExhaustionEvent

Modified:
- config/settings.py: budget_per_plan, budget_per_day, fallback_providers
- domain/models/core/plan.py: cost_metadata field + CLI dict surfacing
- providers/__init__.py: public exports for new classes

Testing:
- 71 Behave scenarios in features/cost_controls.feature (all pass)
- 6 Robot Framework integration tests (all pass)
- ASV benchmarks in benchmarks/cost_controls_bench.py
- nox lint, typecheck, format, docs, build, dead_code, security_scan pass

Closes #324
2026-02-25 12:08:01 -05:00
brent.edwards 7ef5ebb695 feat: Add Q0: Pre-commit hooks setup.
This should automatically check for problems on build.
2026-02-10 16:04:17 +00:00
freemo 559aa15629 Feat: Wire actor invocation context through plan graph/providers and add streaming CLI coverage. 2025-12-24 18:50:34 -05:00
freemo 0296e7c3b7 Feat connected settings to the providers so they no longer provide mock providers 2025-12-10 12:39:07 -05:00
freemo 0cb4bc3ad3 Feats: Implemented OpenRouter support 2025-12-09 19:28:24 -05:00
freemo 2d64005fec Feats: Added google / Gemini provider 2025-12-09 18:28:14 -05:00
freemo 337d78cf92 Feat: Now capturing token usage as well as passing along the streaming command from some providers 2025-12-09 14:23:47 -05:00
freemo f82d9552d1 Feat: Added OpenAI and Antropic provider support and tests 2025-12-08 23:02:29 -05:00
freemo 896cc60d55 Feat continued development on OpenAI placeholder 2025-12-08 20:41:23 -05:00
freemo d06051f821 Feat Added ability for PlanService to take per-request providers 2025-12-08 17:45:49 -05:00
freemo 480d77a18e Feat: Finished stage 3, LangChain and LangGraph foundations 2025-12-06 16:30:12 -05:00
freemo 407b7ec53e Feat: Created provider registry 2025-12-05 12:03:58 -05:00
freemo b86df64505 Feat: Started to implement llm providers 2025-11-28 23:52:23 -05:00
CleverAgents Dev fb6f559780 feat(architecture): Added skeleton for phase 1 2025-11-05 15:11:03 -05:00