feat/fix/ci/test: context_window, tuple streaming, CI gate, E2E coverage, keepalive scheduler - #604
feat/fix/ci/test: context_window, tuple streaming, CI gate, E2E coverage, keepalive scheduler#604icebear0828 wants to merge 9 commits into
Conversation
…arden affinity - wantReasoning/wantThinking now derived from codexRequest.reasoning?.effort after translation; previously only explicit client fields were checked, so effort injected via model suffix (e.g. gpt-5.4-high) or default_reasoning_effort config was sent upstream but the returned reasoning deltas were silently dropped - SessionAffinityMap stores instructions as SHA-256 hash instead of raw string to bound per-entry memory usage; implicit-resume comparison updated to match - developer role in Codex requests now mapped to system for OpenAI-compatible backends that reject the developer role; CodexInputItem type updated accordingly - Proxy host field now accepts a full URL directly to avoid double-prefix when user pastes http://... or socks5://... into the host input - Dashboard proxy panel adds "Paste URL" mode as alternative to field-by-field entry; i18n strings added for zh/en - Config version bump to 26.519.81530 / build 3178
- [CRITICAL] null instructions → hash regression: record() now accepts
string|null|undefined and uses sha256(instructions ?? "") so that
no-system-prompt sessions store sha256("") instead of undefined,
matching the comparison side in proxy-session-context; callers no
longer coerce null→undefined via ?? undefined
- [HIGH] ProxyPool handleAdd useCallback missing urlMode/newRawUrl deps
caused URL paste mode to always see stale empty values and never
submit; also reset urlMode in resetForm()
- [MEDIUM] proxy name credential leak: when name is empty and falls back
to the full URL, strip username/password before using as display name
Cover three missing paths from PR review: - empty name with credential URL → name has creds stripped - full URL pasted into host field → accepted as-is - explicit name takes precedence over URL fallback
…ls response Clients such as OpenCode read context_window from the model list to determine the usable context size. The field was absent, causing them to fall back to hardcoded defaults that didn't match actual model limits. Closes #578
…tal decoder Previously, any structured-output request using prefixItems (tuple schemas) caused the entire response text to be held in memory until response.completed, then emitted as a single chunk — the client saw nothing until the response finished. TupleStreamDecoder tracks JSON depth character-by-character and emits each top-level array element as soon as its boundary is found, giving progressive output for both the OpenAI and Gemini streaming paths. Closes #379
…coverage 47 new tests across 3 files covering the full HTTP pipeline: - accounts.test.ts: list/add/delete/reset-usage/label/cookies/batch ops/export - admin-settings.test.ts: rotation/settings/general/quota GET+POST + auth gating - dashboard-login.test.ts: login/logout/status + rate-limit enforcement Partially closes #376
- Config schema: account_keepalive section (enabled, mode, fixed_times, interval_minutes, concurrency, per_account_delay_ms) with defaults - KeepaliveScheduler: fixed_times and interval modes, batch concurrency, per-batch stagger delay, single-run guard, deactivated-account detection - Admin routes: GET /admin/keepalive-status, POST /admin/keepalive-config, POST /admin/keepalive-run - Wired into server startup (keepaliveScheduler.start()) and shutdown - 14 unit tests: computeNextRun + executeAll edge cases Partially closes #512 (Dashboard UI to follow)
|
Closing: core changes (tuple-schema, context_window, CI gate, session-affinity) already landed via subsequent PRs. Keepalive scheduler overlaps with #624's ActiveQuotaRefresher. E2E tests can be cherry-picked in a follow-up if needed. |
|
经过对 PR #604 #604 中全部 9 结论:#604 中的全部有价值内容均已合并或被更优方案替代,分支 fix/egress-log- 9 个 Commits 落地与利用情况明细Commit │ 简述 │ 落地状态与对应 PR [1]: PR #603 #603 分支清理该分支关联的历史 PR(#588、#594、#603 已 merge,#604 已 closed),已无任何 |
Summary
/v1/modelsnow returnscontext_windowandmax_output_tokensfrommodels.yaml(closes 最大上下文问题 #578)TupleStreamDecoder— emits each array element at its JSON boundary (closes perf: Tuple Schema streaming buffers entire response before emitting #379)test-build-typecheckjob toci-quality.yml— full unit/integration/e2e suite (242 files),tsc --noEmit,npm run build:webon every PR (closes ci: no automated validation for Docker/Electron/Web build artifacts #378)fixed_times/intervalmodes, admin routes (GET/POST /admin/keepalive-status/config/run), 14 unit tests (partial feat: add scheduled account keepalive renewal #512)Test Plan
npm test— 243 test files, 2431 tests passed, 1 skippednpx tsc --noEmit— 0 errorsnpm run build:web— builds in ~600msNotes
TupleStreamDecoder
State machine (
await-open → skip-key → collect-value → done) tracks JSON depth character-by-character, callsreconvertTupleValueson each emitted element. Handles nested tuples, objects, arrays, and escaped strings.KeepaliveScheduler
Calls
/codex/usageper active account on schedule to refresh quota window state. Deactivated/banned accounts are auto-markedexpired. Dashboard UI left for follow-up.New E2E test pattern
admin-settings.test.tsanddashboard-login.test.tsare self-contained (noe2e-setup.ts), following the pattern established inproxy-routes.test.ts.