Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 9, 2026

The addExpectedResponse and removeExpectedResponse methods in SessionService were delegating to opposite transport methods, breaking the rate-limiter's expected-response accounting.

Changes:

  • Fixed addExpectedResponse to call transport.addExpectedResponse (was calling removeExpectedResponse)
  • Fixed removeExpectedResponse to call transport.removeExpectedResponse (was calling addExpectedResponse)

Impact:
Without this fix, sending requests would decrement the expected-response counter and completing requests would increment it, causing legitimate responses to be rate-limited and the counter to grow unbounded.

// Before (incorrect)
private addExpectedResponse(socketAddr: Multiaddr): void {
  this.transport.removeExpectedResponse?.(multiaddrToObject(socketAddr).host);
}

// After (correct)
private addExpectedResponse(socketAddr: Multiaddr): void {
  this.transport.addExpectedResponse?.(multiaddrToObject(socketAddr).host);
}

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: wemeetagain <1348242+wemeetagain@users.noreply.github.com>
Copilot AI changed the title [WIP] Update refresh dependencies based on review feedback Fix swapped transport method calls in SessionService Feb 9, 2026
Copilot AI requested a review from wemeetagain February 9, 2026 22:04
@wemeetagain wemeetagain marked this pull request as ready for review February 9, 2026 22:08
@wemeetagain wemeetagain requested a review from a team as a code owner February 9, 2026 22:08
@wemeetagain wemeetagain merged commit 25d50d5 into cayman/refresh Feb 9, 2026
@wemeetagain wemeetagain deleted the copilot/sub-pr-324-yet-again branch February 9, 2026 22:08
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.

2 participants