Repository navigation
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #52854
Type of change
What does this PR do?
Record an endpoint cooldown after a remote MCP request returns HTTP 429. Later requests to the same endpoint fail locally until
Retry-Afterexpires, including requests from other connections. Accept integer seconds and HTTP dates, with a one-second fallback for missing or invalid values.The original rejection still reaches the caller. Requests are never queued or replayed, so the cooldown cannot automatically repeat a mutating tool call. OAuth requests and unrelated endpoints remain independent. Healthy traffic is not serialized, and auto-negotiation preserves the original probe rejection. Cleanup uses
node:timersso the timer supportsunref()in workerd.How did you verify your code works?
The generic local-server regression
MCP cooldown suppresses repeated initialization after HTTP 429inpackages/core/test/mcp.test.tsobserved two requests before the fix and one after it. The focused cooldown tests passed, including date parsing in non-UTC timezones, connected-client gating, and no replay of rejected tool calls.The actual workerd regression reproduced an
unrefTypeError before the timer fix and now passes under both tested compatibility dates. The final integration run with this fix and the separate discovery-cache fix passed all 139 tests. Core typechecking and the full repository check passed, with all 36 tasks successful and no lint errors. The diff check passed.Reviewers can run the
MCP cooldowntests frompackages/core.Screenshots / recordings
Not applicable. No UI changes.
Checklist