Commit Graph
384 Commits
Author SHA1 Message Date
RCDandClaude acdf099442 feat(openai): add responses/compact support
Cherry-picked from upstream 95096bc3

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-02-01 11:28:45 +07:00
RCDandClaude 71a502075e fix(logging): capture streaming TTFB on first chunk and make timestamps required
- Add firstChunkTimestamp field to ResponseWriterWrapper for sync capture
- Capture TTFB in Write() and WriteString() before async channel send
- Add SetFirstChunkTimestamp() to StreamingLogWriter interface
- Make requestTimestamp/apiResponseTimestamp required in LogRequest()
- Remove timestamp capture from WriteAPIResponse() (now via setter)
- Fix Gemini handler to set API_RESPONSE_TIMESTAMP before writing response

This ensures accurate TTFB measurement for all streaming API formats
(OpenAI, Gemini, Claude) by capturing timestamp synchronously when
the first response chunk arrives, not when the stream finalizes.

Cherry-picked from upstream: 295f34d7

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-01-30 15:31:30 +07:00
RCDandClaude bcd735b2a8 fix(logging): add API response timestamp and fix request timestamp timing
Previously:
- REQUEST INFO timestamp was captured at log write time (not request arrival)
- API RESPONSE had NO timestamp at all

This fix:
- Captures REQUEST INFO timestamp when request first arrives
- Adds API RESPONSE timestamp when upstream response arrives
- Add Timestamp field to RequestInfo, set at middleware initialization
- Set API_RESPONSE_TIMESTAMP in appendAPIResponse() and gemini handler
- Pass timestamps through logging chain to writeNonStreamingLog()
- Add timestamp output to API RESPONSE section

Cherry-picked from upstream: c41ce77e

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-01-30 15:30:56 +07:00
RCDandClaude 41b1ad654e feat(config): add oauth-model-alias migration support
Add migration logic for converting oauth-model-mappings to oauth-model-alias
with comprehensive test coverage.

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-01-29 21:30:09 +07:00
RCDandClaude 92bf72d8c5 feat(amp): add Amp CLI proxy module
Add complete Amp module for routing requests through the Amp CLI:
- Core module with lifecycle management
- Gemini bridge for model translation
- Model mapping configuration
- Proxy handler for request forwarding
- Response rewriter for format conversion
- Secret management for API keys
- Route definitions and fallback handlers
- Comprehensive test coverage

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-01-29 21:22:19 +07:00
RCD e0fa10b669 feat: sync with upstream v6.7.13
Features ported from upstream:
- feat(claude): add native request cloaking support
- feat(translator): add candidate count (n param) support for Gemini
- fix(translator): consolidate multiple system messages into single message (#1064)
- feat(codex): add config toggle for codex instructions injection
- feat(auth): add hashed account ID to credential filenames for team plans
- feat(config): add support for raw JSON payload rules (default-raw, override-raw)
- feat(codex): add OpenCode instructions based on user agent

Also includes minor whitespace cleanup and code organization.
2026-01-20 14:08:05 +07:00
RCD e6e7e6db30 feat(registry): support provider-specific model info lookup
Add InfoByProvider map to ModelRegistration to store provider-specific
ModelInfo, enabling different capabilities for the same model across
providers (e.g., direct API vs OpenRouter).

Changes:
- Add InfoByProvider field to ModelRegistration struct
- Update GetModelInfo to accept provider parameter for provider-specific lookup
- Update LookupModelInfo to accept variadic provider parameter
- Add LookupStaticModelInfo for fallback to static model definitions
- Update ApplyThinking to pass providerKey for registry lookups
- Update all GetModelInfo callers to use new signature
- Remove ensureMaxTokensForThinking test (function moved to thinking package)

Ported from CLIProxyAPI e641fde2
2026-01-20 11:15:39 +07:00
RCD ed136fef5d refactor(logging): centralize log directory resolution logic
- 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.
2026-01-19 06:07:51 +07:00
Finessse f415504d35 feat(api): add rate limits monitoring endpoints
- 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
2026-01-12 07:37:03 +07:00
Finessse baf72225a5 sync(upstream): codex subscription dates + logger cleanup
Cherry-picked:
- 6494330c: add subscription date fields to ID token claims
- bc3195c8: remove unnecessary request details limit logic
2026-01-11 06:24:54 +07:00
Finessse 01e1d5aed2 sync(upstream): auth rotation atomic fix + memory leak fixes
- fix(auth): make provider rotation atomic (keep shouldKeepProviderOrder)
- fix(server): resolve memory leaks in failed attempts and codex cache
  - Add background cleanup goroutine for stale IP entries
  - Add cache expiry cleanup for codex prompt cache
- Update provider rotation tests for atomic rotation

Cherry-picked: 8be06255, 47dacce6
Merged with ProxyPilot's shouldKeepProviderOrder for gemini-3 fallback
2026-01-11 06:11:37 +07:00
Finessse fd9d097b8e sync(upstream): management API and executor improvements
- feat(management): add generic API call handler
- Fix: disable thinking when tool_choice forces tool use
- feat(api): add ManagementTokenRequester interface (sans iflow)
- fix(management): refresh antigravity token for api-call $TOKEN$
- fix(auth): error when antigravity refresh token missing during refresh

Cherry-picked: ade71947, aca2ef63, ee171bc5, b01619b4, 5e5d8142
Adapted: removed iflow references (not in ProxyPilot)
2026-01-11 06:00:37 +07:00
Finessse 3a8fac2514 feat(server): wire up lightweight profile toggles and configurable CORS 2026-01-09 23:40:39 +07:00
Finessse 6990e769ea fix(management): return 404 when request history is disabled 2026-01-09 23:39:28 +07:00
Finessse 69ba18a095 fix(middleware): respect request history sampling in logging middleware 2026-01-09 23:39:14 +07:00
Finessse 8b9f5ebe00 feat(middleware): add runtime toggle and sampling for request history 2026-01-09 23:39:00 +07:00
Finessse 65e243ec1b feat(middleware): add runtime toggle for Prometheus metrics 2026-01-09 23:38:47 +07:00
Finessse fce1e62aa4 perf(middleware): pool response body buffers to reduce GC pressure 2026-01-09 23:38:34 +07:00
Finessse 5fdb0ff618 feat(webui): add per-account usage display
Auth table shows daily output tokens and request count.
Hover tooltip displays total usage stats.
API exposes usage field in auth-files response.
2026-01-08 04:34:50 +07:00
Finessse d317728d93 feat(webui): add priority controls and token expiry display
ProviderLogins table now shows:
- Priority column with up/down reorder buttons
- Expires column with color-coded status (green/yellow/red)
API exposes token_expires_at for WebUI consumption.
2026-01-06 06:22:40 +07:00
Finessse 30978f1f17 feat(cache): add response cache and prompt cache tracking
Response cache stores completions keyed by request hash.
Prompt cache tracking aggregates cache_read/cache_creation tokens.
WebUI CacheStats component shows hit rates and token savings.
2026-01-06 06:21:54 +07:00
Finessse 093e77c8c0 feat: add priority/usage APIs, WebUI dashboard, config options
- PATCH /v0/management/auth/:id/priority endpoint
- GET /v0/management/auth/:id/usage endpoint
- AccountUsage.tsx dashboard component
- AutoRefreshBuffer, DailyResetHour config fields
- Conductor wiring for refresh config
2026-01-05 12:59:29 +07:00
Finessse b9ccbfb107 refactor: remove Continue integration
Continue VS Code extension is no longer supported.
2026-01-05 00:19:59 +07:00
Finessse 99c4d3ccc3 feat(memory): harden summarization pipeline 2026-01-01 00:51:56 +07:00
Finessse e5aec4a28e fix(harness): skip initializer in existing projects 2026-01-01 00:51:46 +07:00
Finessse 36621166c8 feat(antigravity): capture tier metadata and retry delays 2026-01-01 00:51:28 +07:00
Finessse 0ce9661a88 feat(api): serve embedded dashboard assets
Replace placeholder HTML with actual embedded React assets.
Serve index.html, JS, CSS, and static files from embed.FS.
2025-12-31 02:01:31 +07:00
Finessse de5098f8aa feat(api): integrate connection tracker and metrics
Wire ConnectionTrackerMiddleware and /metrics endpoint into
the Gin engine for production observability.
2025-12-31 02:00:22 +07:00
Finessse 2219bc04e4 feat(api): add Prometheus metrics endpoint
Expose /metrics endpoint for observability with request counts,
latencies, and connection stats.
2025-12-31 02:00:01 +07:00
Finessse 94ef02e19d feat(api): add connection tracker middleware
Track active HTTP connections with thread-safe counter.
Exposes ActiveConnections.Count() for monitoring.
2025-12-31 01:59:17 +07:00
Finessse ea371ccfc6 refactor: remove desktop GUI, keep CLI + tray architecture
- Delete cmd/proxypilotui/main_windows.go (desktop GUI)
- Keep cmd/proxypilotui/assets/ (web dashboard)
- Update cliproxytray to remove embedded asset server
- Update proxypilot_dashboard.go for standalone dashboard
- Update README and docs for CLI + tray architecture
- Update proxypilotpack build scripts
2025-12-30 00:25:15 +07:00
Finessse 710a2dc3bc chore(api): update dashboard route configuration 2025-12-29 21:21:42 +07:00
Finessse 3e8d6e3c92 feat(api): register management routes for new features
Register routes for:
- /request-history/* endpoints (persistent history)
- /thinking-budget endpoint (extended thinking config)

Initialize RequestHistoryManager with auto-save.
2025-12-29 21:20:07 +07:00
Finessse 891a52c5de feat(api): add thinking budget management endpoint
Add GET/PUT /thinking-budget endpoint for configuring extended
thinking token budgets. Supports preset levels (Low 2048, Medium 8192,
High 32768) and custom values with enable/disable toggle.
2025-12-29 21:18:58 +07:00
Finessse f7ae19d960 feat(api): add request history API endpoints
Add management endpoints for request history:
- GET /request-history - list entries with pagination
- GET /request-history/stats - aggregate statistics
- DELETE /request-history - clear all entries
- POST /request-history/export - export to JSON
- POST /request-history/import - import from JSON
- POST /request-history/save - force save to disk

Integrate RequestHistoryManager with request logging middleware.
2025-12-29 21:18:45 +07:00
Finessse ad355f75a7 feat(api): add persistent request history storage
Add RequestHistoryManager with file-based persistence at
~/.cli-proxy-api/request-history.json. Features:
- Max 500 entries with automatic pruning
- Auto-save every 30 seconds
- Thread-safe with mutex protection
- In-memory ring buffer for performance
2025-12-29 21:18:31 +07:00
Finessse 1e48d75aa8 feat(api): register new management routes
Wire up auth files and agents v2 management endpoints
2025-12-29 19:00:30 +07:00
Finessse 233eb30219 feat(api): add agents v2 management endpoints
Add comprehensive management API for agent configuration
2025-12-29 19:00:28 +07:00
Finessse e372d2220b feat(api): add auth files management endpoints
Add management endpoints for listing and managing auth token files
2025-12-29 19:00:27 +07:00
Finessse 70f292a8c8 refactor(api): fix generic import after iFlow removal
- Remove iFlow import and case handler
- Add importResult type definition (was in deleted iflow_import.go)
2025-12-28 20:49:33 +07:00
Finessse 75a9908a3b refactor(api): remove iFlow from oauth sessions
Remove iFlow case from provider normalization switch.
2025-12-28 20:49:24 +07:00
Finessse f780519ee6 refactor(api): remove iFlow handlers from auth_files
- Remove iFlow auth import
- Remove RequestIFlowToken handler
- Remove RequestIFlowCookieToken handler
2025-12-28 20:49:15 +07:00
Finessse 8822013a74 refactor(api): remove iFlow routes from server
Remove iFlow OAuth callback and management API routes.
2025-12-28 20:48:54 +07:00
Finessse 0b448f7aa7 refactor(api): remove iFlow import handlers
Remove iFlow bulk import handler and tests.

Deleted files:
- internal/api/handlers/management/iflow_import.go
- internal/api/handlers/management/iflow_import_test.go
2025-12-28 20:48:02 +07:00
Finessse 82f02c6d59 feat(management): allow API key auth for localhost management endpoints
Enables configured API keys to authenticate management API requests
from localhost, making it easier to use tools like curl for local testing.
2025-12-28 10:45:00 +07:00
Finessse b127b674e9 sync: squash merge upstream CLIProxyAPI v6.6.62
Synced with upstream v6.6.61-v6.6.62 changes:
- Added usage export/import endpoints
- Added normalizeCodexKey function
- Updated BootstrapRetries type
- Enhanced model definitions and antigravity config

Preserved ProxyPilot customizations:
- Kept CompressionConfig for long-context sessions
- Kept Kiro, GitHub Copilot, Amazon Q model definitions
- Kept shouldKeepProviderOrder for Gemini-3 provider stability
- Kept advanceProviderCursor pattern (separate cursor advancement)
- Removed AmpCode integration (not used)

Version: 0.1.4
2025-12-28 08:32:11 +07:00
Finessse 018cba3491 feat(dashboard): add logo route and improve auth key handling
Add /logo.png route for branding and prefer server instance password
over env var for management key injection.
2025-12-28 07:10:36 +07:00
Finessse d0c29cb584 feat(api): wire translator endpoints to router
Add translation API routes for matrix, check, docs, score, and
compare endpoints.
2025-12-28 07:09:11 +07:00
Finessse e96d568671 feat(api): add translator HTTP endpoints
Add REST API handlers for translation matrix, format checking,
documentation, quality scoring, and structure comparison.
2025-12-28 07:08:51 +07:00
Finessse 68cf672e6b refactor(integrations): improve agent detection and configuration
Update CLI agent detection and configuration handling. Improve
integration handlers for better error handling and status reporting.
2025-12-28 03:20:46 +07:00