fix(amp): rewrite model name in response.model for Responses API SSE events
Muhammad Zahid Masruri
edfde0b
The ResponseRewriter's modelFieldPaths was missing 'response.model',
causing the mapped model name to leak through SSE streaming events
(response.created, response.in_progress, response.completed) in the
OpenAI Responses API (/v1/responses).
This caused Amp CLI to report 'Unknown OpenAI model' errors when
model mapping was active (e.g., gpt-5.2-codex -> gpt-5.3-codex),
because the mapped name reached Amp's backend via telemetry.
Also sorted modelFieldPaths alphabetically per review feedback
and added regression tests for all rewrite paths.
Fixes #1463
fix(management): ensure management.html is available synchronously and improve asset sync handling
hkfires
42655a1
refactor(management): streamline control panel management and implement sync throttling
hkfires
1aa7716
feat: add Kimi authentication support and streamline device ID handling
- Introduced `RequestKimiToken` API for Kimi authentication flow.
- Integrated device ID management throughout Kimi-related components.
- Enhanced header management for Kimi API requests with device ID context.
refactor(codex): remove codex instructions injection support
hkfires
f1597d6
refactor(api): centralize config change logging
hkfires
e643b8a
feat(logging): make error-logs-max-files configurable
sususu98
d84297e
- Add ErrorLogsMaxFiles config field with default value 10
- Support hot-reload via config file changes
- Add Management API: GET/PUT/PATCH /v0/management/error-logs-max-files
- Maintain SDK backward compatibility with NewFileRequestLogger (3 params)
- Add NewFileRequestLoggerWithOptions for custom error log retention
When request logging is disabled, forced error logs are retained up to
the configured limit. Set to 0 to disable cleanup.
Merge pull request #1248 from shekohex/feat/responses-compact
fix(logging): capture streaming TTFB on first chunk and make timestamps required
sususu98
f8405bc
- 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.
fix(logging): add API response timestamp and fix request timestamp timing
sususu98
6d6fab0
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
Changes:
- 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
This enables accurate measurement of backend response latency in error logs.
fix(api): update amp module only on config changes
hkfires
82a8ee4
feat(api): add management model definitions endpoint
fix(auth): use backend project ID for free tier Gemini CLI OAuth users
perf(management): optimize auth lookup in PatchAuthFileStatus
Aldino Kemal
7845211
Use GetByID() for O(1) map lookup first, falling back to iteration
only for FileName matching. Consistent with pattern in disableAuth().
feat(management): add PATCH endpoint to enable/disable auth files
Aldino Kemal
a8fea5f
Add new PATCH /v0/management/auth-files/status endpoint that allows
toggling the disabled state of auth files without deleting them.
This enables users to temporarily disable credentials from the
management UI.
Merge pull request #1067 from router-for-me/auth-files
- Introduced `ResolveLogDirectory` function in `logging` package to standardize log directory determination across components.
- Replaced redundant logic in `server`, `global_logger`, and `handlers` with the new utility function.
refactor(auth): simplify filename prefixes for qwen and iflow tokens
hkfires
fb71a92
feat(codex): add config toggle for codex instructions injection
hkfires
8c8617e
refactor(config): rename oauth-model-mappings to oauth-model-alias
hkfires
280ebf0
refactor: improve thinking logic
hkfires
c44624a
feat(codex): add subscription date fields to ID token claims
hkfires
0a51fda
Merge pull request #947 from pykancha/fix-memory-leak
Fixes issue where free tier users cannot access Gemini 3 preview models
due to frontend/backend project ID mapping.
## Problem
Google's Gemini API uses a frontend/backend project mapping system for
free tier users:
- Frontend projects (e.g., gen-lang-client-*) are user-visible
- Backend projects (e.g., mystical-victor-*) host actual API access
- Only backend projects have access to preview models (gemini-3-*)
Previously, CLIProxyAPI ignored the backend project ID returned by
Google's onboarding API and kept using the frontend ID, preventing
access to preview models.
## Solution
### CLI (internal/cmd/login.go)
- Detect free tier users (gen-lang-client-* projects or FREE/LEGACY tier)
- Show interactive prompt allowing users to choose frontend or backend
- Default to backend (recommended for preview model access)
- Pro users: maintain original behavior (keep frontend ID)
### Web UI (internal/api/handlers/management/auth_files.go)
- Detect free tier users using same logic
- Automatical…
feat(management): 更新OAuth模型映射的清理逻辑以增强数据安全性
Supra4E8C
f45d6ce
feat(management): add vertex api key and oauth model mappings endpoints
Supra4E8C
603fcef
feat(management): 支持管理接口调整日志大小/强制前缀/路由策略
Supra4E8C
bb3ee14
feat(api): integrate `TokenStore` for improved auth entry management
Replaced file-based auth entry counting with `TokenStore`-backed implementation, enhancing flexibility and context-aware token management. Updated related logic to reflect this change.
fix(logging): refactor `ConfigureLogOutput` to accept config object and adjust log directory handling