Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
47c860f
feat(db): split pool into data/control/writer lanes with bounded admi…
ding113 Jul 14, 2026
2c9fa5c
feat(proxy): add demand-driven response pump with bounded backpressure
ding113 Jul 14, 2026
39d81ec
feat(repository): add durable terminal write with CAS fallback for me…
ding113 Jul 14, 2026
da28904
perf(rate-limit): batch cost tracking into single pipeline and settle…
ding113 Jul 14, 2026
91cf8aa
fix(shutdown): join in-flight tasks and close DB pools after writer q…
ding113 Jul 14, 2026
089d265
fix(langfuse): redact credential headers at the trace boundary
ding113 Jul 14, 2026
f356f35
test(redis): add timeout and reconnect regression coverage
ding113 Jul 14, 2026
e26159d
fix(repository): pass committed patch to delayed durable onCommitted …
ding113 Jul 14, 2026
ccfd979
fix(ws): bound outbound backpressure and drain request bodies safely
ding113 Jul 16, 2026
0cabf1b
fix(proxy): track concurrency ownership to prevent leak on early exit
ding113 Jul 16, 2026
8749333
refactor(proxy): drive Gemini passthrough through demand-driven pump
ding113 Jul 16, 2026
9e49d74
fix(proxy): persist terminal error details durably before status trac…
ding113 Jul 16, 2026
4fee48e
refactor(proxy): replace combined abort signal with listener-bound tr…
ding113 Jul 16, 2026
d494aae
test(integration): cover async write-buffer recovery and CAS semantics
ding113 Jul 16, 2026
2a31e6d
test(dashboard): pass explicit UTC timezone to resolveTimePresetDates
ding113 Jul 16, 2026
2fb8cc3
test(repository): cover message terminal writes, CAS, cost accounting…
ding113 Jul 16, 2026
2e2b059
chore: format code (perf-full-path-benchmark-optimization-2fb8cc3)
github-actions[bot] Jul 16, 2026
de1e621
fix(security): redact secrets from crash reports and error responses
ding113 Jul 17, 2026
60a8f14
fix(proxy): gate post-terminal side effects on durable SQL commit
ding113 Jul 17, 2026
8351fd9
fix(shutdown): await scheduler quiescence before closing DB and Redis
ding113 Jul 17, 2026
3d9f639
fix(test): resolve unsafe optional chaining flagged by Biome 2.5.4
github-actions[bot] Jul 17, 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
13 changes: 11 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ ENABLE_API_KEY_VACUUM_FILTER="true"

# PostgreSQL 连接池配置(postgres.js)
# 说明:
# - 这些值是“每个应用进程”的连接池上限;k8s 多副本时需要按副本数分摊
# - 默认值:生产环境 20,开发环境 10(可按需覆盖)
# - DB_POOL_MAX 是每个应用进程内 data/control/writer 三类 pool 的连接总预算
# - 默认拆分:生产环境 20 = 15/4/1,开发与测试环境 10 = 7/2/1
# - 每条 pool 另有有界 outstanding admission,满载时以 DB_POOL_ADMISSION_EXCEEDED 快速失败
# - k8s 多副本时仍需按副本数分摊这个总预算
DB_POOL_MAX=20
DB_POOL_IDLE_TIMEOUT=20 # 空闲连接回收(秒)
DB_POOL_CONNECT_TIMEOUT=10 # 建立连接超时(秒)
DB_STATEMENT_TIMEOUT_MS=90000 # 活动 SQL 最长执行时间(毫秒,需低于流式结算 120 秒上限)
DB_LOCK_TIMEOUT_MS=5000 # SQL 等待数据库锁的最长时间(毫秒)

# message_request 写入模式
# - async:异步批量写入(默认,降低 DB 写放大与连接占用)
Expand All @@ -41,6 +45,11 @@ DB_USER=postgres
DB_PASSWORD=your-secure-password_change-me
DB_NAME=claude_code_hub

# Redis 活动命令超时(毫秒)
# 命令 Promise 超时后 5 秒若仍无任何响应进展,客户端会销毁并重建 socket。
# socket timer 仅在存在等待回复的命令时启用,不影响空闲共享连接。
REDIS_COMMAND_TIMEOUT_MS=10000

# 应用配置
APP_PORT=23000
APP_URL= # 应用访问地址(留空自动检测,生产环境建议显式配置)
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ RUN mkdir -p /app/reports

# --report-on-fatalerror / --report-uncaught-exception:在 native 段错误或
# 未捕获异常时写出 JSON 诊断报告(包含原生堆栈、libuv 句柄、JS 堆等)
# --report-exclude-env:诊断报告不得持久化 ADMIN_TOKEN、DSN、Redis、Langfuse
# 与 Provider credentials 等运行时环境变量
# --report-directory:指向 /app/reports 以便挂卷持久化
CMD ["node", "--report-on-fatalerror", "--report-uncaught-exception", "--report-directory=/app/reports", "server.js"]
CMD ["node", "--report-on-fatalerror", "--report-uncaught-exception", "--report-exclude-env", "--report-directory=/app/reports", "server.js"]
4 changes: 3 additions & 1 deletion deploy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ COPY --from=build --chown=node:node /app/.next/standalone ./
COPY --from=build --chown=node:node /app/.next/server ./.next/server
COPY --from=build --chown=node:node /app/.next/static ./.next/static

RUN mkdir -p /app/reports && chown node:node /app/reports

USER node
EXPOSE 3000

CMD ["node", "server.js"]
CMD ["node", "--report-on-fatalerror", "--report-uncaught-exception", "--report-exclude-env", "--report-directory=/app/reports", "server.js"]
2 changes: 1 addition & 1 deletion deploy/k8s/app/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
- name: AUTO_MIGRATE
value: "true"
- name: DB_POOL_MAX
value: "30"
value: "24"
- name: DB_POOL_IDLE_TIMEOUT
value: "20"
- name: DB_POOL_CONNECT_TIMEOUT
Expand Down
Loading