Commit Graph

136 Commits

Author SHA1 Message Date
ciat-777 b834a9bef8 feat: add site_disabled_models and proxy tasks to database schema
- Implemented site_disabled_models table with necessary SQL commands for SQLite, MySQL, and PostgreSQL.
- Updated ensureSiteSchemaCompatibility to create site_disabled_models if it doesn't exist.
- Enhanced database migration service to include site_disabled_models, proxy_video_tasks, and proxy_files in migration statements.
- Created shared index compatibility for new tables and ensured existing indexes are maintained.
- Added tests for schema parity to ensure consistency between runtime schema and defined schema.
2026-03-14 21:16:43 +08:00
ciat-777 0c109278b9 feat(migrate): implement recovery for duplicate-column migrations and enhance migration handling 2026-03-14 20:40:46 +08:00
ciat-777 7d431d3ccd fix(db): detect duplicate-column from nested migration error cause 2026-03-14 19:25:55 +08:00
ciat-777 7bdcf27c41 merge: reconcile migrate bootstrap with duplicate-column recovery 2026-03-14 19:12:23 +08:00
ciat-777 7b8ce3dd13 feat: add recovery for duplicate-column migration errors and enhance migration utilities 2026-03-14 19:10:18 +08:00
Cita b3d678f738 Merge pull request #68 from grassroadsZ/feature/site-model-disable
feat: 将模型禁用功能从站点移至连接管理
2026-03-14 17:26:57 +08:00
ciat-777 7bd48a3c6f fix: improve tester timeouts and telegram proxy config 2026-03-14 16:18:43 +08:00
ciat-777 1a1f0452b3 feat: add delete confirmation modal and enhance token handling
- Implemented a DeleteConfirmModal component for confirming deletions across various pages (Accounts, Sites, Tokens).
- Updated Accounts and Sites pages to utilize the new modal for single and batch deletions.
- Enhanced TokensPanel to support group selection and improved token deletion handling with confirmation.
- Added functionality to skip confirmation for batch actions and handle token group fetching with error management.
- Improved error handling for expired sessions in NewApiAdapter and OneApiAdapter.
- Added tests for new delete confirmation behavior and token editing interactions.
2026-03-14 13:31:15 +08:00
silent 0d44d3ba10 feat: 将模型禁用功能从站点管理移至连接管理
- 在连接管理页面为每个账号添加独立的模型管理弹窗
- 弹窗内支持查看可用模型,进行「刷新模型」「全选」「全部禁用」「反选」等快捷操作
- 保存模型禁用配置后,系统会自动在后台触发并重建路由(rebuildRoutes),确保配置立即生效
- 从原站点编辑界面移除过时的禁用功能板块
- 修复因执行自动同步逻辑导致的 SQLite Drizzle Migration `duplicate column token_group` 报错,更新 bootstrap markers 及测试用例
2026-03-14 12:07:27 +08:00
bnvnvnv b6da71b1d6 feat: add site headers editor and scheduled log cleanup 2026-03-12 08:12:29 +00:00
bnvnvnv 1da3608d42 fix: address review feedback for models and routing 2026-03-12 05:51:53 +00:00
bnvnvnv 5a7531f635 feat: add round robin routing and improve token binding UX 2026-03-12 05:18:36 +00:00
Hureru af83d3525b fix(db): change model_name from TEXT to VARCHAR(191) for MySQL UNIQUE index compatibility 2026-03-11 23:50:02 +08:00
bnvnvnv a5121b8f9f fix: address observability review feedback 2026-03-11 12:00:35 +00:00
root ce32744bad Merge remote-tracking branch 'upstream/main' into feat/site-observability-proxy-logs 2026-03-11 11:44:29 +00:00
bnvnvnv bc3c731ed2 feat: add site observability log drilldown 2026-03-11 11:03:57 +00:00
Cita f904700b73 Merge pull request #53 from Hureru/refactor/token-routes-page
refactor: 重构 TokenRoutes 页面,支持分层加载、网格布局和性能优化
2026-03-11 16:14:25 +08:00
Hureru f5fcf5d707 fix: address code review findings
- fix(api): use effectiveTokenId in route channel insert to match duplicate detection logic
- fix(css): rename keyframes to kebab-case (filter-bar-slide-down/up)
- fix(web): wrap "保存中..." text with tr() in ManualRoutePanel
- fix(web): use ref for fresh cache check and add error handling in useRouteChannels
2026-03-11 15:51:10 +08:00
cita 921c551a3a feat: Implement default API site seeding, add a dialect-aware setting upsert utility, and introduce check-in API routes with background task processing. 2026-03-11 14:31:23 +08:00
cita f43247e91d feat: add multi-dialect database schema compatibility logic for proxy files. 2026-03-11 13:51:13 +08:00
Hureru 5c026df760 fix(db): add schema compatibility for account_tokens.token_group column
Existing databases created before the token_group column was added would
fail on data import. Add accountTokenSchemaCompatibility module to
ALTER TABLE add the missing column, following the established pattern.
2026-03-11 01:15:11 +08:00
Hureru bb7ea90f0b feat(api): add layered route loading endpoints
Add GET /api/routes/summary for lightweight first-screen data,
GET /api/routes/:id/channels for on-demand channel loading,
and POST /api/routes/:id/channels/batch for bulk channel creation.
Extract fetchChannelsForRoutes() as reusable helper.
2026-03-11 01:14:31 +08:00
Hureru 2343383729 feat: add lightweight /api/routes/lite endpoint for route selectors
Avoid loading full route data (channels, decision snapshots) when Settings
page only needs basic route info for selectors.
2026-03-10 23:06:56 +08:00
cita 01bf2212f8 fix: reset health on model discovery success 2026-03-10 16:27:10 +08:00
cita d5cd8292eb test: cover model refresh early returns 2026-03-10 16:12:38 +08:00
cita e1b4452c82 feat: classify model refresh failures and update health 2026-03-10 16:02:45 +08:00
cita 3acba86edf test: expand model refresh failure contract 2026-03-10 15:55:33 +08:00
cita 21cb2ddc62 test: cover model refresh failure health 2026-03-10 15:37:51 +08:00
cita 8ea7be68c1 Refactor code structure for improved readability and maintainability 2026-03-10 14:22:55 +08:00
cita 9a976232e2 feat: add validation for streaming requests on compact responses and include serialization mode in response 2026-03-10 13:01:47 +08:00
cita cd031b732f feat: enhance response serialization for compact mode
- Added support for preserving native response.compaction payloads when compact serialization is requested in `serializeResponsesFinalPayload`.
- Implemented serialization of compact mode as `response.compaction` instead of an ordinary response object.
- Introduced a new type `ResponsesFinalSerializationMode` to manage serialization modes.
- Refactored `serializeResponsesFinalPayload` to handle different serialization modes and usage payloads.
- Added tests to ensure correct behavior for compact serialization and preservation of upstream payloads.
- Updated favicon assets and documentation configuration for VitePress.
2026-03-10 01:28:34 +08:00
cita 74d2e559ec feat: add test for unchanged candidates when avoidSec is omitted and improve condition check in filterRecentlyFailedCandidates 2026-03-09 23:35:21 +08:00
cita 217dff0f72 fix: update test assertions to access parsed claudeOriginalBody structure 2026-03-09 23:25:53 +08:00
cita 0f8176cd04 feat: Implement compatibility strategies for responses and chat endpoints
- Added `routeCompatibility.ts` to handle response compatibility for different endpoints.
- Introduced `chatEndpointStrategy.ts` to manage chat endpoint recovery and downgrading logic.
- Created tests for chat formats and input file handling in `chatFormatsCore.test.ts` and `inputFile.test.ts`.
- Developed `endpointCompatibility.ts` to define compatibility checks and header building for various endpoints.
- Implemented protocol lifecycle management in `protocolLifecycle.ts` and corresponding tests in `protocolModel.test.ts`.
- Enhanced tooltip functionality with a new `TooltipLayer` component and associated tests.
- Refactored existing components to improve tooltip handling and ensure proper rendering in the application.
2026-03-09 22:48:10 +08:00
cita 15d4b207cc feat: rewrite user journey documentation and enhance input file handling in responses 2026-03-09 18:25:09 +08:00
cita 3da1b93c39 feat: update input_file data format to include data URL scheme 2026-03-09 15:45:43 +08:00
cita 44799c0399 fix(tests): remove incorrect mime_type field from input_file in tests 2026-03-09 13:55:57 +08:00
cita 136a038538 feat(tests): enhance modelTesterSession tests and add proxy logs tests
- Updated modelTesterSession tests to serialize assistant history as output_text and removed mime_type from input_file.
- Introduced new tests for stats proxy logs routes, covering paginated log retrieval and detailed log views with parsed billing details.
- Added server-driven tests for ProxyLogs component to validate API interactions and UI rendering based on server data.
2026-03-09 13:48:39 +08:00
cita 3dcf45851f Refactor reasoning handling and metadata management in responses
- Updated chat stream tests to clarify reasoning behavior and ensure correct handling of include lists.
- Enhanced responses proxy route to normalize include lists and apply default reasoning includes based on request context.
- Improved transformer metadata handling, ensuring proper serialization and deserialization of metadata records.
- Added tests for preserving reasoning signatures and managing citations in OpenAI-compatible responses.
- Refined the logic for injecting default includes in responses and ensured compatibility with codex surface defaults.
2026-03-08 23:03:33 +08:00
cita 7bd3114ea0 feat: implement proxy input file resolution and storage
- Added `inputFiles.ts` for handling input file resolution, including validation and normalization of file types.
- Introduced `proxyFileStore.ts` for managing file storage, retrieval, and deletion with owner-based isolation.
- Created tests for proxy file storage functionality in `proxyFileStore.test.ts`.
- Developed `proxyInputFileResolver.ts` to resolve input files in OpenAI and response formats.
- Added utility functions for handling reasoning signatures in `reasoningTransport.ts` and corresponding tests.
- Enhanced shared input file transformers in `inputFile.ts` for better file handling and type inference.
2026-03-08 22:10:31 +08:00
cita ede8998244 Add comprehensive tests for Anthropics and Gemini transformers
- Implement tests for anthropicMessagesTransformer including serialization and event handling in stream.test.ts.
- Add usage extraction tests for anthropicMessagesUsage in usage.test.ts.
- Create extensive tests for Gemini generate content aggregation and outbound usage in aggregator-outbound-usage.test.ts.
- Introduce tests for Gemini stream handling and payload parsing in stream.test.ts.
- Enhance OpenAI response serialization tests to ensure proper mapping of usage details and preservation of annotations in outbound.test.ts.
2026-03-08 16:42:41 +08:00
cita 7081be14c7 feat: Add route grouping schema compatibility checks and integration into migration process 2026-03-08 13:29:25 +08:00
cita 8e291b9bf8 feat: Enhance Gemini and chat proxy routes with improved error handling and fallback mechanisms 2026-03-08 12:54:24 +08:00
cita 23922a5965 feat: Add normalized types and utility functions for handling chat formats
- Introduced `NormalizedContentBlock`, `NormalizedUsage`, and related types for structured data handling.
- Implemented utility functions for creating and merging normalized usage statistics.
- Added a new module for shared transformers to manage chat formats.

