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>
This commit is contained in:
decolua
2026-06-13 22:05:01 +07:00
co-authored by Cursor
parent ad2a3e5de3
commit 4da1d6dad4
6 changed files with 30 additions and 3 deletions
+17
View File
@@ -0,0 +1,17 @@
// Guards forceStream moved from chatCore hardcode → PROVIDERS schema (#5).
import { describe, it, expect } from "vitest";
const FORCED = ["openai", "codex", "commandcode"];
describe("forceStream provider config", () => {
it("only openai/codex/commandcode force streaming", async () => {
const { PROVIDERS } = await import("../../open-sse/config/providers.js");
for (const id of FORCED) {
expect(PROVIDERS[id]?.forceStream, `${id} forced`).toBe(true);
}
// a sample of others must NOT force
for (const id of ["deepseek", "claude", "gemini", "openrouter"]) {
expect(PROVIDERS[id]?.forceStream, `${id} not forced`).not.toBe(true);
}
});
});