Commit Graph

359 Commits

Author SHA1 Message Date
Hureru 3195282c4e fix: address review issues in TokenRoutes performance optimization
- Escape modelName/siteName in innerHTML to prevent XSS
- Use content-based routePatternsKey for cache invalidation instead of
  length-only keys that miss content changes
- Extract shared baseFilteredRoutes to eliminate duplicated filter logic
  between enabledCounts and filteredRoutes
- Add candidatesPromiseRef to deduplicate concurrent loadCandidates calls
2026-03-22 19:12:50 +08:00
Hureru 92fd5e034d perf: defer token-candidates loading and lazy-compute heavy route indices
The routes page loaded ~924KB of API data upfront (summary 366KB +
token-candidates 558KB), but token-candidates was only needed when
expanding cards, opening panels, or using filters. This caused a ~3s
element render delay blocking LCP.

Changes:
- Split load() so first paint only fetches routesSummary (366KB)
- Preload token-candidates in background via requestIdleCallback
- Wrap candidates state updates in startTransition to avoid UI jank
- Convert 3 heavy O(routes×models) useMemo indices to lazy per-route
  computation with ref-based cache (candidateIndex, missingTokenIndex,
  missingTokenGroupIndex)
- Guard 4 ManualRoutePanel-only useMemos with showManual check
- Convert 2 derived useMemos to per-route getter functions
- Add loadCandidates() calls at 7 interaction trigger points
2026-03-22 19:00:03 +08:00
Hureru d2db989b98 fix: add bottom border to channel rows for clearer separation 2026-03-22 19:00:02 +08:00
Hureru 835fccb4f5 fix: align site-block and delete buttons in channel row grid layout
Wrap site-block and delete buttons in a flex container and expand grid
to 4 columns so all action buttons stay on the same row.
2026-03-22 18:59:04 +08:00
Hureru 4415317bdc fix: align brand matcher with frontend logic and remove manual model input
- brandMatcher: port collectBrandCandidates + buildMatchContext from
  frontend BrandIcon.tsx so matching is identical between route display
  and rebuild filtering; segments now split on /,:,\s only (not - or _),
  and candidates are recursively generated from /,:,, splits
- Sites.tsx: remove manual model name input and handleAddDisabledModel;
  the checkbox-based batch selection UI fully replaces it
2026-03-22 18:55:40 +08:00
Hureru f14ffd7dc9 fix: address review issues in model filter system
- brandMatcher: split keywords into includes/startsWith/segment/boundary
  modes to align with frontend BrandIcon.tsx matching semantics, preventing
  false-positive blocking from short keywords like o1, tts, command
- handleSiteBlockModel: reject wildcard route patterns (e.g. gpt-*) from
  being written to site disabled list; only allow exact model names
- Sites.tsx: extract brand grouping to useMemo, convert disabledModels
  to Set for O(1) lookup, remove duplicate IIFE computations in JSX
- handleSiteBlockModel: replace window.confirm with project-style DOM
  dialog for visual consistency
- enabledCounts: compute from filtered scope (excluding enabled filter
  itself) so counts reflect current brand/site/search filters
- Fix declaration order: move enabledCounts after sortedRoutes to avoid
  ReferenceError
2026-03-22 18:55:40 +08:00
Hureru cf6ed7db91 feat: add model filter system with site-level batch disable, global brand filter, route status filter, and channel site-block shortcut
- Route status filter: add enabled/disabled filter chips to RouteFilterBar
- Channel site-block: add "站点屏蔽" button on channel rows to quickly
  add a model to a site's disabled list and trigger rebuild
- Site batch selection: new GET /api/sites/:id/available-models endpoint;
  Sites.tsx now shows a brand-grouped checkbox list for batch model disable
- Global brand filter: new brandMatcher.ts service; settings API and UI
  for blocking entire brands from route generation
- Fix infinite scroll race condition when sentinel ref is null during
  IntersectionObserver effect setup after filter changes
