Repository navigation
refactor: Split AISDKClient into focused modules (#173) - #190
Merged
Merged
Conversation
This refactoring splits the 846-line ai-sdk-client.ts into focused, single-responsibility modules following the established pattern in the codebase. **Changes:** - Created source/ai-sdk-client/ directory with organized subdirectories - Split error handling: error-parser.ts, error-extractor.ts - Split converters: message-converter.ts, tool-converter.ts - Split chat logic: chat-handler.ts, streaming-handler.ts, tool-processor.ts - Extracted provider factory: providers/provider-factory.ts - Created simplified AISDKClient.ts that composes the modules - Added comprehensive test coverage for all new modules (42 test files) - Updated all imports across codebase to use new structure - All modules are now <300 lines each (largest is 240 lines) **Testing:** - All existing tests pass (2619 tests) - New test files added for each module - TypeScript strict mode passes - Biome linting passes - Knip unused code check passes
Avtrkrb
approved these changes
Dec 21, 2025
JimStenstrom
added a commit
to JimStenstrom/nanocoder
that referenced
this pull request
Dec 23, 2025
Fixes regression introduced in PR Nano-Collective#190 (AISDKClient refactor) where Math.random() was reintroduced after PR Nano-Collective#177 had replaced it with crypto for secure ID generation.
2 tasks done
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
This PR splits the 846-line
source/ai-sdk-client.tsinto focused, single-responsibility modules following the established pattern in the codebase (similar tosource/utils/logging/,source/types/,source/tools/).Related Issue: #173
Changes
Directory Structure Created
Key Improvements
Test Plan
Breaking Changes
None - all imports have been updated and the public API remains unchanged.