Luis Pater
aa1da8a858
Merge pull request #1685 from lyd123qw2008/fix/auth-auto-refresh-interval
...
fix(auth): respect configured auto-refresh interval
2026-02-25 01:13:47 +08:00
Luis Pater
7cb398d167
Merge pull request #1663 from rensumo/main
...
feat: implement credential-based round-robin for gemini-cli
2026-02-24 06:02:50 +08:00
Luis Pater
48732ba05e
Merge pull request #1527 from HEUDavid/feat/auth-hook
...
feat(auth): add post-auth hook mechanism
2026-02-24 05:33:13 +08:00
lyd123qw2008
450d1227bd
fix(auth): respect configured auto-refresh interval
2026-02-23 22:07:50 +08:00
rensumo
5936f9895c
feat: implement credential-based round-robin for gemini-cli virtual auths
...
Changes the RoundRobinSelector to use two-level round-robin when
gemini-cli virtual auths are detected (via gemini_virtual_parent attr):
- Level 1: cycle across credential groups (parent accounts)
- Level 2: cycle within each group's project auths
Credentials start from a random offset (rand.IntN) for fair distribution.
Non-virtual auths and single-credential scenarios fall back to flat RR.
Adds 3 test cases covering multi-credential grouping, single-parent
fallback, and mixed virtual/non-virtual fallback.
2026-02-21 12:49:48 +08:00
Luis Pater
2789396435
fix: ensure connection-scoped headers are filtered in upstream requests
...
- Added `connectionScopedHeaders` utility to respect "Connection" header directives.
- Updated `FilterUpstreamHeaders` to remove connection-scoped headers dynamically.
- Refactored and tested upstream header filtering with additional validations.
- Adjusted upstream header handling during retries to replace headers safely.
2026-02-19 13:19:10 +08:00
Luis Pater
61da7bd981
Merge PR #1626 into codex/pr-1626
2026-02-19 04:49:14 +08:00
Luis Pater
252f7e0751
Merge pull request #1625 from thebtf/feat/tool-prefix-config
...
feat: add per-auth tool_prefix_disabled option
2026-02-19 04:07:22 +08:00
Luis Pater
bb86a0c0c4
feat(logging, executor): add request logging tests and WebSocket-based Codex executor
...
- Introduced unit tests for request logging middleware to enhance coverage.
- Added WebSocket-based Codex executor to support Responses API upgrade.
- Updated middleware logic to selectively capture request bodies for memory efficiency.
- Enhanced Codex configuration handling with new WebSocket attributes.
2026-02-19 01:57:02 +08:00
Kirill Turanskiy
1f8f198c45
feat: passthrough upstream response headers to clients
...
CPA previously stripped ALL response headers from upstream AI provider
APIs, preventing clients from seeing rate-limit info, request IDs,
server-timing and other useful headers.
Changes:
- Add Headers field to Response and StreamResult structs
- Add FilterUpstreamHeaders helper (hop-by-hop + security denylist)
- Add WriteUpstreamHeaders helper (respects CPA-set headers)
- ExecuteWithAuthManager/ExecuteCountWithAuthManager now return headers
- ExecuteStreamWithAuthManager returns headers from initial connection
- All 11 provider executors populate Response.Headers
- All handler call sites write filtered upstream headers before response
Filtered headers (not forwarded):
- RFC 7230 hop-by-hop: Connection, Transfer-Encoding, Keep-Alive, etc.
- Security: Set-Cookie
- CPA-managed: Content-Length, Content-Encoding
2026-02-18 00:16:22 +03:00
Kirill Turanskiy
9261b0c20b
feat: add per-auth tool_prefix_disabled option
...
Allow disabling the proxy_ tool name prefix on a per-account basis.
Users who route their own Anthropic account through CPA can set
"tool_prefix_disabled": true in their OAuth auth JSON to send tool
names unchanged to Anthropic.
Default behavior is fully preserved — prefix is applied unless
explicitly disabled.
Changes:
- Add ToolPrefixDisabled() accessor to Auth (reads metadata key
"tool_prefix_disabled" or "tool-prefix-disabled")
- Gate all 6 prefix apply/strip points with the new flag
- Add unit tests for the accessor
2026-02-17 21:48:19 +03:00
Luis Pater
46a6782065
refactor(all): replace manual pointer assignments with new to enhance code readability and maintainability
2026-02-15 14:10:10 +08:00
HEUDavid
65debb874f
feat/auth-hook: refactor RequstInfo to preserve original HTTP semantics
2026-02-12 07:11:17 +08:00
HEUDavid
3caadac003
feat/auth-hook: add post auth hook [CR]
2026-02-12 07:11:17 +08:00
HEUDavid
94563d622c
feat/auth-hook: add post auth hook
2026-02-12 07:11:17 +08:00
hkfires
b7e4f00c5f
fix(translator): correct gemini-cli log prefix
2026-02-07 08:40:09 +08:00
Luis Pater
f410dd0440
Merge pull request #1390 from sususu98/fix/400-invalid-request-no-retry
...
fix(auth): 400 invalid_request_error 立即返回不再重试
2026-02-07 03:14:25 +08:00
Luis Pater
eb5582c17c
Merge pull request #1386 from shenshuoyaoyouguang/sync-auth-changes
...
fix(auth): normalize model key for thinking suffix in selectors
2026-02-07 03:12:01 +08:00
LTbinglingfeng
fc7b6ef086
fix(kimi): add OAuth model-alias channel support and cover OAuth excluded-models with tests
2026-02-07 01:16:39 +08:00
sususu98
233be6272a
fix(auth): 400 invalid_request_error 立即返回不再重试
...
当上游返回 400 Bad Request 且错误消息包含 invalid_request_error 时,
表示请求本身格式错误,切换账户不会改变结果。
修改:
- 添加 isRequestInvalidError 判定函数
- 内层循环遇到此错误立即返回,不遍历其他账户
- 外层循环不再对此类错误进行重试
2026-02-02 17:35:51 +08:00
chujian
47cb52385e
sdk/cliproxy/auth: update selector tests
2026-02-02 05:26:04 +08:00
Luis Pater
e93e05ae25
refactor: consolidate channel send logic with context-safe handlers
...
Optimize channel operations by introducing reusable context-aware send functions (`send` and `sendErr`) across `wsrelay`, `handlers`, and `cliproxy`. Ensure graceful handling of canceled contexts during stream operations.
2026-01-28 10:58:35 +08:00
Luis Pater
70897247b2
feat(auth): add support for request_retry and disable_cooling overrides
...
Implement `request_retry` and `disable_cooling` metadata overrides for authentication management. Update retry and cooling logic accordingly across `Manager`, Antigravity executor, and file synthesizer. Add tests to validate new behaviors.
2026-01-26 21:59:08 +08:00
Luis Pater
9c341f5aa5
feat(auth): add skip persistence context key for file watcher events
...
Introduce `WithSkipPersist` to disable persistence during Manager Update/Register calls, preventing write-back loops caused by redundant file writes. Add corresponding tests and integrate with existing file store and conductor logic.
2026-01-26 18:20:19 +08:00
Luis Pater
c32e2a8196
fix(auth): handle context cancellation in executor methods
2026-01-24 04:56:55 +08:00
Chén Mù
f353a54555
Merge pull request #1171 from router-for-me/auth
...
refactor(auth): remove unused provider execution helpers
2026-01-23 19:43:42 +08:00
Chén Mù
1d6e2e751d
Merge pull request #1140 from sxjeru/main
...
fix(auth): handle quota cooldown in retry logic for transient errors
2026-01-23 19:43:17 +08:00
hkfires
cc50b63422
refactor(auth): remove unused provider execution helpers
2026-01-23 19:12:55 +08:00
hkfires
81b369aed9
fix(auth): include requested model in executor metadata
2026-01-23 18:30:08 +08:00
sxjeru
30a59168d7
fix(auth): handle quota cooldown in retry logic for transient errors
2026-01-21 21:48:23 +08:00
hkfires
fe5b3c80cb
refactor(config): rename oauth-model-mappings to oauth-model-alias
2026-01-15 18:03:26 +08:00
hkfires
8bc6df329f
fix(auth): apply API key model mapping to request model
2026-01-15 13:06:41 +08:00
hkfires
847be0e99d
fix(auth): use base model name for auth matching by stripping suffix
2026-01-15 13:06:41 +08:00
hkfires
f6a2d072e6
refactor(thinking): refine configuration logging
2026-01-15 13:06:41 +08:00
hkfires
2262479365
refactor(thinking): remove legacy utilities and simplify model mapping
2026-01-15 13:06:40 +08:00
hkfires
e8f5888d8e
fix(thinking): fix auth matching for thinking suffix and json field conflicts
2026-01-15 13:06:39 +08:00
hkfires
0b06d637e7
refactor: improve thinking logic
2026-01-15 13:06:39 +08:00
Luis Pater
6f8a8f8136
feat(selector): add priority support for auth selection
2026-01-15 07:08:24 +08:00
Luis Pater
e8e3bc8616
feat(executor): add HttpRequest support across executors for better http request handling
2026-01-10 16:25:25 +08:00
hkfires
ee62ef4745
refactor(logging): clean up oauth logs and debugs
2026-01-09 11:20:55 +08:00
Luis Pater
a2eba2cdf5
Merge pull request #763 from mvelbaum/feature/improve-oauth-use-logging
...
feat(logging): disambiguate OAuth credential selection in debug logs
2026-01-09 04:43:21 +08:00
Luis Pater
7a77b23f2d
feat(executor): add token refresh timeout and improve context handling during refresh
...
Introduced `tokenRefreshTimeout` constant for token refresh operations and enhanced context propagation for `refreshToken` by embedding roundtrip information if available. Adjusted `refreshAuth` to ensure default context initialization and handle cancellation errors appropriately.
2026-01-04 00:26:08 +08:00
hkfires
89db4e9481
fix(thinking): use model alias for thinking config resolution in mapped models
2025-12-31 17:09:22 +08:00
hkfires
96340bf136
refactor(executor): resolve upstream model at conductor level before execution
2025-12-30 19:31:54 +08:00
hkfires
d443c86620
refactor(config): rename model mapping fields from from/to to name/alias
2025-12-30 11:07:59 +08:00
hkfires
7be3f1c36c
refactor(config): rename model-name-mappings to oauth-model-mappings
2025-12-30 11:07:58 +08:00
Luis Pater
50e6d845f4
feat(cliproxy): introduce global model name mappings for improved aliasing and routing
2025-12-30 08:13:06 +08:00
Michael Velbaum
cb3bdffb43
refactor(logging): streamline auth selection debug messages
...
Reduce duplicate Debugf calls by appending proxy info via an optional suffix and keep the debug-level guard inside the helper.
2025-12-28 16:10:11 +02:00
Michael Velbaum
48f19aab51
refactor(logging): pass request entry into auth selection log
...
Avoid re-creating the request-scoped log entry in the helper and use a switch for account type dispatch.
2025-12-28 15:51:11 +02:00
Michael Velbaum
48f6d7abdf
refactor(logging): dedupe auth selection debug logs
...
Extract repeated debug logging for selected auth credentials into a helper so execute, count, and stream paths stay consistent.
2025-12-28 15:42:35 +02:00