feat: Implement app local state management

- Created functions to clear application installation state and manage local storage keys.
- Added constants for theme and user profile storage keys.

test: Add tests for BrandIcon component rendering

- Implemented tests to ensure BrandIcon does not force a colored background for recognized brands.

test: Enhance ModelAnalysisPanel tests

- Added tests for rendering token summaries with compact units in ModelAnalysisPanel.

test: Add tests for ModernSelect component

- Implemented tests to verify icon rendering for selected options in ModernSelect.

test: Add number formatting tests

- Created tests for `formatCompactTokenMetric` to validate token formatting logic.

feat: Implement account creation intent handling

- Added logic to handle session and API key creation intents in the Accounts page.

test: Add tests for dashboard performance card

- Implemented tests to verify rendering of performance metrics in the dashboard.

feat: Implement default connection segment resolution

- Added logic to determine initial connection segments based on platform types.

test: Add tests for settings factory reset functionality

- Implemented tests to verify the factory reset process and local state clearing.

test: Add tests for site creation redirect logic

- Implemented tests to verify redirection based on site capabilities during creation.

test: Add tests for token routes refresh decision action

- Implemented tests to verify refresh decision actions in TokenRoutes.

test: Add tests for token routes snapshot load

- Implemented tests to verify loading of cached snapshot data in TokenRoutes.
2026-03-08 12:08:57 +08:00
cita ed05b37626 feat: enhance TokenRoutes with edit functionality and route visibility management
- Added editing capabilities for route management in TokenRoutes, allowing users to modify existing routes.
- Introduced a reset function for the route form to clear inputs after adding or editing routes.
- Implemented a visibility filter for routes, ensuring exact routes covered by group routes are hidden from the main list.
- Updated tests to cover new functionalities, including editing routes and verifying visibility logic.
- Created a new helper function to build a list of visible routes based on defined criteria.
- Enhanced schema compatibility checks for site configurations, ensuring necessary columns are added to the database.
2026-03-07 19:56:40 +08:00
cita 5ad5b87b16 feat: add withSiteRecordProxyRequestInit mock to siteProxy for testing 2026-03-07 18:17:15 +08:00
cita c437d93715 Add tests for centered modal adoption, search modal results, and accounts batch actions
- Implement tests for the CenteredModal component to ensure it follows the shared modal shell pattern.
- Add comprehensive tests for the SearchModal results, including API interactions and UI behavior.
- Create tests for accounts batch actions, verifying the functionality of refreshing balances and selecting accounts via row clicks.
- Introduce tests for the accounts centered modal to confirm the use of CenteredModal for add/edit/rebind flows.
- Add tests for the accounts edit panel to ensure proper rendering and functionality when opening the edit modal.
- Implement tests for the accounts tokens header to verify the reuse of the accounts page header in the tokens segment.
- Create tests for the system proxy settings, ensuring the correct saving of the proxy URL.
- Add tests for the tokens actions layout to confirm the proper layout and styling of token row actions.
- Implement tests for the tokens batch actions, including deletion of selected tokens and row selection behavior.
- Introduce tests for the tokens focus navigation to ensure the correct highlighting of focused token rows.
2026-03-07 18:04:05 +08:00
cita c31bbcbb51 refactor: remove deprecated apiKey from site management and update related functionality
- Removed apiKey from SiteRow type and related forms in Sites component.
- Updated site saving logic to handle site creation without apiKey.
- Adjusted tests to ensure apiKey is not included in site editor state.
- Refactored Tokens component to support embedded mode and redirect logic.
- Added migration tests for site apiKey to account migration service.
- Implemented siteApiKeyMigrationService to handle migration of apiKey to account tokens.
- Enhanced tests for segmented connections in Accounts and redirect logic for Tokens.
2026-03-07 15:03:30 +08:00
cita 98a2936416 refactor: improve SQLite migration handling and update .gitignore 2026-03-07 00:29:56 +08:00
cita 0d99419b9f feat: implement GOB encoding support for user ID extraction and enhance cookie handling in NewApiAdapter 2026-03-06 22:44:56 +08:00