Summary
There are currently two separate Venice AI client implementations in the backend:
backend/src/services/venice/ — the canonical, well-tested client with cache, dedup, and circuit breaker (client.ts, cache.ts, dedup.ts)
backend/src/venice/ — a smaller duplicate with its own circuitBreaker.ts and client.ts
This causes: divergent retry/backoff behavior, duplicated API key handling, confusion about which client agents use, and maintenance burden. The smaller duplicate also appears to be missing cache/dedup functionality.
Priority
P0 — Two competing Venice clients cause divergent behavior, duplicated config, and untracked fixes.
Files to work on
backend/src/services/venice/ (canonical — keep)
backend/src/venice/ (delete or merge)
backend/src/services/venice/circuitBreaker.ts (restore if missing)
Requirements
- Audit usage of both clients across
backend/src/agents/ and backend/src/coordinator/
- Consolidate all imports to
backend/src/services/venice/
- Migrate any unique functionality from
backend/src/venice/ into backend/src/services/venice/
- Delete
backend/src/venice/ directory
- Update all imports and verify no residual references remain
- Add a test that verifies only one
VeniceClient class exists
Acceptance Criteria
Summary
There are currently two separate Venice AI client implementations in the backend:
backend/src/services/venice/— the canonical, well-tested client with cache, dedup, and circuit breaker (client.ts,cache.ts,dedup.ts)backend/src/venice/— a smaller duplicate with its owncircuitBreaker.tsandclient.tsThis causes: divergent retry/backoff behavior, duplicated API key handling, confusion about which client agents use, and maintenance burden. The smaller duplicate also appears to be missing cache/dedup functionality.
Priority
P0 — Two competing Venice clients cause divergent behavior, duplicated config, and untracked fixes.
Files to work on
Requirements
backend/src/agents/andbackend/src/coordinator/backend/src/services/venice/backend/src/venice/intobackend/src/services/venice/backend/src/venice/directoryVeniceClientclass existsAcceptance Criteria
backend/src/services/venice/exists —backend/src/venice/is deletedbackend/src/services/venice/VeniceClientfrom both pathsgrep -r "from '../venice/"returns no matches inbackend/src/npm run lintandnpm testpass