You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(proxy): reserve stream capacity for recovery (#1188)
* fix(proxy): reserve stream capacity for recovery
* fix(proxy): keep reattach streams alive
* fix(proxy): reserve stream capacity for true recovery
* fix(proxy): read stream recovery reserve from env-backed settings
The reserve was read via getattr on the dashboard settings cache result,
which lacks the field, so CODEX_LB_PROXY_ACCOUNT_STREAM_RECOVERY_RESERVE
was dead and the reserve was pinned to the default of 1. Read
get_settings().proxy_account_stream_recovery_reserve instead, and make
the regression test exercise the real env-backed settings with a
non-default value.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* test: add stream recovery reserve to ttft settings stub
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* test: add stream recovery reserve to remaining settings stubs
The service now reads proxy_account_stream_recovery_reserve explicitly
from get_settings(), so every SimpleNamespace stub patched onto the
proxy service module's get_settings needs the field.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Soju06 <qlskssk@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Parallel first turns can consume every account-local stream slot. If an established turn then loses its upstream transport, its continuity-safe reattach competes with new work and can remain stuck even though reserving one existing slot would have let it recover.
4
+
5
+
## What Changes
6
+
7
+
- Reserve one account-local stream slot by default from ordinary first-turn and follow-up selection.
8
+
- Let reattach selection use the full configured account stream cap.
9
+
- Keep the reserve configurable and preserve the hard cap.
10
+
11
+
## Impact
12
+
13
+
New fan-out may reach local backpressure one slot earlier per account. Established responses retain capacity to recover after a transient upstream disconnect.
The proxy MUST reserve the configured number of account-local stream slots from ordinary first-turn and follow-up selection, while allowing reattach work to use the full account stream cap. The default recovery reserve MUST be one slot. The reserve MUST NOT increase the configured hard stream cap.
6
+
7
+
#### Scenario: Fan-out leaves one slot for reattach
8
+
9
+
-**GIVEN** an account stream cap of eight and a recovery reserve of one
10
+
-**AND** seven ordinary streams are active
11
+
-**WHEN** another ordinary stream and a reattach stream compete for capacity
12
+
-**THEN** the ordinary stream receives local account-cap backpressure
13
+
-**AND** the reattach stream may acquire the eighth slot
0 commit comments