Commit Graph

3 Commits

Author SHA1 Message Date
HAL9000 883ec872e2 fix(CI): resolve remaining lint/format violations in PR #8722
CI / lint (push) Successful in 1m54s
CI / build (push) Successful in 1m29s
CI / quality (push) Successful in 2m1s
CI / typecheck (push) Successful in 2m7s
CI / security (push) Successful in 2m20s
CI / helm (push) Successful in 29s
CI / integration_tests (push) Successful in 4m17s
CI / push-validation (push) Successful in 20s
CI / e2e_tests (push) Successful in 4m21s
CI / unit_tests (push) Successful in 5m42s
CI / benchmark-regression (push) Has been skipped
CI / docker (push) Successful in 2m1s
CI / coverage (push) Successful in 13m48s
CI / status-check (push) Successful in 4s
CI / benchmark-publish (push) Successful in 1h17m24s
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 51s
CI / helm (pull_request) Successful in 32s
CI / lint (pull_request) Successful in 1m4s
CI / typecheck (pull_request) Successful in 1m18s
CI / quality (pull_request) Successful in 1m19s
CI / security (pull_request) Successful in 1m25s
CI / push-validation (pull_request) Successful in 20s
CI / integration_tests (pull_request) Successful in 3m31s
CI / benchmark-regression (pull_request) Failing after 53s
CI / e2e_tests (pull_request) Successful in 5m13s
CI / unit_tests (pull_request) Successful in 6m43s
CI / coverage (pull_request) Has been cancelled
CI / docker (pull_request) Has been cancelled
CI / status-check (pull_request) Has been cancelled
- Apply ruff format to features/steps/strategize_decision_recording_steps.py:
  expanded single-line set literal to multi-line canonical form (PEP 87)
  This was the sole remaining CI lint blocker per review cycle 14.

- Remove unused imports from tests/actor/test_registry_builtin_yaml.py:
  removed 'Settings' and 'ProviderRegistry' to fix F401 errors.
  These were pre-existing violations caught by ruff check.

ISSUES CLOSED: #8522

Closes: #8722
2026-05-08 06:24:23 +00:00
hurui200320 8dc55655e9 feat(actor): make built-in actors virtual, resolved on-demand from provider registry
CI / push-validation (push) Successful in 41s
CI / helm (push) Successful in 42s
CI / benchmark-publish (push) Failing after 56s
CI / build (push) Successful in 1m6s
CI / lint (push) Successful in 1m13s
CI / quality (push) Successful in 1m34s
CI / typecheck (push) Successful in 2m12s
CI / security (push) Successful in 2m13s
CI / e2e_tests (push) Successful in 3m45s
CI / integration_tests (push) Successful in 3m57s
CI / unit_tests (push) Successful in 4m53s
CI / docker (push) Successful in 1m34s
CI / coverage (push) Successful in 11m27s
CI / status-check (push) Successful in 3s
CI / benchmark-publish (pull_request) Has been skipped
CI / helm (pull_request) Successful in 32s
CI / push-validation (pull_request) Successful in 33s
CI / build (pull_request) Successful in 53s
CI / lint (pull_request) Successful in 59s
CI / quality (pull_request) Successful in 1m28s
CI / security (pull_request) Successful in 1m29s
CI / typecheck (pull_request) Successful in 1m32s
CI / e2e_tests (pull_request) Successful in 4m1s
CI / integration_tests (pull_request) Successful in 5m4s
CI / unit_tests (pull_request) Successful in 5m51s
CI / docker (pull_request) Successful in 1m27s
CI / coverage (pull_request) Successful in 11m51s
CI / status-check (pull_request) Successful in 3s
Replace the DB-persistence approach for built-in actors with in-memory virtual
resolution. Built-in actors (e.g. openai/gpt-4o, anthropic/claude-sonnet) are
now resolved on-demand from ProviderRegistry at query time and merged with
persisted custom actors — no database writes occur for built-in actors.

Key changes:
- Add ActorRegistry._resolve_virtual_builtin_actors(): generates virtual Actor
  objects in-memory from configured providers (is_built_in=True, id=None)
- ActorRegistry.list()/list_actors(): merges virtual built-ins with custom DB
  actors; custom actors win on name collision; result sorted alphabetically
