decolua
b282f05549
Refactor
2026-06-15 18:18:04 +07:00
decolua and Cursor
aba4c45da6
fix(translator): ESM-safe registry + tool-id pairing + responses max_tokens; add real-creds tests
...
- translator/index.js: replace require() with static side-effect imports (ESM-safe),
lazy-init registry maps to survive circular import order
- openai-responses->openai: map max_output_tokens -> max_tokens (avoid leaking field upstream)
- gemini/antigravity -> openai: derive deterministic tool_call id from name so
functionCall/functionResponse pair correctly (fixes provider tool-pairing 400s)
- add offline unit tests (finish-reason, usage, session-manager, ollama malformed args, const guard)
- add real-creds integration tests (provider-cases + all-formats matrix: 6 inbound formats x 4 scenarios)
Includes co-located provider registry refactor (pricing/capabilities/media providers) and sessionManager updates.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-06-15 11:38:43 +07:00
decolua and Cursor
d3f61aac2f
refactor(open-sse): translator DRY + schema enums, bug fixes, dead code cleanup
...
- Bug B1-B7: media UI m.kind||m.type, serviceKinds, gemini mediaPriority, schema kind, models/info lookup by kind
- Dead code D1-D6: safeParseJSON, drop PROVIDER_ENDPOINTS, orphan fetcher, GITHUB_CONFIG derive, getProviderConfig internal, legacy kiro file
- Translator concerns: toOpenAIUsage, toOpenAIFinish (gemini/kiro/ollama + fix kiro tool finish), thinking effort maps
- Reorg helpers/ → concerns/ (logic) + formats/ (per-format) + schema/ (pure enums: roles/blocks/finishReasons/defaults)
- Wire ~280 hardcoded role/block/finish/default literals to schema enums across 20+ files
- collapseTextParts + extractTextContent dedup
- Normalize translator fn names to openaiToXRequest / xToOpenAIResponse
- Golden tests lock behavior; 0 regression (byte-for-byte providers/alias, 26=26 known fails)
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-06-14 18:49:38 +07:00
decolua and Cursor
dd1e0f9bcc
refactor(registry): B2 migrate to LiteLLM-style schema — unified models[] with kind field
...
- 71 registry files: flat `media.*Config.models` → `models[]` with `kind` field
- `media` wrapper removed → serviceKinds, *Config fields promoted top-level
- `type` field renamed to `kind` (llm/image/tts/stt/embedding/embedding/video/music)
- providers/index.js: PROVIDER_MEDIA now built from flat top-level media fields
- shared/constants/providers.js: buildProviderEntry reads flat top-level media fields
- route /v1/models: modelKind() uses kind||type; removed subConfig merge block
- models/info route: removed sub-config fallback lookup (all models in PROVIDER_MODELS)
- ttsProviders/index.js: synthesizeViaConfig reads tts models from PROVIDER_MODELS
- test-models route, helpers.js, validate route: kind||type compat
- Baselines: PROVIDERS 62/62 ✅ , Alias 90/90 ✅
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-06-14 14:32:59 +07:00
decolua and Cursor
e53ce79abb
refactor(open-sse): B1 consolidate media endpoint URLs into registry
...
- image/embed/tts/search base URLs derive from media.*Config.baseUrl /
searchViaChat.endpoint (single source); handlers read PROVIDER_MEDIA.
- ~18 hardcoded endpoints moved: bfl/fal/stability/runway/hf/gemini/
cloudflare/recraft/sdwebui/comfyui/nanobanana image, voyage embed,
gemini/openrouter tts, chatSearch endpoints.
- Byte-identical: PROVIDERS 62 + alias 90 baselines, image buildUrl outputs.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-06-14 13:58:12 +07:00
decolua and Cursor
bb9e9aa91f
refactor(open-sse): registry consolidation + DRY media/oauth/adhoc cleanup
...
- Single-source registry: oauth clientId/tokenUrl, usage URLs, image/embed
configs, search defaultModel, codex fixedPort, google token url derive.
- Remove 29 unused OmniRoute providers (registry 100→71); media intact.
- De-adhoc: codex literals → registry format/oauth flags; reasoningInject,
image/embed openrouter headers + xai bodyFields config-driven.
- Add REGISTRY_TEMPLATE.js + expand PROVIDER_DEFAULTS/schema JSDoc.
- Baselines updated; PROVIDERS 62 + alias 90 byte-for-byte, golden snapshots.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-06-14 13:15:48 +07:00
decolua and Cursor
4da1d6dad4
refactor(open-sse): D1c — forceStream hardcode → PROVIDERS schema ( #5 )
...
chatCore providerRequiresStreaming: switch provider-name →
PROVIDERS[provider].forceStream. Thêm forceStream:true vào registry
openai/codex/commandcode. verify-providers allowlist added-fields
(forceStream/urlSuffix verified bằng golden + runtime test riêng).
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-06-13 22:05:01 +07:00
decolua and Cursor
ad2a3e5de3
refactor(open-sse): D1a/D1b — URL quirks → schema urlSuffix + clean debug logs
...
buildUrl: switch provider-name → config-driven. ?beta=true thành
urlSuffix per registry (claude/glm/kimi/minimax/minimax-cn/kimi-coding);
gemini path dùng format==="gemini"; accountId substitution giữ generic.
Xóa console.log('[DEBUG]') trong refreshCline.
Golden url-header 142 pass (byte-for-byte URL).
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-06-13 22:00:57 +07:00
decolua and Cursor
72ce515709
refactor(open-sse): dedupe Google OAuth client credentials ( #4 )
...
clientId/clientSecret của antigravity + gemini bị lặp 3 nơi
(registry, usage.js, src/lib/oauth). Gom vào shared.js
(ANTIGRAVITY_OAUTH_CLIENT, GOOGLE_OAUTH_CLIENT), các file spread vào.
Byte-for-byte: PROVIDERS/alias/oauth-url equal, golden 142 pass.
Thêm test guard nội dung + alias resolution.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-06-13 21:53:14 +07:00
decolua and Cursor
d2b0960bf7
refactor(open-sse): P3§7 model defaults schema — centralize type/quotaFamily/strip/targetFormat
...
- Add providers/models/schema.js (MODEL_DEFAULTS + field resolvers)
- Accessors getModelTargetFormat/QuotaFamily/Strip use shared default resolvers
- getModelType keeps null contract unchanged; behavior verified equal
- No catalog forced into registry (models stay self-contained per docs decision)
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-06-13 21:13:37 +07:00
decolua and Cursor
5a042840fd
refactor(open-sse): P3 provider registry — split into providers/registry/{id}.js
...
- 100 registry files: transport + models co-located per provider (Mongoose-style)
- providers/shared.js: shared Claude headers + OS/arch helpers (deduped)
- providers/models/helpers.js: withCodexReviewModels (kept dynamic)
- providers/index.js builds PROVIDERS + PROVIDER_MODELS = old API (content byte-for-byte)
- config/providers.js + providerModels.js → barrel re-export, keep accessors + runtime helpers
- Verified: PROVIDERS/MODELS/OAuth/alias byte-for-byte, golden translator tests pass, 0 new regression
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-06-13 21:08:37 +07:00
decolua and Cursor
34ea763d80
refactor(open-sse): add provider/model schema skeleton (C-prep)
...
New unwired modules providers/schema.js + models/schema.js with PROVIDER_DEFAULTS,
ENDPOINT_DEFAULTS, resolveProvider, MODEL_DEFAULTS, resolveModel (3-tier merge).
Foundation for upcoming registry tasks; no runtime wiring yet.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-06-13 17:05:42 +07:00