Fix ty ignore syntax in OpenAPI provider#3253
Conversation
Test Failure AnalysisSummary: A pre-existing flaky test unrelated to this PR failed on Python 3.10/ubuntu. This PR's single-line change (replacing a Root Cause: Suggested Solution: The test in
The cleanest fix is option 1 or 2. Option 1 is a one-line change to the test fixture parameters. Detailed AnalysisFailing test: Token bucket math showing the race condition: With
Expected sequence: But Why only Python 3.10/ubuntu? This PR is unrelated — it only changes one line in Related Files
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ccb52f07f7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| except (ToolError, McpError): | ||
| hit_limit = True |
There was a problem hiding this comment.
Verify exception indicates rate limiting
This loop treats any ToolError or McpError as success, so the test can pass even when rate limiting is not what failed first (for example, a transport/JSON-RPC error or another tool-call failure). That weakens the integration check and can hide regressions in the limiter itself, because the assertion only checks that some exception occurred. Narrow the assertion to rate-limit-specific error details (message/code) so the test only passes when throttling is actually triggered.
Useful? React with 👍 / 👎.
The
type: ignore[arg-type]comment onSchemaPath.from_dict()uses mypy syntax, which ty doesn't recognize as a targeted suppression. Newer ty flags it as an unused blanket ignore, breaking the upgrade checks workflow (#3214). Replaced withty: ignore[invalid-argument-type].Also fixes two flaky tests that only fail on Python 3.10 / ubuntu CI runners. The rate limiting test was counting exact MCP protocol messages to predict burst exhaustion, but the SDK sends a variable number of internal messages (and the refill rate was high enough that tokens leaked back in). Now uses near-zero refill with a loop-until-limited approach. The ping interval test had a 150ms window for 50ms-interval pings — too tight for slow runners — widened to 350ms.
Closes #3214