2026-03-22 18:55:40 +08:00
Cita 3cc6b7be45 Merge pull request #238 from cita-777/codex/mobile-panel-refactor-final
feat: overhaul mobile management layouts
2026-03-21 20:47:56 +08:00
Cita 09fbf258e2 feat: overhaul mobile management layouts 2026-03-21 20:42:25 +08:00
Cita a81965176f fix: preserve inactive availability after main merge 2026-03-21 20:34:52 +08:00
Cita 3775ee059c Merge remote-tracking branch 'origin/main' into codex/codex-review-fixes
# Conflicts:
#	src/server/services/modelService.ts
2026-03-21 20:31:30 +08:00
Cita fa372d121a fix: preserve availability on inactive refresh failure 2026-03-21 20:27:18 +08:00
Cita 4c14f9c9b0 Merge pull request #234 from cita-777/codex/gemini-oauth-hardening
Fix Gemini OAuth refresh and failure coverage
2026-03-21 20:13:08 +08:00
Cita 4480f504e4 fix: satisfy server build typing 2026-03-21 19:58:41 +08:00
Cita d9e550c279 fix: address codex review findings 2026-03-21 19:45:29 +08:00
Cita b7a1e523e7 fix: reuse oauth singleflight in gemini discovery 2026-03-21 19:29:33 +08:00
Cita e09fb43b33 Merge pull request #236 from cita-777/codex/claude-count-models
Fix Claude count_tokens compatibility and OAuth model discovery
2026-03-21 19:28:18 +08:00
Cita 1d8889001f fix: harden codex runtime routing and oauth recovery 2026-03-21 19:07:14 +08:00
Cita dc93c58582 Fix Claude count tokens routing and model discovery 2026-03-21 18:42:28 +08:00
Cita dd48550ffa Fix Gemini OAuth refresh and failure coverage 2026-03-21 18:38:00 +08:00
Cita 500ba25787 fix: bypass multimodal endpoint memory for gemini 2026-03-21 18:37:36 +08:00
Cita 6a19d809f0 Merge pull request #233 from cita-777/codex/login-surface-pr
feat(web): redesign login surface
2026-03-21 17:17:51 +08:00
ciat-777 719e21cce7 feat(web): redesign login surface 2026-03-21 17:12:11 +08:00
ciat-777 89d0aba497 fix: refine config backup import semantics 2026-03-21 16:55:32 +08:00
ciat-777 7e09ce83b8 fix(proxy): strip responses-only tools on chat fallback 2026-03-21 16:38:46 +08:00
Cita f586d3f318 Merge pull request #229 from cita-777/codex/gemini-claude-identity-encoding
Codex/gemini claude identity encoding
2026-03-21 15:55:51 +08:00
ciat-777 5a4f881b95 fix: restore generic inline document endpoint fallbacks 2026-03-21 15:52:22 +08:00
ciat-777 ab31e0b1c9 fix: preserve local usage state on backup import 2026-03-21 15:41:46 +08:00
ciat-777 7a2953ac36 fix: decode zstd responses while restoring claude encoding 2026-03-21 15:38:11 +08:00
Cita e1f4fde916 Merge pull request #228 from cita-777/codex/fix-pr-115-rebased
fix(web): polish WebDAV backup form controls
2026-03-21 14:16:19 +08:00
ciat-777 dbc17f6907 fix(web): polish webdav backup form controls 2026-03-21 14:05:52 +08:00
ciat-777 17a4281117 fix: avoid messages fallback for generic file uploads 2026-03-21 14:03:35 +08:00
Cita d17e80f05e Merge pull request #227 from cita-777/codex/openclaw-user-agent-v2
fix: detect openclaw user-agent in proxy logs
2026-03-21 13:56:14 +08:00
ciat-777 272b88c6c8 fix: detect openclaw user-agent in proxy logs 2026-03-21 13:53:02 +08:00
ciat-777 e454ec18ec fix(api): unwrap downstream key unique violations 2026-03-21 13:30:06 +08:00
Cita 9b17c3ebdf Merge pull request #159 from Hureru/feat/account-level-proxy
feat(proxy): account-level proxy URL override
2026-03-21 13:14:08 +08:00
ciat-777 424e1e210b test: align claude count tokens encoding expectation 2026-03-21 12:56:34 +08:00
ciat-777 1b78359739 fix: force identity encoding for claude messages 2026-03-21 12:48:34 +08:00
ciat-777 04655a8b17 fix(proxy): honor account proxy during oauth discovery 2026-03-21 12:46:46 +08:00
ciat-777 7c9bdc51c7 fix: prefer self-reported proxy log client names 2026-03-21 11:48:15 +08:00
Hureru 4d0c4b8129 feat(proxy): propagate account-level proxy across all surfaces
- chatSurface/openAiResponsesSurface: extract channelProxyUrl once and pass to withSiteRecordProxyRequestInit
- geminiSurface: switch from withSiteProxyRequestInit to withSiteRecordProxyRequestInit with channelProxyUrl
- balanceService: pass accountProxyUrl to sub2api token refresh requests
- siteProxy: fix isAccountOverride to only be true when account proxy differs from site proxy
- Accounts.tsx: use parseAccountExtraConfig helper for proxy badge display
2026-03-21 11:44:57 +08:00
Hureru 8df3b1431f Merge remote-tracking branch 'origin/main' into feat/account-level-proxy
# Conflicts:
#	src/server/proxy-core/surfaces/chatSurface.ts
#	src/server/proxy-core/surfaces/openAiResponsesSurface.ts
#	src/server/routes/proxy/embeddings.ts
#	src/server/routes/proxy/images.ts
#	src/server/services/modelService.ts
2026-03-21 10:09:19 +08:00
Cita 4ba7749391 Merge pull request #220 from cita-777/codex/webdav-backup-armv7l
Add WebDAV backup sync and armv7 Docker builds
2026-03-21 01:24:51 +08:00
ciat-777 7c227d8365 Handle replay hydration file fetch timeouts 2026-03-21 01:03:03 +08:00
ciat-777 1ce036fd46 Address PR review for WebDAV and armv7 2026-03-21 00:48:42 +08:00
ciat-777 bc52b6b5fd Add WebDAV backup sync and armv7 Docker builds 2026-03-21 00:06:16 +08:00
cita 95bf8df499 fix modeltester attachment replay and add proxy file retention 2026-03-21 00:04:06 +08:00
Cita 94b6cac871 Merge pull request #218 from cita-777/codex/modeltester-attachment-review-fixes
[codex] Fix model tester attachment replay and capability gating
2026-03-20 23:12:43 +08:00
cita 78f6c5b2cc Merge origin/main into codex/modeltester-attachment-review-fixes 2026-03-20 23:09:27 +08:00
cita 4369aeb1cb fix model tester attachment replay and capability gating 2026-03-20 22:56:01 +08:00