Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
be96762
docs: add docker server migration plan
pyf-feifei Jun 11, 2026
0a20bef
feat: implement Docker support with server configuration and multimod…
pyf-feifei Jun 12, 2026
1604fc0
fix: harden docker browser import flow
pyf-feifei Jun 12, 2026
cbb44e4
fix: add offline browser import payload fallback
pyf-feifei Jun 12, 2026
3cd62fb
fix: select import script when clipboard is unavailable
pyf-feifei Jun 13, 2026
c186fff
feat: add Gemini-compatible API routes
pyf-feifei Jun 13, 2026
94de3db
fix: avoid base64 expansion for Gemini uploads
pyf-feifei Jun 13, 2026
2792eb9
chore: update qwen admin fixes
pyf-feifei Jun 25, 2026
e085e20
feat: add qwen ai request governor
pyf-feifei Jun 26, 2026
a9571a0
fix qwen ai risk governor and tool calls
pyf-feifei Jun 26, 2026
88a9732
Fix managed tool call argument parsing
pyf-feifei Jun 26, 2026
db9d934
fix managed XML tool call parsing
pyf-feifei Jun 27, 2026
1978fde
fix qwen ai global risk circuit
pyf-feifei Jun 29, 2026
51931e6
fix qwen oss multipart uploads
pyf-feifei Jun 29, 2026
43d4629
fix qwen ai request cancellation
pyf-feifei Jul 7, 2026
7c2dc70
Optimize Qwen direct video uploads
pyf-feifei Jul 8, 2026
c2950fd
fix: harden Qwen cancellation and Gemini request logging
pyf-feifei Jul 17, 2026
d531756
feat: complete Kimi Docker integration
pyf-feifei Jul 21, 2026
0d950b9
feat: harden Qwen proxy and add LiteLLM deployment
pyf-feifei Jul 22, 2026
3324533
fix: harden Qwen proxy streaming and recovery
pyf-feifei Jul 23, 2026
218eb3a
fix: prevent long Qwen streams from hitting wall-clock timeout
pyf-feifei Jul 23, 2026
e923709
fix: terminate mid-stream provider failures cleanly
pyf-feifei Jul 23, 2026
8ca9aff
fix: keep proxied streams alive across quiet periods
pyf-feifei Jul 23, 2026
add78c7
fix: keep Claude-compatible streams recoverable
pyf-feifei Jul 24, 2026
8a22109
fix: prevent invisible Qwen stream stalls
pyf-feifei Jul 24, 2026
94bb178
fix: tolerate optional malformed managed tool streams
pyf-feifei Jul 24, 2026
e349a93
fix: make Anthropic token counting multimodal-safe
pyf-feifei Jul 24, 2026
cae815a
fix: bound Anthropic token counting
pyf-feifei Jul 24, 2026
18aec46
fix: bound document source traversal
pyf-feifei Jul 24, 2026
5fb0cc9
fix: recover Qwen semantic-empty responses
pyf-feifei Jul 25, 2026
72ab14f
fix: preserve tool results before Qwen system preamble
pyf-feifei Jul 25, 2026
6af9ef8
fix: continue managed tool workflows after results
pyf-feifei Jul 25, 2026
4a581b0
fix: resume dangling managed tool responses
pyf-feifei Jul 25, 2026
14b0c2a
fix: continue semantic tool stalls in qwen chat
pyf-feifei Jul 25, 2026
7b8cfe4
fix: retry busy Qwen workflow continuations
pyf-feifei Jul 25, 2026
f0c6940
fix: suppress duplicate managed tool calls
pyf-feifei Jul 25, 2026
e452f66
fix: restore Docker proxy services after shutdown
pyf-feifei Jul 25, 2026
e395835
fix: recover Qwen managed tool calls with schema validation
pyf-feifei Jul 25, 2026
3b23a24
fix: recover failed Qwen tool workflows
pyf-feifei Jul 26, 2026
1714cff
fix: keep Claude tool workflows alive through Qwen busy responses
pyf-feifei Jul 26, 2026
7ad3ec5
fix: bound qwen recovery and tool transcript handling
pyf-feifei Jul 26, 2026
233c81a
fix: harden Qwen tool workflow recovery
pyf-feifei Jul 27, 2026
d270d1b
fix: keep Qwen preflight mutable until first frame
pyf-feifei Jul 27, 2026
253ff20
feat: add Responses API compatibility and Qwen resilience
pyf-feifei Jul 29, 2026
8319037
fix: preserve Qwen context in Claude tool workflows
pyf-feifei Jul 30, 2026
688944f
feat: harden Qwen context compaction and failover
pyf-feifei Aug 3, 2026
b430039
feat: harden Qwen streaming and recovery workflows
pyf-feifei Aug 4, 2026
11b3cbf
fix: preserve tool workflow continuation ordering
pyf-feifei Aug 5, 2026
17df405
fix: bound Qwen requests and guard streamed output
pyf-feifei Aug 5, 2026
526d543
fix: harden provider streaming and tool-calling recovery
pyf-feifei Aug 5, 2026
d753c37
feat: add Qwen Hermes protocol support and session repair capabilities
pyf-feifei Aug 7, 2026
7e29490
chore: remove pycache and manual live tests from tracking
pyf-feifei Aug 7, 2026
f89dd9e
feat: preserve structured tool-result images in Responses compat
pyf-feifei Aug 9, 2026
903caf7
fix: anchor Qwen workflow recovery to active request
pyf-feifei Aug 9, 2026
1e696fe
feat: add Qwen3.8-Max thinking-mode aliases
pyf-feifei Aug 10, 2026
9b7be92
更新gitignore
pyf-feifei Aug 10, 2026
baad888
docs: refresh README and project links
pyf-feifei Aug 12, 2026
3821f05
feat: improve Qwen AI account policy, session bridging, and tool-call…
pyf-feifei Aug 13, 2026
4569f83
feat: improve proxy forwarding, tool-call completion, and deployment …
pyf-feifei Aug 16, 2026
1ba1100
test: sync test suite with proxy and tool-call changes
pyf-feifei Aug 16, 2026
be8893a
chore: update qwen and deployment tests
pyf-feifei Aug 17, 2026
95ef34a
fix: stabilize qwen tool-call streaming
pyf-feifei Aug 18, 2026
1846e14
fix: preserve attachments across qwen continuations
pyf-feifei Aug 18, 2026
936ba30
chore: add server deployment and update scripts
Aug 20, 2026
9736030
fix: support NodeSource npm installations
Aug 21, 2026
43fe0f9
feat: switch fork base to pyf-feifei webui edition
Aug 21, 2026
d641d31
feat: add authenticated WebUI server deployment
Aug 21, 2026
05886c9
fix: reuse existing Docker CE installations
Aug 21, 2026
b8facf4
fix: preserve WebUI settings and deployed git ref
Aug 21, 2026
ea9c6a0
revert: preserve native management secret authentication
Aug 21, 2026
b8b3c50
fix: align deployment with native Py authentication
Aug 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.git
.codex
.config
node_modules
out
out-server
out-admin
dist
coverage
backup
logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
*.log
docs/screenshots
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ node_modules/

# Build outputs
out/
out-server/
out-admin/
dist/
build/entitlements.mac.plist

Expand Down Expand Up @@ -39,16 +41,25 @@ Thumbs.db
*.swp
*.swo
.codex/
.playwright-mcp/
CLAUDE.md

# Environment
.env
.env.local
.env.*.local

# Python
__pycache__/
*.pyc
*.pyo

# Test
coverage/

# Manual live test scripts (local debugging only)
tests/manual/*-live.mjs

# Misc
*.pem
*.p12
Expand All @@ -58,3 +69,10 @@ src/renderer/next-app/

# Backup
backup/

# Local migration artifacts and development data
.local/
.local-artifacts/

# Local live debug logs
.tmp-live-*.ndjson
229 changes: 229 additions & 0 deletions .qwen-home.html

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .qwen-main.js

Large diffs are not rendered by default.

113 changes: 113 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
ARG NODE_IMAGE=node:22.21.1

FROM ${NODE_IMAGE} AS deps
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --ignore-scripts

FROM ${NODE_IMAGE} AS build
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm run build:server

FROM ${NODE_IMAGE} AS runtime
WORKDIR /app
ENV NODE_ENV=production
ENV CHAT2API_HOST=0.0.0.0
ENV CHAT2API_PORT=8080
ENV CHAT2API_DATA_DIR=/data
ENV CHAT2API_COMPACTION_DETECTION=auto
ENV CHAT2API_QWEN_AI_COMPACTION_THINKING=auto
# Compaction input uses live model limits first; these values are deployment
# controls for an explicit override, optional metadata cap, or a
# catalogue-without-limits fallback. Zero leaves live metadata uncapped.
ENV CHAT2API_QWEN_AI_COMPACTION_INPUT_TOKEN_BUDGET=0
ENV CHAT2API_QWEN_AI_COMPACTION_METADATA_MAX_INPUT_TOKENS=0
ENV CHAT2API_QWEN_AI_COMPACTION_FALLBACK_INPUT_TOKENS=12000
ENV CHAT2API_QWEN_AI_COMPACTION_PROMPT_TOKEN_RESERVE=512
ENV CHAT2API_QWEN_AI_COMPACTION_CHUNK_DELAY_MS=0
ENV CHAT2API_QWEN_AI_COMPACTION_MAX_REDUCTION_ROUNDS=6
# Zero means use the complete active account pool discovered at runtime.
ENV CHAT2API_QWEN_AI_COMPACTION_MAX_ACCOUNT_ATTEMPTS=0
# Limit simultaneous recovery candidates only; account rotation still uses
# the complete active pool unless the deployment sets an attempt cap.
ENV CHAT2API_QWEN_AI_COMPACTION_FAILOVER_WAVE_SIZE=2
ENV CHAT2API_QWEN_AI_MAX_ACCOUNT_FAILOVERS=0
# Keep the adaptive pacing floor aligned with the validated multi-account
# deployment; upstream 429/risk responses still control account cooldowns.
ENV CHAT2API_QWEN_AI_AUTO_TUNE_MIN_GLOBAL_INTERVAL_MS=1000
# Repair active Qwen AI accounts that have a JWT but no Web session cookie.
# Sign-ins are serialized and globally paused when Qwen returns risk control.
ENV CHAT2API_QWEN_AI_SESSION_REPAIR_ENABLED=true
ENV CHAT2API_QWEN_AI_SESSION_REPAIR_INTERVAL_MS=25000
ENV CHAT2API_QWEN_AI_SESSION_REPAIR_RESCAN_MS=60000
ENV CHAT2API_QWEN_AI_SESSION_REPAIR_RISK_COOLDOWN_MS=180000
ENV CHAT2API_QWEN_AI_SESSION_REPAIR_FAILURE_RETRY_MS=300000
ENV CHAT2API_QWEN_AI_SESSION_REPAIR_CREDENTIAL_RETRY_MS=21600000
# Docker deployments allow long active generations within the cumulative
# request deadline while separately bounding streams that stop producing data.
# Queue admission has its own timer but still shares the route deadline.
ENV CHAT2API_QWEN_AI_QUEUE_TIMEOUT_MS=120000
# Keep one effective governor slot available for ordinary client requests
# while a context-compaction map/reduce is active.
ENV CHAT2API_QWEN_AI_COMPACTION_RESERVED_SLOTS=1
# Managed reasoning, answers, and tool arguments remain private until terminal
# validation so a failed provider branch cannot leak before account recovery.
ENV CHAT2API_QWEN_AI_BUFFER_MANAGED_STREAMS=true
# Start document offload before a large Qwen Web request reaches its model context.
# This is a transport target, not a local client request limit; zero disables it.
ENV CHAT2API_QWEN_AI_REQUEST_MAX_BYTES=92160
# Bound inline Hermes routing summaries while complete tool documentation stays
# in the account-scoped reference attachment. Zero omits inline descriptions.
ENV CHAT2API_QWEN_AI_HERMES_ROUTING_SUMMARY_MAX_CODE_POINTS=240
# Managed-branch and upstream-busy recovery counts are deployment controls.
# Their request deadlines remain authoritative; zero disables each path.
ENV CHAT2API_QWEN_AI_RETRY_COUNT=1
ENV CHAT2API_QWEN_AI_BUSY_RETRY_COUNT=1
# A transport reset can continue the same Qwen response without resubmitting
# the prompt. Deployments can tune or disable this bounded recovery budget.
ENV CHAT2API_QWEN_AI_STREAM_RESUME_ATTEMPTS=3
ENV CHAT2API_QWEN_AI_STREAM_RESUME_DELAY_MS=1000
# Response-id resumes and managed workflow continuations share this
# no-progress budget; it pauses while a replacement stream is active.
ENV CHAT2API_QWEN_AI_RECOVERY_BUDGET_MS=180000
# Default to one same-chat semantic correction; the deployment controls the count.
ENV CHAT2API_QWEN_AI_WORKFLOW_CONTINUATION_ATTEMPTS=1
# Semantic continuation branches also share an absolute wall-clock deadline.
ENV CHAT2API_QWEN_AI_WORKFLOW_RECOVERY_TIMEOUT_MS=840000
# Busy-chat admission is bounded separately from the long generation timeout.
# Leave the generic retry-count override unset so ordinary semantic workflow
# continuations retain deadline mode; Responses tool-result continuations use
# the dedicated override below.
ENV CHAT2API_QWEN_AI_CHAT_IN_PROGRESS_RETRY_BUDGET_MS=300000
ENV CHAT2API_QWEN_AI_CHAT_IN_PROGRESS_RETRY_DELAY_MS=1000
# Retained Responses tool-result continuations fail fast into same-account
# full replay; semantic workflow continuations use the generic policy above.
ENV CHAT2API_QWEN_AI_RESPONSES_CONTINUATION_RETRY_ATTEMPTS=0
ENV CHAT2API_VALIDATED_SSE_MAX_HOLD_MS=60000
ENV CHAT2API_SSE_KEEPALIVE_INTERVAL_MS=15000
# Keep the HTTP listener alive long enough for the longest configured request
# to finish when Docker sends SIGTERM during an update.
ENV CHAT2API_SHUTDOWN_DRAIN_TIMEOUT_MS=540000
# Keep the default cumulative deadline below typical downstream transport
# limits so a structured terminal response has time to propagate.
ENV QWEN_AI_REQUEST_TIMEOUT_MS=840000
# Zero disables only the additional post-admission response cap. The
# cumulative QWEN_AI_REQUEST_TIMEOUT_MS deadline still bounds the full request.
ENV QWEN_AI_RESPONSE_TIMEOUT_MS=0
ENV QWEN_AI_STREAM_IDLE_TIMEOUT_MS=180000
# Bound each account's document parse stage independently so a stalled parse
# can move to another account while the cumulative request deadline remains.
ENV QWEN_AI_FILE_PARSE_POLL_INTERVAL_MS=2000
ENV QWEN_AI_FILE_PARSE_TIMEOUT_MS=120000
ENV QWEN_AI_OSS_STS_REFRESH_INTERVAL_MS=240000
COPY package.json package-lock.json ./
RUN npm ci --omit=dev --ignore-scripts && npm cache clean --force
COPY --from=build /app/out-server ./out-server
COPY --from=build /app/out-admin ./out-admin
COPY --from=build /app/sha3_wasm_bg.7b9ca65ddd.wasm ./sha3_wasm_bg.7b9ca65ddd.wasm
RUN mkdir -p /data
VOLUME ["/data"]
EXPOSE 8080
CMD ["node", "out-server/server/index.js"]
Loading