-
Notifications
You must be signed in to change notification settings - Fork 170
Port aiCore changes from upstream cherry-studio (HEAD~100..28bc89ac) #122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
22
commits into
main
Choose a base branch
from
copilot/port-aicore-code-changes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Co-authored-by: DeJeune <[email protected]>
Co-authored-by: DeJeune <[email protected]>
Co-authored-by: DeJeune <[email protected]>
Copilot
AI
changed the title
[WIP] Port code changes from upstream CherryHQ/cherry-studio to src/aiCore
Port aiCore changes from upstream cherry-studio (HEAD~100..28bc89ac)
Nov 1, 2025
- Upgrade AI SDK packages to latest versions and add new providers (Google Vertex, HuggingFace, Mistral, Perplexity) - Replace OpenAI package with @cherrystudio/openai and add GitHub Copilot integration - Add React Native crypto packages (react-native-crypto, react-native-quick-crypto, react-native-quick-base64) - Remove unsupported providers (CherryAI, OVMS) and disable telemetry/tracing features - Update file handling to use Expo FileSystem API instead of Electron IPC - Fix ESLint configuration to support TypeScript function overloading - Add integration directory to Prettier ignore list
- Import react-native-quick-crypto for cryptographic functionality - Set global.crypto synchronously for Node.js-style require support - Maintain existing structuredClone and async polyfill setup
…Copilot - Implement AWS Bedrock settings component with region, access key ID, and secret access key fields - Add VertexAI settings component for project ID, location, client email, and private key configuration - Create GitHub Copilot authentication flow with device code verification and user info display - Integrate provider-specific settings into API service screen based on provider type
- Convert `useAwsBedrock` and `useVertexAI` hooks into `AwsBedrockService` and `VertexAIService` singleton classes - Update settings components to use service methods instead of hook imports - Replace hook usage in API service screen with service class methods - Maintain identical functionality while improving code organization
- Move AWS Bedrock credential logic from hooks to AwsBedrockService with async loading - Refactor Vertex AI configuration to use VertexAIService with async credential loading - Update provider config to handle async credential loading for special providers - Add prepareSpecialProviderConfig for runtime credential injection
- Fix package.json typo in expo-secure-store dependency name - Implement KeyValueService using MMKV storage for React Native - Remove LMStudio keep-alive and Redux state dependencies in BaseApiClient - Clean up unused constructors and commented AnthropicVertexClient code - Update Vertex API host formatting to work without Redux store
…ntations - Delete obsolete ApiClientFactory test files that were testing deprecated client factory logic - Replace Electron-specific Vertex AI auth with React Native JWT-based service account authentication - Remove Electron store dependencies and use mobile-compatible key-value service for API key rotation - Add Google Cloud auth utility for generating OAuth tokens from service account credentials
- Add buffer polyfill to Metro config for Node.js compatibility - Extend API key configuration exclusion to include VertexAI providers - Maintain existing exclusions for Copilot and AWS Bedrock providers
- Add `usesNonExemptEncryption: false` to iOS config for App Store compliance - Configure expo-secure-store with Android backup and Face ID permission - Pin expo-secure-store version to ~15.0.7 for stability - Remove unused crypto polyfill from polyfills.js
…lasses - Replace direct SecureStore imports with lazy loading to prevent early native module access - Convert service classes to singleton pattern with private constructors and getInstance methods - Update all SecureStore method calls to use the lazy-loaded instance - Maintain existing functionality while improving initialization safety
- Replace direct service calls with custom hooks for AWS Bedrock, Vertex AI, and Copilot token management - Add loading states and disable save buttons during async operations - Move SecureStore operations to dedicated useSecureStorage hook for lazy loading - Update services to focus on business logic while hooks handle storage
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.
Ports 70 files (5,920 insertions, 1,633 deletions) from upstream Electron app's
src/renderer/src/aiCoreto React Native app'ssrc/aiCore, covering last 100 commits through28bc89ac7ccd9acf502f9e564848ed1530a7b373.Changes
New Files (16)
openrouterGenerateImageMiddleware,qwenThinkingMiddleware,toolChoiceMiddlewareModified Files (54)
Import Transformations
All files transformed for React Native:
Known Issues
~80 lint errors, ~200 type errors expected due to missing React Native equivalents for Electron-specific code:
KnowledgeService,SpanManagerService,FileManageruseAwsBedrock,useVertexAI,useLMStudio@cherrystudio/openai,@anthropic-ai/vertex-sdk, various AI SDK providerswindow.api.*,window.keyv.*need React Native bridge equivalentsSee
PORTING_SUMMARY.mdfor complete breakdown and required follow-up work.State file
.github/port-bot-stateupdated with upstream commit hash for future incremental ports.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.