- ActorRegistry.get()/get_actor(): DB-first, virtual built-in fallback,
  NotFoundError if neither
- ActorRegistry.remove()/remove_actor(): rejects virtual built-in names with
  ValidationError
- ActorRegistry.set_default_actor(): stores only the actor name string via new
  actor_preferences singleton table; no actor row created for virtual built-ins
- ActorRegistry.get_default_actor(): reads preference name, resolves via
  DB→virtual chain, returns actor with is_default=True
- Remove ensure_built_in_actors() entirely — 20+ call sites cleaned up including
  plan.py
- Remove ActorRepository.upsert_built_in() — no longer needed
- Remove is_built_in from ActorModel DB column (kept on Actor domain model for
  virtual actors)
- New Alembic migration m10_001_virtual_builtin_actors: drops is_built_in column,
  adds actor_preferences singleton table
- Add ActorService.set_default_actor_name() and get_default_actor_name() for
  preference storage without requiring a DB actor row
- Update 15+ Behave step files and 5 feature files; add new
  features/virtual_builtin_actors.feature with 8 scenarios covering list, show,
  remove, set-default, get-default, no-DB-writes guarantees
- Rewrite tests/actor/test_registry_builtin_yaml.py: TestEnsureBuiltInActorsWithYaml
  → TestResolveVirtualBuiltinActors plus new TestListActors, TestGetActor,
  TestRemoveActor, TestDefaultActor test classes

Quality gates: lint ✓, typecheck ✓, unit_tests ✓ (15674 scenarios), coverage ✓
(97.10%), integration_tests ✓ (1997 tests)

ISSUES CLOSED: #10923
2026-04-30 10:56:21 +00:00
hurui200320 bb6765d85e fix(actor): add v3 YAML text generation for built-in actors
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 56s
CI / quality (pull_request) Successful in 1m12s
CI / typecheck (pull_request) Successful in 1m26s
CI / security (pull_request) Successful in 1m20s
CI / build (pull_request) Successful in 38s
CI / helm (pull_request) Successful in 36s
CI / push-validation (pull_request) Successful in 36s
CI / integration_tests (pull_request) Successful in 3m10s
CI / e2e_tests (pull_request) Successful in 3m21s
CI / unit_tests (pull_request) Successful in 4m31s
CI / docker (pull_request) Successful in 1m31s
CI / coverage (pull_request) Successful in 11m45s
CI / status-check (pull_request) Successful in 3s
CI / status-check (push) Blocked by required conditions
CI / push-validation (push) Successful in 37s
CI / helm (push) Successful in 41s
CI / benchmark-publish (push) Failing after 56s
CI / build (push) Successful in 1m0s
CI / lint (push) Successful in 1m35s
CI / quality (push) Successful in 1m37s
CI / typecheck (push) Successful in 1m59s
CI / security (push) Successful in 2m0s
CI / e2e_tests (push) Successful in 3m53s
CI / integration_tests (push) Successful in 4m44s
CI / unit_tests (push) Successful in 5m27s
CI / docker (push) Successful in 1m30s
CI / coverage (push) Failing after 22m54s
Built-in actors (e.g., openai/gpt-4, anthropic/claude-3-opus) were failing
silently with agents actor run because they lacked the required v3 type
field in their stored configuration. The ReactiveConfigParser._is_v3_format()
check failed, resulting in empty agents/routes dictionaries and no output.

This fix adds _generate_builtin_actor_yaml() helper to ActorRegistry that
generates spec-compliant v3 YAML text including:
- type: llm (required for v3 format recognition)
- description (required by v3 schema)
- name, model, provider, capabilities, unsafe, source fields

The ensure_built_in_actors() method now calls this helper and persists
yaml_text via upsert_actor(), ensuring built-in actors work identically
to custom actors with the agents actor run command.

Existing built-in actors will be automatically refreshed on next startup
since they are regenerated from the provider registry - no database
migration needed.

Added:
- _generate_builtin_actor_yaml() helper method
- BDD feature file with scenarios for v3 YAML format
- Step definitions for new BDD scenarios
- Unit tests covering YAML generation and schema validation
- CHANGELOG entry

ISSUES CLOSED: #10883
2026-04-28 12:38:04 +00:00