Sub2API 0.1.129
AI API Gateway Platform - 将 AI 订阅配额分发和管理
Cursor input-shaped chat/completions requests for OpenAI accounts were being normalized into Chat Completions too early. That rewrote ApplyPatch from a custom grammar tool into an empty-schema function tool, which caused the model to repeatedly emit {} and Cursor to fail file edits.
This change adds an OpenAI-specific Cursor normalizer that keeps Responses-shaped input requests intact, routes the Cursor compat handler through it for OpenAI groups, and locks the behavior with focused compat and end-to-end tests. The result is that custom grammar tools reach the upstream Responses/Codex path without being flattened.
Constraint: The shared OpenAI Responses/Codex path must remain the source of truth for custom tool handling
Rejected: Teaching the shared Chat tool bridge to encode grammar constraints | still loses native custom tool semantics and broadens blast radius
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Do not normalize OpenAI Cursor input-shaped chat requests into messages before the upstream Responses path has seen them
Tested: go test ./internal/compat/cursor ./internal/pkg/apicompat ./internal/handler ./internal/service -run 'Cursor|Compat|OpenAI|ResponsesShape|ChatCompletions' -count=1; go vet ./internal/compat/cursor ./internal/pkg/apicompat ./internal/handler ./internal/service
Not-tested: Real Cursor desktop round-trip against a live upstream after release
📥 Installation
Docker:
# GitHub Container Registry
docker pull ghcr.io/wanggang8/sub2api:0.1.129One-line install (Linux):
curl -sSL https://raw.githubusercontent.com/wanggang8/sub2api/main/deploy/install.sh | sudo bashManual download:
Download the appropriate archive for your platform from the assets below.