Commit Graph
9 Commits
Author SHA1 Message Date
Tam Nhu Tran ac1c744239 fix(cliproxy-sync): honor profile settings paths and targets
- resolve settings file from profile.settingsPath instead of reconstructing by name

- skip non-claude targets for local claude-api-key sync semantics

- add mapper regression tests for both behaviors
2026-02-25 17:01:22 +07:00
kaitranntt bbad73b554 fix(cliproxy): harden sync against edge cases
Backend:
- Handle config file deletion race condition with try-catch
- Add null check for empty config files in yaml.load()
- Limit profile names to 64 chars, require alphanumeric content
- Add 5s timeout for watcher close() to prevent hangs

Frontend:
- Add 30s fetch timeout with AbortController for sync requests
2026-01-28 13:58:16 -05:00
kaitranntt 4124780ce0 fix(cliproxy): improve sync robustness and consistency
- Add timeout warning in restartAutoSyncWatcher when sync exceeds 10s
- Improve YAML key detection with regex pattern for safer parsing
- Replace --force help with --verbose (no confirmation prompt exists)
- Add force flag parsing for future use
2026-01-28 13:49:46 -05:00
kaitranntt e80d2d2d05 fix(cliproxy): address sync review feedback
- Fix auto_sync JSDoc to say (default: true) matching actual default
- Add unlink event handler for profile deletion sync
- Add debug logging for sync failures in api-command
2026-01-28 13:44:00 -05:00
kaitranntt c3f85bc4a8 fix(cliproxy): correct sync terminology and add unit tests
- Fix "Remote" → "Local" in sync-dialog.tsx and CLI help text
- Add resetWatcherState() export for test cleanup
- Add unit tests for profile-mapper, local-config-sync, auto-sync-watcher
- Remove unused ModelAlias and AliasesResponse types from hooks
2026-01-28 13:26:40 -05:00
kaitranntt 68a63a7768 fix(cliproxy): preserve config comments during sync
- Use section-based replacement instead of full yaml.dump()
- Only update claude-api-key section, keep rest of file intact
- Preserves comments, formatting, and key ordering
2026-01-28 11:57:22 -05:00
kaitranntt 32dbd5e174 refactor(cliproxy): remove model alias functionality
- delete model-alias-config.ts and cliproxy-alias-handler.ts

- simplify sync to use ANTHROPIC_MODEL directly

- remove alias routes, hooks, and UI components
2026-01-28 11:57:22 -05:00
kaitranntt 9924b2fb25 fix(cliproxy): address edge cases in sync module
- Reset isSyncing flag in stopAutoSyncWatcher (prevents stale state)
- Validate empty profile names in mapProfileToClaudeKey
- Add whitespace validation in API routes (POST/DELETE /aliases)
- Add Number.isInteger check for port validation
- Wrap response.json() in try-catch for React hooks (handles non-JSON 502)
2026-01-28 11:57:22 -05:00
kaitranntt 9de2682062 feat(cliproxy): add local config sync module
- add profile mapper to transform CCS profiles to ClaudeKey format
- add model alias configuration with defaults for glm/kimi/qwen
- add local config sync to write claude-api-key section
- add auto-sync watcher with debouncing for profile changes
- include null config handling and temp file cleanup
2026-01-28 11:57:22 -05:00