Skip to content

Issue #601: consolidate LLM client registry resolution - #614

Merged
stranske merged 4 commits into
mainfrom
codex/issue-601-llm-client-consolidation
Jun 21, 2026
Merged

Issue #601: consolidate LLM client registry resolution#614
stranske merged 4 commits into
mainfrom
codex/issue-601-llm-client-consolidation

Conversation

@stranske

@stranske stranske commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Source: Issue #601

Closes #601

Summary

  • move LangChain slot/registry resolution into tools.llm_registry as the single source of truth
  • keep tools.langchain_client focused on LangChain object construction with compatibility wrappers
  • add regression tests that fail if local slot/registry resolver classes are reintroduced or the script adapter stops delegating

Validation

  • UV_CACHE_DIR=/tmp/pd-workloop-uv-cache uv run ruff check tools/langchain_client.py tools/llm_registry.py scripts/langchain/_llm_client.py tests/tools/test_langchain_client_config.py tests/tools/test_llm_client_single_source.py
  • UV_CACHE_DIR=/tmp/pd-workloop-uv-cache uv run pytest tests/tools/test_langchain_client_config.py tests/tools/test_llm_client_single_source.py -q --no-cov
  • Deliberate break: temporarily reintroduced SlotDefinition in tools/langchain_client.py; test_langchain_client_uses_llm_registry_as_single_resolution_source failed, then the break was reverted and tests passed again.

Summary by CodeRabbit

  • Refactor

    • Centralized LLM model/slot resolution, including slot config loading with sensible defaults, per-slot environment overrides, and blocked-model filtering for safer provider/model selection.
  • Tests

    • Added coverage to ensure model/slot resolution uses a single source of truth and that the client adapter delegates client creation correctly.
    • Added configuration tests verifying invalid slot payload shapes (non-list and non-object entries) are ignored and default slots are used.

Automated Status Summary

Scope

Scope section missing from source issue.

Context for Agent

Related Issues/PRs

Tasks

Acceptance criteria

  • Named test: provider resolution for a given slot goes through the canonical module and honors the registry. Deliberate-break -> revert: re-add a second resolver path a caller uses -> a "single source of truth" assertion (or the registry test) FAILS -> revert.
  • grep -rl <removed module> returns no callers after migration.

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

Assignees

Couldn't load assignees.