Port the internal/thinking package from CLIProxyAPI for unified thinking
configuration processing across all AI providers.
Features:
- Core types: ThinkingConfig, ThinkingMode, ThinkingLevel, SuffixResult
- Suffix parsing: model-name(16384) or model-name(high) syntax
- Validation: auto-conversion between budget/level formats, clamping
- Provider appliers: claude, gemini, antigravity, openai, codex
- Config extraction: extract thinking config from various request formats
- Stripping: remove thinking config for non-supporting models
Registry updates:
- Add UserDefined field to ModelInfo for passthrough behavior
- Add LookupModelInfo function for model capability lookup
- Add ResolveLogDirectory() for consistent log path resolution
- Add SetLogLevel() for string-based log level configuration
- Update ConfigureLogOutput() to take *config.Config parameter
- Update all callers to use simplified API
Cherry-picked from CLIProxyAPI with adaptations.
Gemini API requires enum values to be strings. This adds NormalizeEnumValues
to convert numeric or boolean enum values to their string representations.
Cherry-picked from CLIProxyAPI.
- Add Auto-Updates and Rollback Support features to Features list
- Add Auto-Updates section with configuration options
- Add Rollback Support section explaining crash detection and recovery
- Document tray menu options for updates and rollback
Tray app integration:
- Health check on startup with auto-rollback trigger
- Background update polling with configurable interval
- One-click update menu item (shown when available)
- Manual rollback menu item in Settings
- Mark healthy after 30s of stable operation
- Graceful cleanup on exit (stop engine, stop poller)
New rollback module for version recovery:
- Version-aware backup metadata tracking
- Platform-specific restore (Windows batch, Unix swap)
- Crash loop detection via startup health monitoring
- Auto-rollback after 3 rapid failures in 30s window
- MarkHealthy() clears failure counter after stable run
Install module updated to save rollback info on update.
New UpdateBanner component for dashboard:
- Auto-checks for updates on mount with 2s delay
- Shows dismissible banner when update available
- Session-based dismissal persistence
- Download progress bar during update
- Integrated into App.tsx main layout
New poller module for periodic update checks:
- Configurable polling interval
- Channel support (stable/prerelease)
- Callback-based notification system
- Global singleton for tray integration
- Graceful start/stop with context cancellation
Cherry-pick from CLIProxyAPI v6.7.7 (f8f3ad8).
Fixes issue where only the last system/developer message was preserved
when multiple were provided. Added systemPartIndex counter to accumulate
parts across all system messages instead of overwriting at index 0.
Also fixed path inconsistency in gemini_openai_request.go where the
array branch incorrectly used request.systemInstruction instead of
system_instruction.
Fixes: router-for-me/CLIProxyAPI#1064
Add check to ensure 'instructions' field exists in Execute, ExecuteStream,
and CountTokens functions before sending request to Codex API.
Cherry-picked from:
- CLIProxyAPI v6.7.4 (902bea2)
Change conditional check from gemini-3-pro-preview (alias) to
gemini-3-pro-high (internal name) for system instruction injection.
Cherry-picked from:
- CLIProxyAPI v6.7.3 (c3ef46f)
- Add Claude 4.5 model variants (opus, sonnet, haiku)
- Add Gemini 2.0/2.5 Flash and Pro pricing
- Add OpenAI o3/o4-mini pricing
- Update date reference from Dec 2024 to Jan 2026
- GET /v0/management/rate-limits - detailed per-credential status
- GET /v0/management/rate-limits/summary - availability overview
- Shows available, cooling_down, disabled counts and next recovery time
- Bubbletea-based TUI with 5 tabs: Status, Accounts, Rate Limits, Usage, Logs
- Industrial control room aesthetic with orange/green color scheme
- Double-line borders (╔═╗), active tab indicator 【】
- 3-column stat boxes on Status, 4-column on Usage
- Visual gauge bar for rate limit availability
- Config-optional mode allows TUI to run without config.yaml
- Full-width frame with properly aligned borders
New Accounts submenu:
- Copy Account List (-list-accounts)
- Cleanup Expired (-cleanup-expired)
- Export Accounts... (-export-accounts)
- Import Accounts... (-import-accounts)
All menu items harness CLI binary for single source of truth.
Add menu items to copy CLI output to clipboard:
- Copy Account Status (account health summary)
- Copy Usage Stats (token usage by provider)
- Copy Model List (available models)
- Copy Recent Logs (last 100 log entries)
Uses stdout capture to get formatted CLI output.
- Add -usage flag (token usage stats per provider)
- Add -logs flag (view recent logs, -n for line count)
- Add -refresh flag (force token refresh)
- Add -list-models flag (show available models)
- Add -export-accounts/-import-accounts (backup/restore)
- Add --include-tokens and --force flags for export/import
- install.ts: read version from package.json (auto-sync)
- release.yml: manual dispatch only (no auto-trigger on tags)
- proxypilot-release.yml: add checksums.txt generation
- Add 26 tests for SetLogLevel() in logging package
- Add 6 tests for AppError in errors package
- Add 10 tests for SDKConfig in config package
- Add 3 tests for EmailRequiredError in sdk/auth
- Remove dead code: GeminiCLIToken type alias, LoadGeminiCLIToken,
LoadGeminiCLITokenFromPath (no callers found)
- Add tests for gemini auth (CredentialFileName, SaveTokenToFile)