Files
openclaw-zero-token/scripts/vitest.zero-token-web.config.ts
sjhu 3585d40cd3 fix(web-providers): fix 13 web models + add E2E test suite + simplify UI
Web model fixes:
- ChatGPT: update send button selectors for 2026 UI
- Gemini: use innerText instead of textContent, tighten response selectors
- Kimi: fix Connect binary protocol parser (only accept append/set ops)
- Qwen CN: add credentials:"include" to fix 403 signature error
- Perplexity: rewrite client with Playwright native keyboard API,
  only send last user message instead of full system prompt
- DeepSeek: fix tool_call regex, add data.v array handling,
  XML argument fallback, JUNK_TOKENS Unicode variants

E2E test suite (scripts/):
- Two-phase runner: TUI first (L2 HTTP + L3 WebSocket), then WebUI (L5 Playwright)
- Anti-ban: adaptive delay with provider interleaving
- Message pool: 20 natural CN/EN messages, random selection
- HTML report output to reports/

Other:
- Simplify chat UI: remove session/agent selector, keep only model selector
- onboard webauth: auto-exit after auth completes (process.exit)
- Move vitest config to scripts/ directory

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 05:17:30 +08:00

29 lines
971 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import path from "node:path";
import { fileURLToPath } from "node:url";
import { defineConfig } from "vitest/config";
const scriptsDir = fileURLToPath(new URL(".", import.meta.url));
const root = path.resolve(scriptsDir, "..");
const pluginSdkDist = path.resolve(root, "dist/plugin-sdk");
/** 仅跑 Zero Token web stream 相关单元测试,不依赖 browser-playwright 与主 vitest 多项目配置。 */
export default defineConfig({
resolve: {
// extensions/browser被若干 web-stream 间接引用)使用 openclaw/plugin-sdk/*
// 根包未在 node_modules 下挂名为 openclaw 的链接时Vite 需显式别名到 dist。
alias: [
{
find: /^openclaw\/plugin-sdk\/(.+)$/,
replacement: `${pluginSdkDist}/$1.js`,
},
],
},
test: {
environment: "node",
include: [
"src/zero-token/streams/web-stream-factories.test.ts",
"src/zero-token/streams/doubao-web-stream.test.ts",
],
},
});