Skip to content

HTTP deadline follow-ups from the #159 review #161

Closed

Description

@chaodu-agent

Non-blocking findings from the review of #159 at head 8b41cca (2 MEDIUM, 4 LOW). Each was re-checked against current main (106f6a0) and still applies.

MEDIUM

  • testSessionResetMidListingStillHonorsTheOverallBudget (Tests/InstanceMCPCoreTests/ToolListPaginationTests.swift) also passes without the fix. Before fix: one overall deadline for listing tools over HTTP (closes #153) #159, the same script returns playwright_timeout at about 1.6 s: the retry gets its own 1.5 s timeout and succeeds, then the next-page check in ToolListPagination.collect throws. That satisfies both XCTAssertEqual(k, "playwright_timeout") and XCTAssertLessThan(..., .seconds(2.3)), so the test cannot tell the fix from the old code. Make only the retried tools/list slow (for example 2 s, so it ends past 2.8 s without the fix), or tighten the elapsed bound to just above the 1.5 s budget.
  • No dedicated test for the total tool cap. testServerProtocolListErrorsDoNotCountAsChildFailures (Tests/InstanceMCPCoreTests/ManagedPlaywrightTests.swift) covers the page cap, repeated cursor and bad cursor, but never drives tools_list_too_many_tools, although ManagedPlaywright.isServerProtocolError lists it. Add a mode that returns more than ToolListPagination.maxTools entries and check that repeated failures leave the transport unlatched with unchanged backoff.

LOW

  • ManagedPlaywright.isServerProtocolError: noteFailure already reduced to noteFailureIfDead() for every class except playwright_timeout, so the branch only makes the intent explicit. The managed protocol-error test would also pass without fix: one overall deadline for listing tools over HTTP (closes #153) #159, so it pins existing behavior rather than a change.
  • ExternalPlaywrightClient: a single-page HTTP server that stalls past the timeout now reports playwright_timeout instead of upstream_timeout, because the per-request timeout equals the budget. This is intended, and PlaywrightBackend.tools() discards the class (try?), so nothing visible changes. Consider noting it in R7.5.4.
  • ToolListPagination.collect still measures its overall deadline with Date() (wall clock). This predates fix: one overall deadline for listing tools over HTTP (closes #153) #159 and only affects stdio. Move it to ContinuousClock.
  • ExternalPlaywrightClient.listTools still calls collect(deadline: .infinity), which leaves a dead wall-clock computation in the HTTP path. A collect overload without a deadline would be clearer.

Follow-up to #159 (closed #153).

Activity

  1. added
    enhancementNew feature or request
    p3Priority 3: RFC, roadmap, nice-to-have or deferred
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestp3Priority 3: RFC, roadmap, nice-to-have or deferred

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions