Skip to content

[4.D.5] Refactor backend_worker_agent, frontend_worker_agent, test_worker_agent to use LLMProvider #547

@frankbria

Description

@frankbria

Parent

Part of #542 — Multi-provider LLM support

Depends on

#546 — worker_agent.py pattern established first

What

Three additional worker agents hardcode AsyncAnthropic directly. Apply the same refactor pattern from #546.

Files to modify

  • codeframe/agents/backend_worker_agent.py
  • codeframe/agents/frontend_worker_agent.py
  • codeframe/agents/test_worker_agent.py
  • Corresponding test files

Pattern to follow

Same as #546: replace AsyncAnthropic(api_key=...) instantiation with self.llm_provider.async_complete(). Accept llm_provider: LLMProvider | None = None in constructor with get_provider() as default.

Notes

  • backend_worker_agent.py has a fallback import (from anthropic import AsyncAnthropic) — remove entirely once abstraction is in place
  • Each agent may have agent-specific system prompts; keep those, only replace the LLM call layer
  • If any agent uses Anthropic-specific features (extended thinking, computer use) — note them explicitly and leave a # TODO: provider-specific comment rather than breaking functionality

Acceptance criteria

  • All three agents have no import anthropic anywhere
  • Each accepts llm_provider constructor param
  • Existing tests pass
  • No agent-specific functionality regressed

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestphase-4Phase 4: Multi-Agent CoordinationrefactorIssues specifically associated with the refactor

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions