Skip to content

同步 CLIProxyAPI 上游 main 并保留 Pinable 运行时 - #10

Merged
PinableAgents merged 63 commits into
mainfrom
prepare/upstream-2026-11-18
Nov 18, 2026
Merged

PinableAgents merged 63 commits into
mainfrom
prepare/upstream-2026-11-18

Conversation

@PinableAgents

@PinableAgents PinableAgents commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

同步上游

  • 合并 router-for-me/CLIProxyAPI 上游 61 个提交至 a5e8f69,保留双方 Git 历史。解决一处 Retry-After 测试冲突,并更新失效的上游模型目录断言,未额外改变生产逻辑。

只保留自动版本发布

  • 仅在 main push 时自动出包、验证六平台产物并发布 Pinable 桌面运行时。
  • 删除独立 PR、同步和 Monolith 检查,以及旧的上游 tag/Docker 发布入口;不再允许只出包不发布的手动执行。

验证

  • actionlint、触发条件和发布依赖静态检查、40 项运行时测试、Go 构建通过。代码全量测试排除了 4 个被 netlink 权限拦住的用例。
  • 未合入 main,未触发版本发布。

WizisCool and others added 30 commits November 14, 2026 04:44
…ck 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: router-for-me#7535
…or 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 router-for-me#7544.

Closes: router-for-me#7544
…y-cpa-readme

docs(readme): update Oh-My-CPA description
- Only enable the protective pause when a positive duration is explicitly configured.
- Treat unset, invalid, and nonpositive windows as disabled.
- Register Argon, Carbon, and Hydrogen with supported modalities and web search.
- Add the `xhigh` thinking level to supported models.

Closes: router-for-me#7561
…ate 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: router-for-me#7558
…nd 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: router-for-me#7557
- 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: router-for-me#7565
…pletions

- 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: router-for-me#7566
…tion 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: router-for-me#7568
…sponses 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: router-for-me#7569
- 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: router-for-me#7571
- 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: router-for-me#7576
- 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: router-for-me#7585
…ia-readme

docs: add Hyphantria to Who is with us
…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: router-for-me#7587
- 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: router-for-me#7591
…ponse.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: router-for-me#7586
… as 400 request faults

- Add bio_policy, cyber_policy_violation, misalignment_policy_violation, content_policy_violation, and image_content_policy_violation to request-fault codes so policy rejections stop failover without cooling down credentials.
- Unify trusted error JSON extraction across auth, model-not-found, credit-balance, and request-fault checks while restricting wrapper unwrapping and policy-text matching to prevent prompt-echo false positives.
- Map typeless policy error codes and body.error layouts consistently across Codex SSE/WebSocket, Responses, xAI, and Claude stream translation paths, filling blank messages with official fallback copy.
Normalize string websocket errors without discarding their messages. Recognize untyped and body-wrapped failures across SSE, websocket, and duplex paths while retaining status, headers, and sequence numbers.

Cover transport and format combinations, replay invalidation, credential status precedence, and Responses framing with regression tests.
Add ordered literal replace rules that rewrite existing user
text at selected one-based positions, or all users, in the final
upstream payload after overrides and before filters.

Support OpenAI Chat, Claude, Responses/Codex, Gemini, and
Antigravity layouts while leaving system prompts, tools, images,
and thinking untouched. Validate and sanitize rule config,
preserve it through YAML/JSON and runtime cloning, surface it
in config diffs and SDK types, and document it in the example
config.
… status

- Build OpenAI Responses stream error and failed chunks directly through ojson.Doc with single-exit serialization, supporting scalar error strings without map mutations.
- Preserve valid top-level and body envelope HTTP error status codes when normalizing typeless Codex SSE failures and Responses SSE frames.
- Normalize scalar and blank WebSocket error fields purely via ojson.Doc.
…t SSE event types

- Read nested body/error HTTP status codes in parseCodexWebsocketErrorWithCooling and clearCodexReasoningReplayOnWebsocketError so Retry-After and request headers are preserved on typeless WebSocket errors.
- Guard responsesSSEPayloadHasError and SSE error inference behind explicit event/payload type checks so non-error frames such as response.metadata containing body.error are not rewritten into terminal errors.
sususu98 and others added 28 commits November 16, 2026 18:00
…quest-fault

fix(clienterror,openai): classify bio_policy and safety policy blocks as 400 request faults
- Extract error headers from nested Codex error and response.error payloads while keeping outer header precedence.
- Parse Retry-After hints on 502/503 and other recoverable transient status codes across terminal, WebSocket, and bootstrap failover paths.
- Add regression tests covering captured WS overload payloads, explicit 503 responses, header precedence, and cooldown scheduling.

Closes: router-for-me#7600

� Conflicts:
�	internal/runtime/executor/codex_executor_stream.go
�	internal/runtime/executor/codex_websockets_errors.go
�	internal/runtime/executor/codex_websockets_stream.go
Move Claude prompt-cache stripping before payload finalization so
user-injected values survive, and extract count-tokens betas only
after finalization without changing business semantics.

Capture Codex instructions and xAI transcript input before payload
rules for duplex, replay, and compaction inheritance, and reuse the
exact finalized xAI websocket frame on retries. This prevents rules
from being applied twice, overwritten, or accumulating across turns.
fix(executor): enforce payload rules as final barrier
- Add optional `scheduler.continuity` plugin ABI/RPC hook with bounded `pre_admission` and `pre_output_429` wait gates, persisted cooldown provenance separation, and SSE/WebSocket keepalive handoff.
- Enforce per-request continuity budgets, `disable_cooling` retry limits, and stable turn `RequestID` across SSE bootstrap retries and WebSocket in-place failover.
- Add race-verified unit and handler integration tests covering continuity gates, cooldown provenance, keepalive suppression, and session isolation.

Closes: router-for-me#7589
- Update TestPluginErrorCarriesRetryAfterIntoCooldownAndHTTPHeader to expect the 10s pool Retry-After header after commit 4da9f68.
- Update the model NextRetryAfter assertion and comment to reflect the 10s minQuotaCooldownFloor clamp applied by MarkResult.

Closes: router-for-me#7607
… unavailable

- Track whether withClaudeThreadAuth pinned a Claude Thread continuation to its owning credential and translate terminal owner-unavailability or credential-scoped failures into 404 thread_not_found across Execute and ExecuteStream.
- Preserve transient upstream errors, request-scoped faults, configured stop rules, Home concurrency busy responses, and Home user-level billing or period limits across standard and Home execution paths.
- Add regression tests covering disabled, cooling-down, and upstream-rejected Thread owners alongside preserved error cases in both local and Home dispatch modes.

Closes: router-for-me#7610
Allow payload.replace entries to use Go RE2 patterns via
{pattern, replacement} alongside existing literal mappings,
including capture expansion such as $1 and ${1}.

Skip invalid regex entries individually with index-only
warnings so valid replacements still apply without leaking
pattern text. Update YAML/JSON parsing, validation, docs,
and executor handling while preserving ordered, per-block
replacement semantics across supported layouts.
Allow payload replace rules to target system and developer
messages in addition to user, using final upstream roles after
translation. Count Claude system, Gemini systemInstruction,
and Responses instructions as the first system message, while
keeping assistant, tool, thinking, and non-text content
unmodified. Update validation, docs, and executor coverage.
Store bounded local read, dial, and stream errors as diagnostics
instead of rendering them inside API RESPONSE sections, and render
them in the downstream RESPONSE section after status selection.
Prevent handler-synthesized payloads from appending to executor
capture or fabricating upstream responses for failed attempts.
OpenAI Chat input_audio was flattened to top-level data/format, which strict Responses upstreams (e.g. Meta Muse) reject with: input_audio content part requires input_audio, audio_url, or file_id. Emit the spec-compliant nested input_audio {data, format} shape, matching the Gemini/Interactions to Codex translators and both Meta and OpenAI official docs. Update tests that codified the flat shape.
Cover WAV and MP3 Chat audio through MetaExecutor streaming and non-streaming requests. Require nested input_audio data/format and reject flattened fields. Avoid injecting an empty format when the caller omits it.
…udio-nested

fix(translator): preserve nested input_audio for Chat to Responses
fix(logging): separate local errors from upstream responses
…n Responses translators

- Infer `application/pdf` from filenames or `%PDF-` base64 prefixes, decode `text/plain` documents, and map HTTP `file_url` inputs to Claude URL document blocks while rejecting unsupported binary MIME types.
- Handle single-object `function_call_output` media parts consistently with arrays in Claude and OpenAI Chat Completions Responses translators, returning `UnsupportedPartError` instead of dumping raw base64 JSON as text.
- Relay `input_file` and single-object media in OpenAI Chat Completions tool outputs via follow-up user messages while preserving valid tool-call pairing order.

Closes: router-for-me#7619
- Add shared Claude document helpers to convert source.type "text" and "content" blocks (preserving optional title and context) across Antigravity, Gemini, Codex, OpenAI, and Interactions translators.
- Support HTTP/HTTPS URL document sources in Codex (input_file.file_url) and URL image/document sources in Interactions (uri) while keeping existing UserTurnDrops and Gemini URL refusal invariants intact.

Closes: router-for-me#7620
…t blocks

- Extract base64 document blocks into functionResponse.parts inlineData across Antigravity and Gemini Claude request translators.
- Support document input_file items, text/content documents, URL/file_id images via claudeImageInputPart, singleton objects, and explicit unsupported-document placeholders in Codex tool_result output.
- Relay convertible tool_result documents as OpenAI file parts, preserve text/content documents, and emit explicit placeholders for unconvertible documents in OpenAI Chat translation.

Closes: router-for-me#7617
…tor-usage-attribution

feat(plugin): add optional executor usage attribution
…ators

- Preserve media from Gemini function responses in OpenAI, Codex, and Interactions translations.
- Preserve case-only OAuth model aliases.

Closes: router-for-me#7618
Closes: router-for-me#7621
- Add optional CacheCreation5mTokens and CacheCreation1hTokens pointer fields to pluginapi.UsageDetail while preserving aggregate CacheCreationTokens.
- Forward independent pointer copies via coreusage.CloneInt64Ptr in usageAdapter.HandleUsage to preserve missing versus explicit zero values across streaming and non-streaming paths.
- Add SDK, adapter, RPC schema, and Claude streaming/non-streaming regression tests.

Closes: router-for-me#7630
Allow payload replace rules to target arbitrary existing string
nodes via JSON paths relative to the provider payload root, as a
mutually exclusive alternative to role, positions, and all.

Resolve paths against the pre-write document, deduplicate nodes,
and skip missing, non-string, and computed values. Support queries,
projections, wildcard keys, escaped keys, and identity suffixes
while preserving concrete write tracking. Validate path targets
in config and document the new form in the example config.
feat(payload): add regex and system/developer targets to replace
- Add GPT-6.2 Astra and Sol to Codex team, plus, and pro model registries.
- Update the model fetcher’s default Codex client version to 0.169.0.
@PinableAgents
PinableAgents marked this pull request as ready for review November 18, 2026 10:55
@PinableAgents
PinableAgents merged commit 3faf03a into main Nov 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants