Skip to content

feat/fix/ci/test: context_window, tuple streaming, CI gate, E2E coverage, keepalive scheduler#604

Closed
icebear0828 wants to merge 9 commits into
devfrom
fix/egress-log-request-details
Closed

feat/fix/ci/test: context_window, tuple streaming, CI gate, E2E coverage, keepalive scheduler#604
icebear0828 wants to merge 9 commits into
devfrom
fix/egress-log-request-details

Conversation

@icebear0828
Copy link
Copy Markdown
Owner

@icebear0828 icebear0828 commented May 27, 2026

Summary

Test Plan

  • npm test — 243 test files, 2431 tests passed, 1 skipped
  • npx tsc --noEmit — 0 errors
  • npm run build:web — builds in ~600ms

Notes

TupleStreamDecoder

State machine (await-open → skip-key → collect-value → done) tracks JSON depth character-by-character, calls reconvertTupleValues on each emitted element. Handles nested tuples, objects, arrays, and escaped strings.

KeepaliveScheduler

Calls /codex/usage per active account on schedule to refresh quota window state. Deactivated/banned accounts are auto-marked expired. Dashboard UI left for follow-up.

New E2E test pattern

admin-settings.test.ts and dashboard-login.test.ts are self-contained (no e2e-setup.ts), following the pattern established in proxy-routes.test.ts.

…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
@icebear0828 icebear0828 changed the title feat(models): expose context_window and max_output_tokens in /v1/models response fix(translation): add context_window to /v1/models and fix tuple-schema streaming May 27, 2026
@icebear0828 icebear0828 changed the title fix(translation): add context_window to /v1/models and fix tuple-schema streaming fix/feat/ci: context_window in /v1/models, tuple streaming decoder, and CI quality gate May 27, 2026
…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)
@icebear0828 icebear0828 changed the title fix/feat/ci: context_window in /v1/models, tuple streaming decoder, and CI quality gate feat/fix/ci/test: context_window, tuple streaming, CI gate, E2E coverage, keepalive scheduler May 27, 2026
@icebear0828
Copy link
Copy Markdown
Owner Author

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.

@icebear0828 icebear0828 closed this Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant