refactor: address technical debt with modularization and type safety#177
Closed
laynepenney wants to merge 4 commits intomainfrom
Closed
refactor: address technical debt with modularization and type safety#177laynepenney wants to merge 4 commits intomainfrom
laynepenney wants to merge 4 commits intomainfrom
Conversation
Create comprehensive removal plan for consolidating Ollama functionality under the regular ollama provider. The ollama-cloud provider has proven unreliable while the ollama provider works correctly with Ollama Cloud via the OpenAI-compatible API. Key changes planned: - Remove ollama-cloud provider registration and implementation - Update configuration validation and CLI options - Provide migration guide for existing users - Maintain full functionality through regular ollama provider The regular ollama provider is more reliable and already supports Ollama Cloud with native tool calling via OpenAI-compatible API. Wingman: Codi <codi@layne.pro>
Consolidate Ollama functionality under the regular 'ollama' provider, which already works correctly with Ollama Cloud via the OpenAI-compatible API. The dedicated ollama-cloud provider had authentication and tool calling issues while the ollama provider offers superior reliability and simpler maintenance. Key changes: - Remove OllamaCloudProvider implementation and factory registration - Delete src/providers/ollama-cloud.ts (927 lines) - Update provider validation to exclude 'ollama-cloud' - Update CLI options and help text - Fix model-map configuration defaults and examples - Update RAG embeddings provider handling - Clean up test references and comments - Provide migration path: --provider ollama with OLLAMA_HOST=https://ollama.com The regular ollama provider uses the OpenAI-compatible API which: - Supports native tool calling with JSON schema - Has proven reliability with Ollama Cloud - Uses robust OpenAI SDK - Simplified maintenance overhead All existing functionality is preserved. Build: ✅ Tests: ✅ Wingman: Codi <codi@layne.pro>
- Extract ~400 lines from index.ts into src/cli/ modules: - history.ts: command history management - pipeline-input.ts: file/glob resolution - non-interactive.ts: single-prompt mode execution - Improve workflow type safety with discriminated unions: - Add BaseWorkflowStep interface and WorkflowStep union type - Add type guards (isShellStep, isSwitchModelStep, etc.) - Replace `as any` casts with proper type narrowing - Fix symbol-index metadata types: - Add hasExtendsMetadata type guard - Add SymbolMetadataWithExtends interface - Fix flaky E2E test in commands.e2e.test.ts: - Add waitForOutputFlush helper to ProcessHarness - Use generic patterns and clearOutput() for robustness - Create plugin system investigation document: - Security analysis and recommendations - API stability assessment - Phased re-enablement roadmap Reduces `as any` usage from 30+ to 9 instances. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Collaborator
Author
Self-Review
Verified Changes
|
Collaborator
Author
|
Closing this PR to split into separate PRs:
This avoids mixing unrelated changes in a single PR. |
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
index.tsinto modularsrc/cli/components (history, pipeline-input, non-interactive)Changes
New Modules (
src/cli/)history.ts- Command history managementpipeline-input.ts- File/glob resolution utilitiesnon-interactive.ts- Single-prompt mode executionindex.ts- Module exportsType Safety Improvements
BaseWorkflowStepinterface andWorkflowStepdiscriminated unionisShellStep,isSwitchModelStep,isConditionalStep, etc.hasExtendsMetadatatype guard for symbol indexas anyusage from 30+ to 9 instancesTest Fixes
waitForOutputFlush()helper toProcessHarnessclearOutput()for robustnessDocumentation
docs/PLUGIN-INVESTIGATION.md- Security analysis, API stability, and re-enablement roadmapTest plan
pnpm buildpasses with 0 errors🤖 Generated with Claude Code