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
This commit is contained in:
2026-09-22 10:08:58 +07:00
95 changed files with 4059 additions and 1016 deletions

View File

@@ -71,6 +71,7 @@ vi.mock("../../open-sse/rtk/index.js", () => ({
vi.mock("../../open-sse/rtk/headroom.js", () => ({
compressWithHeadroom: vi.fn(async () => null),
formatHeadroomLog: vi.fn(() => ""),
formatHeadroomSizeLog: vi.fn(() => ""),
}));
vi.mock("../../open-sse/providers/capabilities.js", () => ({
@@ -88,6 +89,7 @@ vi.mock("../../open-sse/translator/concerns/prefetch.js", () => ({
vi.mock("../../open-sse/handlers/chatCore/requestDetail.js", () => ({
buildRequestDetail: vi.fn((detail) => detail),
extractRequestConfig: vi.fn((body, stream) => ({ body, stream })),
shouldPersistRequestDetail: vi.fn(() => false),
}));
vi.mock("../../open-sse/utils/error.js", () => ({