Spaces:
Paused
Paused
icebear0828 Claude Opus 4.6 commited on
Commit ·
ffcac87
1
Parent(s): 6a579f0
fix: remove wall-clock timeout from streaming SSE to prevent thinking chain cutoff
Browse filesThe 60s --max-time timeout was killing curl mid-stream during long
reasoning/thinking outputs (30-120+ seconds). Streaming requests now
rely on header timeout + AbortSignal for protection instead.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- CHANGELOG.md +4 -0
- src/proxy/codex-api.ts +2 -3
CHANGELOG.md
CHANGED
|
@@ -6,6 +6,10 @@
|
|
| 6 |
|
| 7 |
## [Unreleased]
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
### Added
|
| 10 |
|
| 11 |
- 代理池功能:支持为不同账号配置不同的上游代理,实现 IP 多样化和风险隔离
|
|
|
|
| 6 |
|
| 7 |
## [Unreleased]
|
| 8 |
|
| 9 |
+
### Fixed
|
| 10 |
+
|
| 11 |
+
- 流式 SSE 请求不再设置 `--max-time` 墙钟超时,修复思考链(reasoning/thinking)在 60 秒处中断的问题;连接保护由 header 超时 + AbortSignal 提供,非流式请求(models、usage)超时不受影响
|
| 12 |
+
|
| 13 |
### Added
|
| 14 |
|
| 15 |
- 代理池功能:支持为不同账号配置不同的上游代理,实现 IP 多样化和风险隔离
|
src/proxy/codex-api.ts
CHANGED
|
@@ -247,11 +247,10 @@ export class CodexApi {
|
|
| 247 |
);
|
| 248 |
headers["Accept"] = "text/event-stream";
|
| 249 |
|
| 250 |
-
|
| 251 |
-
|
| 252 |
let transportRes;
|
| 253 |
try {
|
| 254 |
-
transportRes = await transport.post(url, headers, JSON.stringify(request), signal,
|
| 255 |
} catch (err) {
|
| 256 |
const msg = err instanceof Error ? err.message : String(err);
|
| 257 |
throw new CodexApiError(0, msg);
|
|
|
|
| 247 |
);
|
| 248 |
headers["Accept"] = "text/event-stream";
|
| 249 |
|
| 250 |
+
// No wall-clock timeout for streaming SSE — header timeout + AbortSignal provide protection
|
|
|
|
| 251 |
let transportRes;
|
| 252 |
try {
|
| 253 |
+
transportRes = await transport.post(url, headers, JSON.stringify(request), signal, undefined, this.proxyUrl);
|
| 254 |
} catch (err) {
|
| 255 |
const msg = err instanceof Error ? err.message : String(err);
|
| 256 |
throw new CodexApiError(0, msg);
|