feat(gateway): configure model list read limit

Add gateway.models_list_read_max_bytes with the existing 8 MiB behavior as its default, and apply it consistently to generic, Codex, and Antigravity model-list reads.

Read one sentinel byte for Codex manifests so oversized responses return an explicit bounded upstream error instead of malformed JSON.
This commit is contained in:
Xiangzhe
2026-08-24 14:20:18 +08:00
parent 7075ae0d82
commit 847c0c4526
14 changed files with 240 additions and 31 deletions
+3
View File
@@ -235,6 +235,9 @@ gateway:
# Max bytes to read for non-stream upstream responses (default: 8MB)
# 非流式上游响应体读取上限(默认 8MB)
upstream_response_read_max_bytes: 8388608
# Max bytes to read for upstream model-list responses (default: 8MB)
# 上游模型列表响应体读取上限(默认 8MB)
models_list_read_max_bytes: 8388608
# Max bytes to read for proxy probe responses (default: 1MB)
# 代理探测响应体读取上限(默认 1MB)
proxy_probe_response_read_max_bytes: 1048576