Repository navigation
Stop outdated CLIs before submissions create; report upgrades over MCP - #127
Merged
Merged
Conversation
The API only accepts POST /submissions from the latest CLI release (mlperf-endpoints-api#34). submissions create now asks PyPI first and exits before downloading runs or running the checker if a newer release exists (a dry run warns and continues). A 426 from the API is shown as its detail text. The MCP server reports an outdated CLI in its instructions and in tool results instead of discarding the notice. The version comparison now counts every release component, so a fourth-part release (1.4.0.1) is newer than 1.4.0.0, as the API sees it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Companion to mlcommons/mlperf-endpoints-api#34. That PR makes
POST /submissionsreturn 426 to any CLI older than the latest PyPI release. This PR makes the CLI handle that well.Version check before
submissions create. Before downloading any run, the command asks PyPI for the latest release (outdated(fresh=True)).--dry-runonly warns, so the checker can still be run on an old CLI.Clean 426 message.
_http._raise_statusshows the API'sdetail(the required version and upgrade command) instead ofAPI error 426: {"detail": …}.MCP. The server used to strip the CLI's upgrade notice from tool output. Now it reports it:
upgradefield on text-tool results;CliErrormessage.The text tells the model that
create_submissionwill be rejected, and how to upgrade and restart the server (pip, or--refreshfor uvx)._version_check:outdated()andUPGRADE_COMMAND;_is_newernow compares every release component, not just the first three, so1.4.0.1counts as newer than1.4.0.0. That matches the API'spackaging.versioncomparison. Dev builds (1.4.1.dev3+g…) still count as ahead of their base release.Testing
test_version_check.pycovers:outdated()(cache, fresh, fallback, expiry);_raise_statuswith a 426;upgradefield, the failure message and the instructions.~/.cache.pytest: 1707 passed, 1 failed. The failure istest_builder.py::TestRunArchiveLayouts::test_a_separate_accuracy_run_still_wins, which fails onmaintoo.mypy srcis clean.1.3.9.0against the live PyPI (latest1.4.0.0):submissions createstops before downloading;--dry-runwarns and continues;🤖 Generated with Claude Code