Context
The Gateway needs reusable lifecycle semantics for request correlation, timeout, and retries over MQTT without reimplementing contract rules ad hoc.
Scope
Non-Goals
- Does not open MQTT connections.
- Does not execute provider logic.
Technical Specification
GatewaySession.next_attempt() preserves request_id; is_correlated(response) delegates to response/request match logic; registry evicts timed-out sessions deterministically.
Acceptance Criteria
Tests Required
| Test |
Verifies |
test_session_correlates_response |
Response matching works. |
test_next_attempt_preserves_request_id |
Retry invariant. |
test_registry_evicts_timed_out |
Timeout eviction. |
Additional Test Coverage / Edge Cases
Invariants — Do Not Violate
- Gateway request IDs are stable across retries.
Dependencies
Blocked by:
Unblocks:
Contract References
ori-specs/gateway-api/v1.md
- SDK gateway models
Priority
post-poc
Suggested Labels
ready, post-poc
Context
The Gateway needs reusable lifecycle semantics for request correlation, timeout, and retries over MQTT without reimplementing contract rules ad hoc.
Scope
ori_sdk/gateway_session.py.GatewaySession,GatewaySessionError, andActiveSessionRegistry.Non-Goals
Technical Specification
GatewaySession.next_attempt()preservesrequest_id;is_correlated(response)delegates to response/request match logic; registry evicts timed-out sessions deterministically.Acceptance Criteria
pytest,mypy, andruffpass.Tests Required
test_session_correlates_responsetest_next_attempt_preserves_request_idtest_registry_evicts_timed_outAdditional Test Coverage / Edge Cases
request_idacross all attempts.Invariants — Do Not Violate
Dependencies
Blocked by:
Unblocks:
Contract References
ori-specs/gateway-api/v1.mdPriority
post-pocSuggested Labels
ready,post-poc