Skip to content

[WIP]feat: Support Cherry Studio as a Service (CSaaS) #8098

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

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft

Conversation

vaayne
Copy link
Collaborator

@vaayne vaayne commented Jul 12, 2025

#5640

What this PR does

Before this PR:

After this PR:

Fixes #

Why we need it and why it was done in this way

The following tradeoffs were made:

The following alternatives were considered:

Links to places where the discussion took place:

Breaking changes

If this PR introduces breaking changes, please describe the changes and the impact on users.

Special notes for your reviewer

Checklist

This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.

Release note


@vaayne vaayne marked this pull request as draft July 12, 2025 03:29
@vaayne vaayne force-pushed the feat/CSaaS branch 2 times, most recently from 4e48563 to 2d69ddb Compare July 17, 2025 03:14
vaayne and others added 10 commits July 18, 2025 21:22
Add Hono v4.8.4 as a new dependency for lightweight web framework capabilities.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
…outes

- Remove custom ChatCompletionMessage and ChatCompletionResponse interfaces
- Import and use official ChatCompletion and ChatCompletionChunk types from OpenAI package
- Update response and streaming chunk type annotations
- Maintain backward compatibility with existing API structure

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Replace monolithic server with clean modular Hono architecture
- Add modern middleware using createMiddleware() factory and built-in middleware (timing, requestId, logger, prettyJSON, cors)
- Reorganize routes into separate Hono apps with proper basePath and route mounting
- Implement centralized config management with automatic API key generation
- Add comprehensive error handling with development/production mode support
- Create clean Node.js HTTP server integration with proper request/response conversion
- Move business logic to organized services directory
- Remove legacy route files and unnecessary abstractions
- Simplify ApiServerService as clean wrapper around new implementation
- Maintain full backward compatibility while using modern Hono patterns

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Convert provider utility functions to async to properly wait for Redux store initialization:
- getAvailableProviders() now waits for store readiness using reduxService.select()
- listAllAvailableModels() and getProviderByModel() updated to handle async providers
- Updated all callers in ChatCompletionService and chat routes to use await

Fixes "Cannot read properties of undefined (reading 'providers')" error that occurred when API server started before Redux store was fully initialized.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
The changes improve API server configuration by making Redux select
async, adding proper logging, and preventing API key changes while
server is running.
vaayne and others added 4 commits July 18, 2025 23:49
The handlers were moved from ipc.ts to the ApiServerService class for
better organization and encapsulation.
Add MCP (Model Control Panel) API with routes and service for server management.
Includes functionality to list, create, update, and delete servers, plus toggle
server state and manage server sessions. Complete with unit tests and API
integration in the main app.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants