fullex
|
8fe0d6448a
|
refactor(dead-code): remove orphaned modules and components after v2 migration
Remove 75 dead files left behind by v2 refactors that replaced their
implementations but did not delete the originals. All deletions verified
by pnpm typecheck (0 errors) and pnpm test (670/670 files, 9416 passed).
Whole-feature removals:
- pages/onboarding/* (6 files): superseded by new onboarding flow
- components/Popups/ApiKeyListPopup/* (6 files): replaced by v2
ProviderApiKeyListDrawer
- components/Sortable/* (8 files): replaced by packages/ui composites
Sortable (#14940 antd/styled-components migration)
- components/RichEditor/.../dragContextMenu/* (12 files): notes module
drag-context-menu feature removed
- components/HealthStatusIndicator/* (4 files): consumers removed in
d15e15e1f v1 provider/model hooks retire
Cross-cutting cleanup:
- Settings page residuals from provider-settings v2 migration (#14631)
- Message component residuals: MessageImage, MessageSelect,
NewTopicButton, PermissionModeDisplay, SectionName
- AgentSettings Tasks: TaskListItem, TaskLogsModal (per 6f37603d6)
- Legacy UI wrappers obsoleted by @cherrystudio/ui migration:
ConfirmDialog, PopoverConfirm, CustomCollapse, Ellipsis,
ModelIdWithTags (x2), ModelSelectButton, Tags/{Error,Success,Warn}Tag,
TableActionMenu, RichEditPopup, VideoPopup, OpenaiAlert
- Built-in tools removed: tools/{index,think}.ts (per eff583abb)
- Legacy aiCore layer plugin: reasoningTimePlugin (per 188f25478)
- Main process leftovers: proxy/bootstrap, PreprocessingService,
createStreamAbortController, IBaseService
- Misc fossils: utils/stream (Windows7-era), base-transformer,
model-test-utils, endpointTypes, files/ContentView,
mini-apps/MiniAppFullPageView
|
2026-05-22 08:45:28 -07:00 |
|
SuYao
|
1c0a5a95fa
|
refactor: migrate to ai sdk v6 Phase 3 (#12235)
Continued from #12227
## Summary
Phase 3 of AI SDK v6 migration:
- **Image generation**: Migrate to native AI SDK
`generateImage`/`editImage`, remove legacy image middleware
- **Embedding**: Migrate to AI SDK `embedMany`, remove legacy embedding
clients
- **Model listing**: Refactor `ModelListService` to Strategy Registry
pattern (`listModels.ts`), consolidate 7 schema files into one
`schemas.ts`
- **OpenRouter image**: Bump `@openrouter/ai-sdk-provider` to 2.3.3 with
native image endpoint support, remove `isNativeImageGenerationProvider`
guard
- **GitHub Copilot**: Simplify extension by removing `ProviderV2` cast
and `wrapProvider`
- **Legacy removal**: Delete all legacy API clients, middleware
pipeline, and barrel `index.ts`
- **Rename**: `index_new.ts` → `AiProvider.ts`, `ModelListService.ts` →
`listModels.ts`
## Manual Test Plan
### P0 — Core paths + PR change focus
#### 1. Core Chat
- [ ] OpenAI model (e.g. GPT-4o): send text, verify streaming output
- [ ] Anthropic model (e.g. Claude Sonnet): verify chat works
- [ ] Gemini model: verify chat works
- [ ] DeepSeek model: verify chat works
- [ ] Reasoning mode (o3-mini, DeepSeek R1): verify thinking process
displays
- [ ] Send message with image (multimodal): verify model recognizes
image
- [ ] Abort mid-stream: verify clean termination, no errors
#### 2. Image Generation (key change area)
- [ ] DALL-E 3 / GPT-Image-1: verify image generation works
- [ ] OpenRouter image model: verify **native image endpoint** is used
(no longer chat completions)
- [ ] Image editing: upload image + text prompt, verify editImage path
- [ ] Verify generated images display correctly (both base64 and URL
formats)
#### 3. Model Listing (refactored area)
- [ ] Sync OpenAI models: verify names and groups
- [ ] Sync Gemini models: verify `models/` prefix stripped
- [ ] Sync Ollama models (local): verify display
- [ ] Sync OpenRouter models: verify chat + embedding models both appear
- [ ] Sync SiliconFlow models: verify grouping (e.g. `deepseek-ai/`)
- [ ] Sync GitHub Models
- [ ] Sync Together models
- [ ] Sync NewAPI service (e.g. CherryIn)
- [ ] Sync PPIO models: verify chat + embedding + reranker endpoints
merged
### P1 — Affected by refactor
#### 4. Provider Extensions
- [ ] GitHub Copilot: verify chat works (simplified wrapProvider logic)
- [ ] Ollama: verify chat works
- [ ] Vertex AI / Bedrock: verify chat works (if configured)
#### 5. MCP Tool Calling
- [ ] Enable MCP server, send tool-requiring message, verify tool
execution
- [ ] Verify both prompt tool use and function calling modes
#### 6. Auxiliary Functions
- [ ] Auto topic title generation (fetchMessagesSummary)
- [ ] Note summary (fetchNoteSummary)
- [ ] Translation/generation (fetchGenerate)
- [ ] API check (click "Check" button in settings)
### P2 — Indirect impact
#### 7. Knowledge Base
- [ ] Create knowledge base, associate with assistant, verify RAG
retrieval and embedding
#### 8. Web Search
- [ ] Enable native web search (Gemini/Perplexity), verify search
results in response
#### 9. Tracing
- [ ] Enable developer mode, send message, verify trace spans recorded
and displayed
---------
Signed-off-by: suyao <sy20010504@gmail.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: icarus <eurfelux@gmail.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
|
2026-04-02 15:38:23 +08:00 |
|