fix(cli): bound Gateway RPC response waits - #1515
Open
ptterjgf wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope
Scope boundary: Bound CLI Gateway RPC response waits, clean up pending futures on timeout/cancellation/close, and release the subscription lock after an unsubscribe frame is sent but before its response is awaited.
Non-goals: Retrying ambiguous RPCs such as
sessions.send, changing Gateway server behavior, or adding a stream-idle timeout.Branch
Base branch: main
Target exception: N/A
Issue
Linked issue: Fixes #1507
If None, reason: N/A
Release Note
Release note: CLI chat requests now time out cleanly when a connected Gateway stops answering, and a lost unsubscribe response no longer blocks later turns.
Tests
Ruff:
uv run ruff check src tests— passed.Pytest:
uv run pytest tests/test_cli/test_gateway_client_keepalive.py -q— 35 passed.PYTHONUTF8=1 uv run pytest tests/test_ci/test_migration_v011.py -q— 4 passed.tests/test_cireached 352 passed / 3 skipped before the host-only requirement for native Git Bash stoppedtest_pr_change_selection_uses_merge_base_and_ignores_base_only_changes. Neither blocker touches this change.Build:
node scripts/stage-dist.mjs --checkpassed.uv build --wheel— passed (opensquilla-0.5.4-py3-none-any.whl).Regression tests: added
Notes: Covers silent response timeout, cancellation cleanup, clean-close wakeup, late responses, successful follow-up RPCs, RPC error details, and unsubscribe/subscribe ordering without lock starvation.
The default test path remains offline, deterministic, credential-free, and safe for forks.
Maintainer Live Check
Maintainer live check: no
Surface: gateway
Maintainer-only note: No credentialed check is needed; the regression uses an offline response-silent WebSocket double.
Safety
No secrets, local-only artifacts, private prompts/transcripts, channel identifiers, AI session artifacts, non-public fixtures, or
tests/_private/contents are included.Third-Party Origin
Third-party origin: none
Details if non-none: N/A
Documentation Changes