Repository navigation
feat: add Responses, Anthropic, and Antigravity compatible endpoints with thinking tier probing - #442
Conversation
… endpoints with thinking tier probing
|
Thanks for putting this together — it's clearly a lot of work, and the build and tests pass on my end. Before going further, can you help me understand the use case? What setup are you running that needs these endpoint types, and who else would use them? I ask because a lot of this reads as being built for proxy gateways that wrap consumer subscriptions (Codex / ChatGPT, Antigravity, Claude) into an API — the "multi-account gateway" wording, the If there's a standard use case here (e.g. a company gateway or a provider that serves the Anthropic Messages or OpenAI Responses format at its own URL), I'm open to hearing it — ideally as a smaller, focused PR without the proxy-specific pieces, since this one also changes shared code paths for the built-in Anthropic, Google and OpenAI-compatible providers. |
|
Makes total sense — completely understood on keeping CLI/subscription wrappers out of Nexus. Happy to drop On the standard API side, there are three non-proxy gaps I ran into because the built-in
Dropping If any of these fit Nexus's scope, I can close
Let me know which of these (if any) you'd welcome, and I'll scope accordingly. |
Extends the custom endpoint architecture introduced in #405 and #441 to cover third-party OpenAI Responses, Anthropic Messages, and Antigravity (
v1beta+messages) gateways, and unlocks model-specific thinking effort tiers from passive/modelsmetadata and active endpoint probing across all four compatible provider drivers.What changes
ProviderHttpClientandapp.secretStorage):responses-compatible(/v1/responsesand/codex/responses): supports Stateless full-input replay (store: false,instructions, andfunction_call/function_call_outputitems — safe across multi-account gateways) and Statefulprevious_response_idcontinuations, configurableBearer/x-api-key/ dual auth headers, reasoning summary streaming, and automatic SSE stream-collection fallback when Codex-backed endpoints rejectstream: false.anthropic-compatible(/v1/messages): reusesAnthropicAdapterwith configurable base URLs (root,/v1, or prefixed gateway paths),x-api-key/Bearer/ dual auth headers,/v1/models→/modelsdiscovery fallback, native tool calling, vision, and signedanthropic_thinking_blocks/anthropic_response_contentreplay across tool continuations.antigravity-compatible(v1beta+messagesHTTP gateways, distinct from the desktopagyCLI): supports Auto routing (gemini-*via{root}/v1beta/models/{model}:streamGenerateContent?alt=sse,claude-*via{root}/v1/messageswith concurrent dual-catalog discovery) as well as forcedv1beta-only ormessages-only modes, preservingthought_signatureacross tool rounds.openai-compatible,responses-compatible,anthropic-compatible,antigravity-compatible):Connect, zero token cost): readssupported_reasoning_levels,reasoning,thinking(including Gemini/v1beta/models),supports_reasoning, andsupported_openai_paramswhen advertised by the server.Probebutton (alongside#441's context-window Check button in bothOpenAICompatibleModalandCustomCompatibleModal): sends minimal requests with a sentinel validation guard (preventing false positives on permissive servers that ignore unknown fields) to detect exact accepted effort tiers (low,medium,high,xhigh,max) and wire modes (adaptivevsbudgeton Anthropic Messages;thinkingLevelvsthinkingBudgeton Geminiv1beta;reasoning_effort/reasoning.efforton OpenAI Chat & Responses).modelCapabilities.tsandthinkingLevels.tsexpose only the model's supported effort levels in chat settings and clamp outbound requests (including wiringreasoning_effortonOpenAICompatibleAdapterwhen thinking is enabled).extractError/extractResponsesApiStreamErrorwired on every streaming surface.Verification
python3 .skills/nexus-llm-adapters/scripts/check_stream_error_wiring.py --repo-root . --strictpasses (15/15streaming adapters clean).npm run buildpasses (schemas:check,eslint .includingobsidianmd/ui/sentence-case,node scripts/check-mobile-imports.mjs,tsc --noEmit, production bundle).npm testpasses across all 584 suites (7,268passed,0failed), including new suites:tests/unit/ResponsesCompatibleAdapter.test.tstests/unit/AnthropicCompatibleAdapter.test.tstests/unit/AntigravityCompatibleAdapter.test.tstests/unit/CompatibleThinkingTiers.test.tsthinking+ text + tool calls + continuation signatures), mid-stream HTTP-200 error frames (PROVIDER_STREAM_ERROR), and live HTTP tier probing across all four protocols against localnode:httptest gateways.