4894 Commits

Author SHA1 Message Date
Luis Pater
14144df573 fix(openai): route duplex quota errors through replay guard after response.created
- Exclude known credential quota and cooldown errors from recoverable duplex error preservation in forwardResponsesWebsocket so opts.suppressError and terminal error handling still apply after response.created.
- Add regression tests verifying usage_limit_reached and model_cooldown consult the replay guard while request and client rate-limit errors stay on the duplex path.

Closes: #7586
v8.0.74
2026-11-16 10:43:08 +08:00
Luis Pater
8bdffcadc1 fix(claude): strip thinking suffix from advisor tool model
- Strip thinking suffixes from `advisor_*` tool `model` fields inside `sanitizeClaudeMessagesForClaudeUpstreamWithDebugDoc` before payload config rules run.
- Preserve each advisor tool's own base model and leave non-advisor tool entries untouched.
- Add regression tests covering API key and OAuth flows across `Execute`, `ExecuteStream`, `CountTokens`, payload overrides, and edge cases.

Closes: #7591
2026-11-16 10:31:56 +08:00
Luis Pater
4a9effcbfa fix(translator): keep unsigned Gemini text chunks in one Claude text block
- Close text content blocks in Gemini-to-Claude streaming and non-streaming responses only when the part carries a thought signature or at a non-text boundary.
- Coalesce consecutive unsigned text chunks into a single text block while keeping explicitly signed text parts isolated and preserving delayed signature carriers.

Closes: #7587
2026-11-16 10:12:11 +08:00
Luis Pater
508f8708d0 chore: replace standard JSON package with moego JSON throughout the project 2026-11-16 09:58:12 +08:00
Luis Pater
b4fdfdece3 chore: replace standard regexp with moego regexp throughout the project 2026-11-16 03:02:43 +08:00
Luis Pater
b48c438778 docs: add Hyphantria to project lists in Chinese and Japanese READMEs 2026-11-16 02:23:55 +08:00
Luis Pater
f7bbd32d88 Merge pull request #7564 from aupilot/codex/add-hyphantria-readme
docs: add Hyphantria to Who is with us
2026-11-16 02:22:04 +08:00
Luis Pater
a8c9c8a4a4 fix(openai): fail over pre-commit responses websocket create errors
- Unpin and exclude the failed credential when a full response.create on a persistent Responses WebSocket fails with a pre-commit quota or auth error.
- Propagate excluded auth IDs through handler metadata into mixed and Home stream selection while blocking replay once any downstream frame is committed.
- Add regression tests for pre-commit 429 failover, post-commit non-replay, and Home repeated excluded-auth rejection.

Closes: #7585
2026-11-16 01:59:04 +08:00
Luis Pater
43806c865d fix(translator): map Claude json_schema format to output_config.format
- Route OpenAI Chat Completions response_format and Responses text.format json_schema payloads to Claude output_config.format via ojson.Doc while keeping system-prompt fallback for legacy Claude models and non-schema formats.
- Preserve optional schema name and description in a short system instruction without repeating the JSON schema body.
- Include output_config.format.schema in local Claude input token estimation and add translator and executor regression tests.

Closes: #7576
v8.0.73
2026-11-15 22:32:47 +08:00
Luis Pater
7e82d0d1ca fix(executor): skip credential cooldown on Gemini zero-output 502 errors
- Tag Gemini-family zero-output HTTP 502 errors and translated Claude MALFORMED_FUNCTION_CALL error payloads with ErrorCodeTransientTransport across Antigravity, Gemini, Vertex, and AI Studio executors so Conductor skips credential cooldown while preserving per-request rotation and cross-provider failover.
- Update existing Claude MALFORMED_FUNCTION_CALL conductor tests to assert failed execution results and failed usage metrics without placing credentials into cooldown.
- Add unit and HTTP handler regression tests verifying uncooled rotation, cross-provider failover, and groundingChunks-only Claude fallback paths across Gemini-family executors.

