Epic 4.5: Extract LLMFactory from OpenSpace#34
Merged
Conversation
New module: openspace/llm_factory.py (66 lines) - LLMFactory class: centralized LLM client creation from config - create_main(): primary LLM client with full config params - create_tool_retrieval(): optional tool retrieval LLM (shares credentials) tool_layer.py: replaced 18 lines of inline LLM construction with 6 lines delegating to LLMFactory (-12 net lines) Tests: 12 tests in test_llm_factory.py - Init state and config storage - create_main: full config passthrough, defaults, idempotency - create_tool_retrieval: enabled/disabled, config passthrough, kwargs inheritance - OpenSpace backward compatibility All 1,356 existing tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add docstring note on intentional param asymmetry in create_tool_retrieval() - Add empty-string model test (M1: treats '' same as None) - Add create_tool_retrieval twice test (M2: idempotency) - Add constructor exception test (C2: propagates, client stays None) - Fix fragile call_args unpacking (use .kwargs) Tests: 12 → 16 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔒 Phase Gate Enforcement — 🚫 FAIL
Verdict: FAIL
|
Deepfreezechill
pushed a commit
that referenced
this pull request
Apr 3, 2026
Restructure initialize() from 190-line monolith into clean orchestration: - initialize(): 70-line high-level flow with numbered steps - _load_grounding_config(): config loading, backend scope resolution - _setup_skill_engine(): skill registry, store, analyzer, evolver Cleanup: - Remove dead imports (asyncio, uuid — now in ExecutionEngine) - Remove stale extraction comments (4.1/4.3 notes) - Update from_container docstring (remove Phase 4 TODO — it's done) Public API unchanged. All 1,356 tests pass. P4 tool_layer.py decomposition summary (788 → 477 lines, -39%): - 4.1: ToolRegistry (206 lines, PR #31) - 4.3: ExecutionEngine (459 lines, PR #32) - 4.4: RecordingService (70 lines, PR #33) - 4.5: LLMFactory (68 lines, PR #34) - 4.6: Facade cleanup (this PR) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Deepfreezechill
added a commit
that referenced
this pull request
Apr 3, 2026
* feat(4.6): refactor OpenSpace into clean facade Restructure initialize() from 190-line monolith into clean orchestration: - initialize(): 70-line high-level flow with numbered steps - _load_grounding_config(): config loading, backend scope resolution - _setup_skill_engine(): skill registry, store, analyzer, evolver Cleanup: - Remove dead imports (asyncio, uuid — now in ExecutionEngine) - Remove stale extraction comments (4.1/4.3 notes) - Update from_container docstring (remove Phase 4 TODO — it's done) Public API unchanged. All 1,356 tests pass. P4 tool_layer.py decomposition summary (788 → 477 lines, -39%): - 4.1: ToolRegistry (206 lines, PR #31) - 4.3: ExecutionEngine (459 lines, PR #32) - 4.4: RecordingService (70 lines, PR #33) - 4.5: LLMFactory (68 lines, PR #34) - 4.6: Facade cleanup (this PR) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: remove unused Path import (review finding) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore: remove stray main_tool_layer.py artifact Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Brian Krafft <bkrafft@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extracts LLM client creation from OpenSpace.initialize() into LLMFactory.
What moved
Impact
Review: 5 agents, all APPROVE