Skip to content

fix(gateway): fail closed on compression state probe errors - #63422

Merged
kshitijk4poor merged 1 commit into
NousResearch:mainfrom
necoweb3:fix/compression-inflight-check-fail-closed
Jul 14, 2026
Merged

fix(gateway): fail closed on compression state probe errors#63422
kshitijk4poor merged 1 commit into
NousResearch:mainfrom
necoweb3:fix/compression-inflight-check-fail-closed

Conversation

@necoweb3

Copy link
Copy Markdown
Contributor

Summary

Fail closed when the gateway cannot verify whether context compression is currently in flight for a busy session.

Problem

GatewayRunner._session_has_compression_in_flight() protects the #56391 path: when a user sends a follow-up while context compression is rotating the session, busy_input_mode='interrupt' must be demoted to queue semantics. Otherwise the gateway can interrupt/start work against the pre-rotation parent session and fork orphaned compression siblings.

The helper currently returns False for all exceptions while checking the session routing entry or reading get_compression_lock_holder(). That makes transient store/SQLite probe failures fail open: the gateway treats compression as absent and allows the interrupt path to proceed.

Fix

Split structural/version-skew absence from real probe failures:

Tests

python -m pytest tests/gateway/test_compression_in_flight_check.py tests/gateway/test_compression_interrupt_demotion_56391.py tests/gateway/test_priority_path_compression_demotion_56391.py -q --timeout-method=thread
18 passed

@alt-glitch alt-glitch added type/bug Something isn't working P1 High — major feature broken, no workaround comp/gateway Gateway runner, session dispatch, delivery sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Jul 12, 2026
@kshitijk4poor
kshitijk4poor merged commit fd461b5 into NousResearch:main Jul 14, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P1 High — major feature broken, no workaround sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants