Fix release-readiness bugs: restore truncated history + long-run pace, polish errors#8
Open
darshjoshi wants to merge 3 commits into
Open
Fix release-readiness bugs: restore truncated history + long-run pace, polish errors#8darshjoshi wants to merge 3 commits into
darshjoshi wants to merge 3 commits into
Conversation
…, polish errors Public-release audit fixes (all verified against real F1 data): HIGH (broken features) - get_historical_results: paginate Jolpica (it caps limit at 100) and merge results by round so season queries return full seasons (2008: 2 -> 18 races), not ~2 - analyze_long_run_pace: fix bool(pd.NaT)==True guard that rejected every lap, so it now finds long runs instead of always returning "No long runs found" MEDIUM (silent-wrong / raw-error UX) - get_lap_times: return "driver not found" for bad codes instead of all 22 drivers - get_live_weather: add is_live guard so off-session returns "no live session" instead of stale last-session weather - _get_json: translate static-archive 403/404 into a friendly message (no raw URL) - get_circuit_info: validate event + route FastF1 errors through _ff1_error LOW / docs - pick_driver -> pick_drivers (5 sites; silence FastF1 FutureWarning) - compare_sector_times: say "equal" at delta 0 instead of "<driver> faster" - clearer auth-setup wording for new users - print startup banner to stderr (stdout is the stdio MCP JSON-RPC channel) - _fetch_live: early-exit off-session on the no-auth path (~3.7s -> ~0.7s) - document the 2022 / partial-2024 static-archive gaps (README + list_seasons) lite/full tool counts unchanged (30/79). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LNQTLY5cddQrbSbdRVrbEd
Follow-up to the release-readiness review (darsh-review on PR #8): - _get_json: split 404 ("not published yet") from 403 ("season not in static archive") so a 404 on a session/feed path no longer misreports a live season as missing (review C1) - _ff1_error: narrow patterns to "has not been loaded" / "No data for this session" so real cache/network failures surface as errors instead of "no data yet, wait" (review PW-01) - _jolpica_races: keep partial results on a mid-pagination network/JSON error (re-raise only if the first page fails); fix overstated docstring bound (C2/C3) - _fetch_live: note the early-exit's SessionStatus/SessionInfo dependency (C4) Verified: lite=30 / full=79 tools; _ff1_error unit cases pass; 2008 still returns 18 races; 2022 still returns the friendly archive message. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LNQTLY5cddQrbSbdRVrbEd
Patch release for the release-readiness fixes (pyproject + server.json kept in sync). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LNQTLY5cddQrbSbdRVrbEd
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.
Public release-readiness fixes
Output of a full pre-release audit of the 79-tool MCP server (every tool exercised; packaging, secret hygiene, and lite/full auto-degrade all verified clean). This PR fixes the issues that audit surfaced. Every fix was verified by running the edited code against real F1 data — before/after below.
HIGH — broken headline tools
get_historical_resultstruncated whole seasons to ~2 races. Root cause: Jolpica capslimitat 100 and paginates the flat result list, so one fetch returned only ~2 races. Now paginates and merges results by round. 2008: 2 → 18 races; 1994 → 16; filtered "2008 monaco" → 1.analyze_long_run_pacealways returned "No long runs found." Root cause:bool(pd.NaT)isTrue, sonot lap.get('PitInTime')rejected every non-pit lap. Fixed withpd.isna(...). Now returns Run 1 (MEDIUM, 17 laps), Run 2 (HARD, 30), Run 3 (HARD, 22).MEDIUM — silent-wrong / raw-error UX
get_lap_times("ZZZ")returned all 22 drivers → now "Driver 'ZZZ' not found."get_live_weathershowed stale last-session weather off-session → now the clean "no live session" message (and ~3.7s → ~0.7s via an early-exit).403 …url…→ friendly message in_get_json.get_circuit_infoleaked a FastF1 internal error → validates the event + routes errors through a shared_ff1_errorhelper.LOW / docs
pick_driver→pick_drivers(5 sites; silences FastF1 FutureWarning)compare_sector_timessays "equal" at Δ 0 instead of " faster"auth_setupwording for new userslist_seasons)Verification
py_compileclean; lite = 30 tools (FASTF1_AVAILABLE False), full = 79 tools — unchanged.Known caveat (not a regression)
get_circuit_infowith an invalid GP no longer leaks an internal error, but can still be slow (~14s) when FastF1's fuzzy matcher maps the bad name to a real-but-dataless event. Truly unmatchable names fail fast.🤖 Generated with Claude Code
https://claude.ai/code/session_01LNQTLY5cddQrbSbdRVrbEd