Commit Graph

641 Commits

Author SHA1 Message Date
Supra4E8C
775a308f0d test(config): add test for DELETE operation preserving document presence 2026-09-29 15:20:43 +08:00
Luis Pater
df2774ca18 feat(oauth): support per-channel model settings overrides
- Add `oauth-settings` configuration to override model capabilities such as `max-context-length`
- Implement sanitization, YAML preservation, and live reload diff detection for OAuth settings
- Apply OAuth model settings during model resolution and Codex model list responses

Closes: #6099
2026-09-29 11:43:51 +08:00
Luis Pater
d33f63f8e3 feat(logging): switch request ID generation to UUIDv7
- Generate UUIDv7 request IDs using crypto random source
- Add `ShortRequestID` helper to truncate IDs to 8 trailing characters in log output and filenames
- Update management log handlers to match log files using short request IDs
2026-09-29 00:45:52 +08:00
Luis Pater
59baf7314a feat(codex): extract and persist subscription plan type
- Extract `plan_type` from JWT claims and default missing values to `free`
- Include `plan_type` in token data, token storage, auth attributes, and file synthesis
- Ensure `plan_type` is maintained across token refresh flows
- Preserve empty map allocations during auth object cloning
2026-09-28 18:54:03 +08:00
Luis Pater
48686ccc8f feat(config): preserve unknown nested fields as comments during v8 migration
- Traverse nested configuration paths to comment out unrecognized fields during v8 migration
- Remove deprecated Codex `identity-confuse` configuration option and request handling
- Clean up identity confuse mapping logic from Codex HTTP and WebSocket executors
2026-09-28 10:46:32 +08:00
Luis Pater
4a2c81864f fix(config): preserve unknown legacy sections as comments during v8 migration
- Retain obsolete and unknown root sections as comments instead of dropping them during v8 migration
- Defer removal of deprecated legacy blocks so they can be preserved as comments during layout normalization
2026-09-27 20:17:03 +08:00
Luis Pater
6c385e6069 fix(config): drop obsolete legacy keys during v8 migration
- Remove obsolete `home` and `enable-gemini-cli-endpoint` root keys when migrating configuration to version 8
2026-09-27 19:57:28 +08:00
Luis Pater
31f4cfab3f feat: migrate CLIProxyAPI to version 8 2026-09-27 14:42:26 +08:00
hkfires
9a0502c87e feat(api): use query params for v8 oauth routes 2026-09-27 14:16:28 +08:00
hkfires
d9922f0589 feat(config): add v8 configuration API
Introduce the v8 management configuration tree with migration-aware reads and
writes, grouped upstream API-key providers, and independent v8 operational
routes.

Preserve legacy configuration compatibility while ensuring successful v8 writes
migrate layouts, redact JSON TURN secrets, and keep OAuth-only provider
settings from affecting API-key credentials.
2026-09-27 14:16:27 +08:00
Luis Pater
ed980be34b fix(auth): preserve resolved model capabilities and configuration update support
- Attach resolved execution model info during execution and token counting even when restoring execution models
- Propagate configuration update support to resolved Home dispatch model info
- Track modifications to configuration updates across plugin normalizers in the translation pipeline
- Mark configuration update support for eligible Codex models in the registry
2026-09-26 13:57:06 +08:00
Luis Pater
5530cbd2a5 fix(auth): preserve attributes and path across plugin refreshes
- Merge existing auth attributes and preserve file path metadata across plugin refreshes
- Avoid overwriting existing source and path attributes during auth data conversion
- Retry file stat during atomic replace to prevent premature removal of known auth files

Closes: #6119
2026-09-25 11:55:21 +08:00
Luis Pater
9bdde54b59 fix(meta): fix client id header and preserve subscription metadata
- Fix malformed `X-Client-Id` header and ensure it is applied to upstream requests
- Preserve subscription metadata during OAuth token creation and token refreshes
- Support dynamic retry-after for 404 responses and shorten default Meta 404 cooldown

Closes: #6117
2026-09-25 03:05:24 +08:00
Luis Pater
759c57c261 fix(api): immediately close connections on stop and guard state access
- Switch HTTP server stop from graceful shutdown to immediate close to prevent hanging on active requests
- Guard listeners and configuration access with dedicated mutexes
- Instantiate service shutdown context with a fresh timeout deadline upon exit

Closes: #6094
2026-09-24 23:31:51 +08:00
Luis Pater
c404af96eb fix(auth): preserve file priority across plugin auth refreshes
- Introduce `AttributeFilePriority` and helper to track priority inherited from auth files
- Preserve file-configured priority attributes and metadata in plugin host during auth refresh
- Apply file priority metadata consistently across synthesizer, token filestore, and management handlers

