Skip to content

feat: CEP-22 - progress-aware timeouts, transfer watchdog, and default flip#92

Merged
ContextVM-org merged 1 commit into
ContextVM:mainfrom
harsh04044:feat/cep22-pr4-progress-timeouts
Jun 15, 2026
Merged

feat: CEP-22 - progress-aware timeouts, transfer watchdog, and default flip#92
ContextVM-org merged 1 commit into
ContextVM:mainfrom
harsh04044:feat/cep22-pr4-progress-timeouts

Conversation

@harsh04044

Copy link
Copy Markdown

Closes #87

Final PR for CEP-22. Completes the oversized transfer implementation with timeout semantics, the receiver-side watchdog, and flipping the feature on by default.

What's in this PR:

Progress-aware timeout reset - inbound oversized frames (start, chunks, accept) are forwarded as stripped progress notifications to the rmcp service loop, so the requester's idle timer resets on each chunk. Without this, any chunked response longer than the idle timeout would time out mid-transfer even with steady progress. The numeric progressToken type is preserved through the restore path (rmcp's watcher map is type-exact, Number(5) ≠ String("5")).

Per-transfer watchdog - transfer_timeout_ms (default 300s) is now enforced. Both transports sweep remove_expired() on a timer, reaped slots are re-admittable by a fresh transfer. transfer_timeout_ms = 0 disables the watchdog without instant-expiry semantics.

Consumer helper - PeerRequestOptionsExt::call_tool_with_options + progress_aware_options(idle, max_total) in src/rmcp_transport/progress.rs. Without this, plain call_tool runs with no_options() - no timeout at all. Defaults: 60s idle (matches the TS SDK's default request timeout), 300s max-total (mirrors the receiver watchdog's transfer_timeout_ms).

Default flip - oversized transfer is enabled by default, matching the TS SDK. Safe because the negotiation gates remain: the server only fragments for peers that advertise support, and the client only fragments token-carrying requests above the threshold.

9 new e2e tests in tests/oversized_timeout_e2e.rs covering idle timeout reset, stalled-transfer expiry, max-total cap, token type preservation, accept forwarding, watchdog reaping (client + server), and default-on roundtrip. 10 conformance tests in tests/conformance_cep22_wire_format.rs asserting the wire format matches the spec (frame shapes, camelCase fields, digest format, progress slots). 562 tests passing.

Note: plain call_tool has no default timeout (rmcp fork behavior, not something rs-sdk controls). For oversized transfers, use call_tool_with_options with progress_aware_options to get idle + max-total timeouts with per-chunk reset.

@harsh04044 harsh04044 changed the title feat: CEP-22 - progress-aware timeouts, transfer watchdog, default fl… feat: CEP-22 - progress-aware timeouts, transfer watchdog, and default flip Jun 14, 2026
@ContextVM-org ContextVM-org merged commit ab06d03 into ContextVM:main Jun 15, 2026
3 checks passed
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.

implement CEP-22 oversized payload transfer

2 participants