Skip to content

refactor(llm): converge service-level LLM calls to unified client#61

Open
Congregalis wants to merge 1 commit intodataelement:mainfrom
Congregalis:codex/llm-client-convergence
Open

refactor(llm): converge service-level LLM calls to unified client#61
Congregalis wants to merge 1 commit intodataelement:mainfrom
Congregalis:codex/llm-client-convergence

Conversation

@Congregalis
Copy link

Summary

This PR converges remaining service-level direct LLM HTTP calls into the unified LLM client abstraction.

It is a preparatory refactor to reduce protocol drift and make future provider expansion (e.g., OpenAI Responses API, Gemini) safer and more localized.

Closes #60

What Changed

  • Replaced direct /chat/completions HTTP call path in agent-to-agent messaging with create_llm_client() + unified LLMMessage/LLMResponse flow.
  • Replaced direct /chat/completions HTTP call path in supervision reminder reply generation with create_llm_client() + unified flow.
  • Kept existing behavior intent (tool loop, token accounting, message flow, limits) as close as possible.
  • Ensured client lifecycle is explicitly closed in refactored paths.

Why

Previously, these service paths bypassed the unified client and hardcoded request/response assumptions. That made future provider support harder and increased inconsistency risk across runtime flows.

After this change, protocol-specific handling is more centralized in the LLM client layer, which lowers the cost of adding provider types like OpenAI Responses and Gemini.

Scope Notes

  • This PR does not introduce new providers.
  • This PR does not perform a model schema redesign (provider + protocol).
  • This PR focuses on convergence with minimal behavior disruption.

Impact

  • Feature-level behavior should remain consistent for current providers.
  • Future provider onboarding should require fewer service-level edits.

Validation

  • Verified modified Python modules compile successfully.
  • Confirmed service-level hardcoded /chat/completions usage was removed from the affected paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Converge LLM call paths to unified client and prepare provider expansion

1 participant