Closes: #6089
2026-09-24 08:09:21 +08:00
Luis Pater
e6fcfa34ba fix(logging): prevent request log collisions and select latest log by ID
- Switch request ID generation to an atomic incrementing 8-character hex counter
- Create unique log files with numeric sequence fallback to prevent overwriting existing logs
- Select the latest log file matching request ID based on modification time and filename sequence in management API
2026-09-23 13:03:05 +08:00
Luis Pater
673131f574 fix(codex): compact client model catalog and preserve required fields
- Marshal Codex client catalog as compact single-line JSON without HTML escaping
- Use compact base instructions for non-template models to stay within the 1MiB payload limit
- Keep `apply_patch_tool_type`, `upgrade`, and `availability_nux` present as null instead of deleting them
2026-09-23 08:54:52 +08:00
Luis Pater
a962b77d43 feat(server): support trusted proxies configuration for client IP resolution
- Add `trusted-proxies` configuration option with IP and CIDR validation
- Apply trusted proxies to Gin engine to properly resolve forwarded client IPs
- Record `ResolvedClientIP` in request metadata and usage queue details

Closes: #6024
2026-09-23 04:26:45 +08:00
Luis Pater
cc77410866 feat(management): support updating priority in credential patch endpoints
- Allow patching `priority` field for Gemini, Interactions, OpenAI compatibility, Vertex, and Codex credentials
- Update configuration entries with new priority value when present in patch payload

Closes: #6039
2026-09-22 22:47:42 +08:00
Luis Pater
f351924f42 feat(codex): add support for disable codex cloaking per credential
Closes: #6034
2026-09-22 22:39:20 +08:00
Luis Pater
a5ab69521f feat: add full support for kimi.ai oauth and runtime execution 2026-09-21 04:13:44 +08:00
Luis Pater
42c9680eee feat(executor): support duplex streaming for codex websockets
- Implement `streamCodexDuplex` to handle bidirectional WebSocket interactions for Codex
- Support steering continuations (`response.steer`) and queued creations (`response.create`, `response.append`)
- Preserve response settings and state transitions across steering updates and automatic successors
- Isolate connection-level failures with `codexDuplexConnectionError` to prevent unnecessary credential cooldowns

Closes: #5968
2026-09-20 00:02:10 +08:00
Luis Pater
93b94d22a9 feat(management): support priority field in claude key patch
- Allow updating `priority` on Claude keys via the management PATCH endpoint
- Preserve existing priority values when omitted from the patch payload

Closes: #5967
2026-09-19 22:40:35 +08:00
Luis Pater
b4ff581daf fix(management): reconcile expired cooldowns to active status in auth files
- Reconcile expired credential and model cooldown states when building auth file entries
- Preserve error status and unavailability for persistent auth or token expiration failures
- Clear expired retry deadlines and restore active availability when cooldowns elapse

Closes: #5964
2026-09-19 22:24:40 +08:00
Luis Pater
f4852170ee test(config): verify claude cloak persistence and update behavior
- Add tests for Claude cloak YAML persistence, comment preservation, and pruning of false/empty fields
- Cover partial PATCH and PUT updates, switch toggling, and credential identity isolation for Claude keys

Closes: #5935
2026-09-19 00:41:10 +08:00
Luis Pater
28743473c1 feat(codex): append (Devin) suffix to Devin model display names
- Detect Devin models by ID prefix, type, ownership, model registry metadata, or provider.
- Append `(Devin)` to model display names in Codex client responses when not already present.
- Set model `type` to `devin` in home Codex model formatting when served by the Devin provider.
2026-09-18 10:37:52 +08:00
Luis Pater
0b55053944 fix(management): reject unresolved token placeholders in api-call
- Return an error when the `$TOKEN$` placeholder cannot be resolved or the credential for `auth_index` is missing.
- Ensure `$TOKEN$` substitutions in headers and request payloads fail fast instead of proceeding with empty values.
- Support resolving and refreshing provider OAuth tokens for API calls.

Closes: #5838
2026-09-17 23:43:04 +08:00
camy-x
76ac75e68a feat(management): paginate auth file listings 2026-09-17 14:37:36 +08:00
Luis Pater
42ca5d3412 Merge PR #5502 feat/meta-provider into cpa/muse
Bring in native Meta (Muse Code) provider support while keeping the
existing Devin integration and original Meta commit history.
2026-09-15 12:05:40 +08:00
Luis Pater
512c453e09 Merge pull request #5803 from anpicasso/feat/plugin-quota-summary
feat(plugin-quota): add typed summary metrics
2026-09-15 08:35:47 +08:00
Luis Pater
e3cbe437d0 feat(auth): add tests to ensure async operations don’t block unrelated actions
- Add tests to verify that runtime hooks, auth modifications, and related updates do not block on unrelated operations such as antigravity probes or plugin virtual models.
- Introduce detailed scenarios, e.g., stale disables, batch operations, and conflict handling during concurrent auth updates.
- Refactor locking mechanisms to avoid unnecessary blocking during hooks and model registrations.

Fixed: #5813
Closes: #5773
2026-09-15 01:23:26 +08:00
Luis Pater
7fa443dc8b Merge pull request #5806 from router-for-me/feat/devin-followups
fix(devin): wire protocol submessage decoding, usage fallbacks, model uniqueness, and APICall body token replacement
2026-09-14 09:39:49 +08:00
Luis Pater
cca35aee93 fix(devin): use loopback callback endpoint for oauth redirect uri
- Enforce `http://127.0.0.1:<port>/callback` redirect URI to satisfy Devin authorization validation requirements.
- Register `/callback` route while preserving `/devin/callback` handler.
2026-09-14 09:37:35 +08:00
sususu
4c331bb953 fix(devin): unwrap repeated field 28 groups, merge partial field 7 usage, and harden APICall escaping 2026-09-14 09:32:05 +08:00
Angello Picasso
07e85de1a4 fix(plugin-quota): preserve valid mapped summaries 2026-09-14 01:26:10 +00:00
sususu
0719520f2a feat(api-call): support $TOKEN$ replacement in request body data 2026-09-14 09:20:03 +08:00
Angello Picasso
6aea72e294 fix(plugin-quota): preserve mapped summaries 2026-09-14 01:10:19 +00:00
Angello Picasso
617b9fd17d fix(plugin-quota): validate summary metadata 2026-09-14 01:04:12 +00:00
Angello Picasso
d3cb685944 fix(plugin-quota): validate summary identifiers 2026-09-14 00:42:52 +00:00
Angello Picasso
782a5cd169 fix(plugin-quota): tolerate malformed summaries 2026-09-14 00:37:21 +00:00
Angello Picasso
7b60be3516 fix(plugin-quota): require summary metric values 2026-09-14 00:30:34 +00:00
Angello Picasso
5cb41e233f fix(plugin-quota): accept summary-only probes 2026-09-14 00:18:20 +00:00
Angello Picasso
acb0eae2eb feat(plugin-quota): add typed summary metrics 2026-09-14 00:12:07 +00:00
Supra4E8C
44e62bc8ac feat(devin): implement Devin OAuth flow with callback handling and session management 2026-09-14 01:04:20 +08:00
Luis Pater
7e864ace4d Merge pull request #5797 from router-for-me/feat/cpa-web-search-catalog
feat(models): expose CPA web search capability
2026-09-14 00:59:20 +08:00
Supra4E8C
4311ae8747 feat(models): require explicit per-model native search support 2026-09-14 00:04:41 +08:00
sususu
f94752762b feat(devin): add Devin/Cognition provider integration and CLI OAuth
Implement the full Devin/Cognition Connect-RPC provider support across all CPA endpoints (/v1/chat/completions, /v1/messages, /v1/responses), complete with binary protobuf wire framing, streaming tools/arguments delta handling, thinking/reasoning replay, and CLI OAuth authentication.

Key highlights:
- Wire Protocol & Streaming:
  * Implemented Connect-RPC uncompressed 5-byte framing (0x00 + 4-byte length + protobuf) for ApiServerService/GetChatMessage.
  * Implemented Devin protobuf encoder/decoder in internal/runtime/executor/helps/devin_wire.go, including ClientMetadata, prompts, tools, completion_config, and multimodal image handling (Prompt Field #10).
  * Stream frame consumption via interactions protocol, correctly mapping arguments_delta and tracking multiple sequential tool calls (currentToolCallActive).
  * Streaming thought summary and sealed.v1 signature deltas targeting the thinking step.

- Model Registration & Thinking Clamping:
  * Registered static fallback models in model_definitions.go (swe-2, claude-fable-5-1, gpt-6-astra, swe-1-7-lightning, glm-5-2, glm-5-3).
  * Configured ThinkingSupport with discrete levels per model family.
  * Implemented CPA-standard nearest-neighbor clamping for thinking levels (minimal/low -> medium, xhigh -> max for swe-2).
  * Mapped thinking effort to Devin upstream model UID (e.g. swe-2-medium, swe-2-high, swe-2-max).

- Sensitive Words & System Prompt Sanitization:
  * Added devin.sensitive-words configuration in internal/config/config_types.go and config.go, matching Antigravity conventions.
  * Supported zero-width space (\u200b) obfuscation in prompts, tools, and system instructions via SensitiveWordMatcher.
  * Stripped Claude Code billing headers (x-anthropic-billing-header:) and CLI identity signatures from system instructions and tool descriptions to avoid upstream content filter rejections.

- Signature Compatibility:
  * Added SignatureProviderSWE = "swe" recognizing sealed.v1.* reasoning signatures in internal/signature/provider_compatibility.go.
  * Propagated reasoning.encrypted_content on Responses API and thinking.signature on Messages API.

- Authentication:
  * Implemented Devin PKCE OAuth flow with loopback callback server and headless manual token/code paste (--no-browser).
  * Registered Devin authenticator in SDK and CLI (-devin-login flag).
  * Integrated with management OAuth session endpoints and credentials manager.
2026-09-13 23:34:43 +08:00
Supra4E8C
294b7f5b19 feat(models): expose CPA web search capability 2026-09-13 22:44:19 +08:00
Supra4E8C
d23ba5ee05 Merge pull request #5795 from router-for-me/feat/management-auth-cooldowns
feat(cooldowns): add cooldown snapshot feature for management auth files
2026-09-13 22:17:48 +08:00
Luis Pater
94d6eb535e docs(config): document payload filter examples for codex tools
- Add example payload filter rules in `config.example.yaml` for stripping tools from both flat and nested `additional_tools` Codex request payloads.

Closes: #5792
2026-09-13 22:12:28 +08:00