11089ab137
Merge origin/master (v0.5.81) into gitea/new_feature
...
Resolve conflicts:
- streamingHandler.js: merge buildStreamErrorBytes onAbortTerminal + local shouldPersistRequestDetail & streamStatusForContent
- capabilities.js: preserve server-injected user-asserted caps and models.dev catalog lookup; wire CommandCode /alpha/generate caps inside resolve()
- commandcode.js (services/usage): adopt upstream whoami + billing credits/subscriptions with 5h/weekly rate windows and plan caps
- openai-to-commandcode.js: merge toNativeImageBlock (data-URI & http(s) support) and assistant reasoning_content preservation
- commandcode-to-openai.js: adopt upstream mid-stream error throw for clean retry and abortion
- tests: sync commandcode test suite and exclude .next from vitest config
2026-09-22 10:08:58 +07:00
Christian Gennari
092c84eac9
fix(commandcode): retry on transient stream error and avoid fake stop chunks
2026-09-18 17:09:24 +07:00
9b27ee2611
fix(open-sse): treat CommandCode in-stream error events as request failures
...
Upstream emits AI SDK v5 {"type":"error"} events inside an HTTP 200 stream.
The translator turned them into fake success content ([CommandCode error: ...]
+ finish_reason stop), so account/model fallback never fired and logs showed
Status: success.
- translator: error events now emit an OpenAI-shaped error chunk (chunk.error)
instead of content; parseSSEToOpenAIResponse already detects chunk?.error
- executor: peek the first events before committing the response; an early
error event returns 502 so fallback runs before any byte reaches the client
2026-08-04 23:26:37 +07:00
decolua
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
633b66dcb6
refactor(translator): P4 concern #5 buildUsage — apply to kiro/ollama/commandcode
...
- Replace 3 inline {prompt,completion,total} usage objects with buildUsage()
- Preserves ?? vs total fallback semantics (commandcode)
- Golden tests pass, identical output
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-06-13 21:27:22 +07:00
decolua
4cc667253a
refactor(translator): P4 concern #6 finishReasonMap — switch-by-format, default common
...
- concerns/finishReasonMap.js: toOpenAIFinish/fromOpenAIFinish, switch special formats, default passthrough
- Replace 3 inline switch maps (claude→oai, oai→claude, commandcode→oai)
- Golden translator tests pass, behavior identical
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-06-13 21:20:22 +07:00
decolua
6597b81e5e
refactor(open-sse): add reasoningDelta helper, dedup thinking deltas (B4)
...
Centralize the reasoning_content delta shape (optional assistant role) used by
claude/gemini/kiro/codex/commandcode response translators. Keeps the cross-format
convention consistent for future translators. Output byte-for-byte identical;
golden + gate clean. Ollama left as-is (mutates existing delta object).
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-06-13 18:21:46 +07:00
decolua
17202f7111
refactor(open-sse): extract chunkBuilder, dedup chat.completion.chunk (B1)
...
Add helpers/chunkBuilder.js; apply to claude/gemini/kiro/ollama/commandcode/
openai-responses response translators. Caller supplies id/created/model so each
keeps exact id-generation + usage semantics. Extend golden response stream to
openai-responses (codex). No behavior change; gate: no regression.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-06-13 17:05:42 +07:00
decolua
ad661c1286
feat: enhance CommandCode integration with improved message handling
2026-05-07 23:02:07 +07:00
decolua
b72a443bd3
feat: add CommandCode provider support
2026-05-07 23:01:33 +07:00