Skip to content

fix(cli): bound Gateway RPC response waits - #1515

Open
ptterjgf wants to merge 1 commit into
TokenRhythm:mainfrom
ptterjgf:fix/issue-1507-gateway-rpc-timeouts
Open

fix(cli): bound Gateway RPC response waits#1515
ptterjgf wants to merge 1 commit into
TokenRhythm:mainfrom
ptterjgf:fix/issue-1507-gateway-rpc-timeouts

Conversation

@ptterjgf

Copy link
Copy Markdown

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.
  • Gateway client / CLI RPC / chat runtime regression set — 91 passed.
  • PYTHONUTF8=1 uv run pytest tests/test_ci/test_migration_v011.py -q — 4 passed.
  • Full-suite diagnostics reached 1,487 passed / 66 skipped before the Windows default GBK locale made yoyo decode a UTF-8 migration incorrectly. With UTF-8 mode, tests/test_ci reached 352 passed / 3 skipped before the host-only requirement for native Git Bash stopped test_pr_change_selection_uses_merge_base_and_ignores_base_only_changes. Neither blocker touches this change.

Build:

  • Web UI typecheck, architecture guards, Vite build, and 397-file artifact verification passed. The automation host blocked the final recursive staging write; after staging the already verified bytes, node scripts/stage-dist.mjs --check passed.
  • 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

  • Links point to existing repository files or stable external pages.
  • Code fences and Markdown tables render correctly on GitHub.
  • Examples avoid real secrets, local private paths, and private transcripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GatewayClient RPCs have no response timeout: a silent gateway hangs the chat forever and deadlocks all subsequent turns

1 participant