Closes: #7571
2026-11-15 22:00:34 +08:00
Luis Pater
0f8c40e1fe fix(gemini): surface inlineData images as image_generation_call in Responses translator
- Convert Gemini inlineData image parts to Responses image_generation_call output items in both streaming and non-streaming paths so /v1/responses returns generated images instead of dropping them.
- Exclude thought images, gate on supported image mime types, dedupe streamed image parts by sha256, and preserve thought signatures attached to image parts.

Closes: #7569
2026-11-15 21:13:34 +08:00
Luis Pater
05a353cf12 feat(sdk): wrap built-in executors via builder hook on every registration path
- Add Builder.WithExecutorWrapper applied in the centralized registerExecutor gate so embedder wrappers survive startup sync, auth, and model refresh paths that bypass OnConfigApplied.
- Track the service-owned underlying executor per provider with manager revisions to preserve Claude WithConfig reuse and Codex/XAI session sharing across wrapping without double-wrapping.
- Harden replacement lifecycle for wrapped executors, including shared-session preservation, stale-ownership invalidation, and safe traversal of opaque or cyclic wrappers.

Closes: #7568
2026-11-15 17:57:09 +08:00
Luis Pater
6684f3b5d9 fix(translator): skip Gemini thinking draft images in OpenAI chat completions
- Skip inlineData and inline_data parts marked with thought=true when translating Gemini and Antigravity responses to OpenAI chat completions so intermediate draft images do not leak into images[].
- Suppress empty streaming deltas for standalone thought image chunks while preserving tool signature boundaries and empty-stream guards.

Closes: #7566
2026-11-15 17:06:53 +08:00
Luis Pater
ed1c23f9ac fix(gemini): honor 429 Retry-After and RetryInfo hints in cooldown
- Extract positive HTTP 429 retry delays from Google RPC RetryInfo/ErrorInfo details, Retry-After headers, and human-readable error messages while preserving zero-delay semantics in ParseRetryDelay.
- Propagate parsed retryAfter hints on non-2xx status errors across Gemini and Vertex executors, including Gemini Interactions non-stream and stream paths.
- Add deterministic regression tests covering cooldown scheduling, Retry-After header and message parsing edge cases, and Antigravity zero-delay compatibility.

Closes: #7565
2026-11-15 16:30:38 +08:00
Luis Pater
6d8f872f81 chore(examples): update moego dependencies to alpha.3 2026-11-15 15:53:17 +08:00
Luis Pater
95ebe39c1d fix(management): preserve plugin credential identities in v8 upload and delete
- Reconcile v8 credential uploads through SynthesizeAuthFile without redundant local store rewrites, preserving plugin-assigned IDs, FileName values, multi-record expansions, and symlinked destinations while retiring stale records from overwritten files.
- Pass synthesis fallback AuthDir out-of-band during plugin parsing so omitted IDs resolve relative to AuthDir without mutating AuthParseRequest.Host or overriding explicit path-based IDs.
- Remove all in-memory auth records backed by a deleted file in v8 credential deletion and snapshot handler config under lock for race-free synthesis.

Closes: #7557
2026-11-15 15:47:48 +08:00
Luis Pater
3d1a0e0d10 fix(thinking,registry): preserve native Gemini thinkingLevel and isolate provider lookups
- Preserve ModeLevel in normalizeUserDefinedConfig for native Gemini/Interactions requests and user-defined models with explicit thinking levels.
- Enforce strict provider scoping in ModelRegistry.GetModelInfo and prioritize channel-specific static catalog fallback in LookupModelInfo.
- Add unit and Vertex executor regression tests covering user-defined Gemini thinkingLevel preservation and cross-provider shadowing.

Closes: #7558
2026-11-15 15:07:18 +08:00
Kirill Makukhin
6ddea6e1aa docs: add Hyphantria to Who is with us 2026-11-15 17:05:01 +10:00
Luis Pater
a16da834a5 feat(gemini): add Gemini 4 models to registry
- Register Argon, Carbon, and Hydrogen with supported modalities and web search.
- Add the `xhigh` thinking level to supported models.

Closes: #7561
2026-11-15 14:26:31 +08:00
Luis Pater
e96d4c4818 fix(antigravity): disable pool-wide TOS pause by default
- Only enable the protective pause when a positive duration is explicitly configured.
- Treat unset, invalid, and nonpositive windows as disabled.
v8.0.72
2026-11-15 03:40:53 +08:00
Luis Pater
bd9c766f34 chore(deps): update moego and promote bbolt to a direct dependency v8.0.71 2026-11-14 22:56:46 +08:00
Luis Pater
50cfd5f759 Merge pull request #7530 from WizisCool/docs/update-oh-my-cpa-readme
docs(readme): update Oh-My-CPA description
2026-11-14 21:27:51 +08:00
Luis Pater
1d39a9de84 fix(translator): translate gemini response format and builtin tools for interactions
- Convert generationConfig responseModalities, imageConfig, responseMimeType, and responseSchema fields into top-level response_format entries while stripping unsupported nested fields from generation_config.
- Flatten urlContext, codeExecution, and googleSearch builtin tool options onto the tool object top level and convert searchTypes objects into snake_case search_types arrays.
- Update builtin tool tests and add translator and Gemini executor regression tests for Issue #7544.

Closes: #7544
2026-11-14 19:13:54 +08:00
Luis Pater
22d40703f2 feat(scheduler): support ExcludeCandidates in plugin scheduler fallback and delegation
- Add ExcludeCandidates with PascalCase and snake_case ojson decoding to pluginapi.SchedulerPickResponse and preserve normalized exclusions in pluginhost when unhandled or delegated.
- Filter excluded auth IDs per selection pass in Manager before priority tiering and built-in selector evaluation so healthy lower-priority credentials can promote without mutating caller tried state.
- Add unit tests covering JSON/RPC compatibility, host normalization, priority promotion, session affinity, and cooldown/empty-pool errors.

Closes: #7535
2026-11-14 19:12:07 +08:00
Luis Pater
905e70c48b feat(executor): add Go RE2 sensitive-patterns-replace support for Antigravity, Devin, and Claude
- Add sensitive-patterns-replace configuration rules with load-time RE2 validation, comment-preserving YAML persistence, config diffing, and bounded matcher caching across Antigravity, Devin, and Claude cloak paths.
- Apply ordered non-cascading regex replacements against original text boundaries while preserving Devin original-line drop ownership and existing sensitive-words-replace semantics.

Closes: #7540
v8.0.70
2026-11-14 16:33:48 +08:00
Luis Pater
f2efe2c413 fix(antigravity): fail signature-only zero-output streams without finishReason before HTTP 200 commit
- Stop counting signature-only empty-text parts as thought output in InspectGeminiZeroOutputPayload so leading signature-only frames stay buffered until real content arrives.
- Fail buffered candidate-bearing zero-output streams with a retryable 502 on EOF in GeminiZeroOutputStreamGuard.Finalize and harden Antigravity OpenAI streaming translation against all-null delta emission.
- Add unit, executor, and HTTP failover regression tests covering signature-only zero-output streams across downstream formats and credential rotation.

Closes: #7536
2026-11-14 14:30:19 +08:00
Luis Pater
3b480776f8 fix(management): honor target account proxy during SIWC bind
- Resolve and validate the target Codex credential proxy_url in StartSIWCBind and construct the OAuth client via codex.NewCodexAuthWithProxyURL so account proxy takes precedence over global proxy without falling back on failure.
- Update siwcOAuthFactory to pass the resolved account proxy URL and add regression tests covering account proxy precedence, global proxy inheritance, direct bypass, unreachable proxy failure, and credential field preservation.

Closes: #7531
2026-11-14 13:41:52 +08:00
Luis Pater
5a351d9570 feat(antigravity): deactivate credentials on TOS_VIOLATION and add optional pool-wide protective pause
- Detect the 403 PERMISSION_DENIED ErrorInfo reason=TOS_VIOLATION signature and mark the credential StatusDisabled + Disabled so it is excluded from rotation and persisted across restarts, while OAuth refresh stays intact; carry appeal_url/appeal_url_link_text through Error.Metadata to auth.Metadata and the management API.
- Add an optional pool-wide protective pause (antigravity.tos-pause-window, default 6h) armed only by TOS results, never by transient 429s, covering all Antigravity request paths including SSE mid-stream error frames and CountTokens.
- Distinguish terminal TOS results from stale/superseded results using a new Result.RefreshToken account hint so a same-account OAuth refresh applies the suspension while a genuine credential replacement discards it safely.

Closes: #7515
2026-11-14 04:49:56 +08:00
JUNZE
d0f7972ae2 docs(readme): update Oh-My-CPA description 2026-11-14 04:44:11 +08:00
Luis Pater
4da9f68527 fix(auth): carry the pool cooldown reset on the terminal 429
- Wrap the final 429 in a poolCooldownTerminalError at the Execute/ExecuteCount/ExecuteStream boundaries when every candidate credential for the model is blocked and at least one is in a timed cooldown, preserving the upstream error body and status while marking IsModelCooldown so the Claude handler appends the reset time.
- Compute the Retry-After from the earliest auto-recovery across all blocked candidates (including non-cooldown timed blocks) so the client sees the pool's real recovery instead of the last attempt's hint.
- Add regression coverage for both cooldown variants across the three execution paths, the available-candidate guard, mixed-block earliest deadlines, the sub-floor hint clamp, and the Claude handler end-to-end.

Closes: #7521
2026-11-14 03:53:47 +08:00
Luis Pater
100f2de1a5 fix(handlers): forward caller identity metadata to model-directory response interceptors
- Build interceptor metadata in WriteModelListResponse from the authenticated gin context (caller_scope, access_provider, frontend_auth_metadata) instead of always passing nil.
- Reuse requestCallerScope so model-list requests share the same irreversible caller handle as execution paths, enabling per-key catalog filtering including ?key= credentials.
- Forward the same metadata to the request lifecycle tracker and add regression tests for identity forwarding, metadata isolation, and unauthenticated nil metadata.

Closes: #7524
2026-11-14 03:38:08 +08:00
Luis Pater
7904efd799 feat(management): expose registered plugin runtime priority on v8 plugin listing
- Add Priority *int to pluginListEntry, populated from the host RegisteredPlugins snapshot so clients can verify effective ordering, including zero and negative values.
- Gate exposure to the maintained v8 route while leaving the deprecated v0 response shape unchanged, and add RegisterPluginWithPriorityForTest to cover non-default priorities in tests.

Closes: #7522
2026-11-14 03:36:51 +08:00
Luis Pater
51b98e746a perf(management): cache verified management secret hashes for one hour
- Cache verified management secret HMAC-SHA256 digests bound to the active bcrypt hash for a one-hour TTL while coalescing concurrent cold-cache verifications.
- Invalidate cached verification entries on management secret changes in SetConfig and ConfigV8 while preserving failure counting, IP ban checks, and non-caching of invalid keys.
- Add deterministic unit tests, a ConfigV8 HTTP integration test, and a benchmark covering TTL expiration, rotation, concurrency coalescing, and ban preservation.

Closes: #7519
Co-authored-by: Dylan <1990016@gmail.com>
Co-authored-by: lzt404 <2596933790@qq.com>
2026-11-14 01:17:59 +08:00
Luis Pater
cf07c78abd fix(gemini/antigravity): fail zero-output abnormal terminations before HTTP 200 commit
- Detect MALFORMED_FUNCTION_CALL, UNEXPECTED_TOOL_CALL, and MALFORMED_RESPONSE with zero visible output before bootstrap commit, reasoning replay caching, or usage finalization across Antigravity, Gemini, Vertex, and AI Studio executors.
- Withhold only contentless leading shell frames while keeping thought chunks unbuffered for TTFT, and align Claude response error handling and stream completion flags while preserving valid partial outputs.
- Add unit, executor, bootstrap failover, and cross-module HTTP regression tests covering credential rotation and HTTP 502 exhaustion.

Closes: #7513
Co-authored-by: Dylan <1990016@gmail.com>
Co-authored-by: lzt404 <2596933790@qq.com>
2026-11-14 00:50:21 +08:00
Luis Pater
5b63e29acf fix(pluginhost): keep OAuth plugin models credential-bound and catalog-safe
- Default credential-bound plugin executors to OAuth model scope and skip static ModelRegistry clients unless ExecutorModelScopeStatic is explicitly set.
- Keep StaticModels catalog collection enabled for OAuth-scoped plugins without leaking static models into ModelRegistry or credential fallback appends.
- Decouple OAuth executor provider binding from catalog provider names and add regression coverage for exclusions, aliases, disabled state, and management catalog definitions.

Closes: #7512
Co-authored-by: Dylan <1990016@gmail.com>
Co-authored-by: lzt404 <2596933790@qq.com>
2026-11-13 23:09:47 +08:00
Luis Pater
7fd90c7aa1 feat(meta): relay Muse Code client endpoints under /muse-code
- Implement core Muse Code relay handler, origin resolution, header/query sanitization, credential selection/preparation, 401 refresh, and bounded failover in internal/client/musecode.
- Register thin /muse-code routes, safe-mode proxy guarding, and request-ID logging prefixes in internal/api and internal/logging.
- Isolate model-less credential-scoped cooldowns, preserve execution sequence ordering, and honor request-scoped error rules across sdk/cliproxy/auth.

Closes: #7508
2026-11-13 22:30:37 +08:00
Luis Pater
7cfa267b29 fix(wstunnel): deflake close ordering, topology visibility, and backpressure tests
- Sequence the WebSocket close frame ahead of socket teardown by waiting on the writer in finishClose with a bounded grace window, closing the 1006-vs-1002 race.
- Add waitServersVisible to drain the topology stream until expected servers are observable, fixing empty server_list and stale server_online reads in client tests.
- Make the backpressure test deterministic via a gated transport plus tighter byte budgets, and route background-read errors through bounded barrier channels to prevent hangs.

Closes: #7504
Co-authored-by: Dylan <1990016@gmail.com>
Co-authored-by: lzt404 <2596933790@qq.com>
2026-11-13 17:09:03 +08:00
Luis Pater
d6785c8daa docs(readme): remove Modelflare sponsor listing from all READMEs 2026-11-13 16:22:32 +08:00
Luis Pater
6acfb76b54 feat(sdk): keep caller-provided interceptor host and executor wrappers across config apply
- Add Builder.WithPluginInterceptorHost so embedders can install a custom PluginInterceptorHost that survives startup and reload; the server wraps it to keep plugin model routing, executor dispatch, lifecycle, and websocket observers delegated to the internal plugin host.
- Add Hooks.OnConfigApplied invoked after each successful config apply so embedders can reinstall executor wrappers and other caller-owned runtime state.
- Cover the delegated interceptor host with nil-safety, skip-forwarding, capability-detection, and real execute-chain regression tests.

Closes: #7499
Co-authored-by: Dylan <1990016@gmail.com>
Co-authored-by: lzt404 <2596933790@qq.com>
2026-11-13 07:53:46 +08:00
Luis Pater
b285660f84 feat(api): expose standalone in-flight request count on management API
- Add a lightweight per-request in-flight tracker on the auth manager that covers selection, upstream calls, retry waits, and the full stream lifetime; it stays disabled in Home mode where the execution registry is authoritative.
- Register GET /v8/management/observability/requests/in-flight returning counts only (in_flight, oldest_started_at, by_provider) with no request bodies or credential identifiers.

Closes: #7476
Co-authored-by: Dylan <1990016@gmail.com>
Co-authored-by: lzt404 <2596933790@qq.com>
2026-11-13 03:06:02 +08:00
Luis Pater
1aaf56bc6a docs(readme): add VisionCoder provider listing to English, Chinese, and Japanese READMEs 2026-11-13 02:52:39 +08:00
Luis Pater
f7ae8feeb3 docs(readme): add OriginCoder provider listing to English and Japanese READMEs v8.0.69 2026-11-13 02:25:36 +08:00
Luis Pater
73b86c7fb9 feat(api): add opt-in server.shutdown-timeout for graceful request draining
- Add server.shutdown-timeout config (default 0 = immediate close, preserving #6094 behavior); positive values drain in-flight HTTP requests via http.Server.Shutdown bounded by the configured seconds, then force-close the rest.
- Bound the drain by the configured timeout even when the caller's context is more generous, while a tighter parent deadline still wins; hijacked WebSocket connections remain managed by their own handlers.
- Cover drain completion, budget-expiry fallback, tighter parent ctx, zero default, and v8/legacy config parsing in tests.

Closes: #7475
Co-authored-by: Dylan <1990016@gmail.com>
Co-authored-by: lzt404 <2596933790@qq.com>
2026-11-13 02:18:18 +08:00
Luis Pater
42f9adb9ac feat(tui): migrate management client to v8 routes with legacy fallback
- Prefer /v8/management endpoints for config, credentials, api-keys, logs, and OAuth flows, normalizing the v8 config tree to the TUI's flat view and falling back to /v0/management only when a route is genuinely unimplemented.
- Read access.api-keys from the same versioned root-config snapshot and write back with If-Match, refusing unconditional replaces and stale-index edits/deletes so concurrent changes are not lost.
- Return a non-zero exit via CheckManagementSupport when a server definitively exposes neither contract, while keeping transient probe failures and wrong-password retries non-fatal.

Closes: #7462
Co-authored-by: Dylan <1990016@gmail.com>
Co-authored-by: lzt404 <2596933790@qq.com>
v8.0.68
2026-11-13 02:02:23 +08:00
Luis Pater
1cb14ceb78 docs(readme): link OriginCoder provider name in Chinese README 2026-11-13 01:59:17 +08:00
Luis Pater
4cc0cd40b6 docs(readme): add OriginCoder API provider listing 2026-11-13 01:53:03 +08:00
Luis Pater
1fcb143220 feat(models): update Devin catalog and add Gemini model variants
- Add Gemini 4 Hydrogen and Antigravity Gemini variants.
- Update Devin model versions while retaining previous entries.
2026-11-13 01:12:45 +08:00
Luis Pater
91aca317b0 fix(gemini): preserve thought signatures across tool-call round trips
- Restore Claude signature carriers onto their original Gemini parts with message and semantic boundaries.
- Return Gemini tool signatures in streaming and non-streaming Chat Completions responses without weakening provider compatibility.
- Cover delayed signatures, metadata, unsupported payloads, and payload-rule precedence with regression tests.

Closes: #7484
Co-authored-by: Dylan <1990016@gmail.com>
Co-authored-by: lzt404 <2596933790@qq.com>
2026-11-13 00:33:01 +08:00
Luis Pater
8e8e823102 test(api): verify WebSocket reauthorization with request logging enabled
- Run the reauthorization regression test with request logging both enabled and disabled.
- Drain WebSocket handlers and verify logging leaves no temporary files and records the revoked credential.
2026-11-12 23:58:23 +08:00
Luis Pater
e63179492e fix(auth): back off rejected refresh recovery jobs
- Preserve a positive refresh delay for expired credentials with an unknown refresh outcome to prevent immediate redispatch.
- Cover task completion, disabled credentials, diagnostic errors, and replacement-grant rescheduling with regression tests.

Closes: #7491
Co-authored-by: Dylan <1990016@gmail.com>
Co-authored-by: lzt404 <2596933790@qq.com>
2026-11-12 23:57:10 +08:00