Skip to content

[BUG] Fix server stability: JSON serialization, KeyboardInterrupt, & tool input validations#415

Closed
SHIVANSH-ux-ys wants to merge 4 commits intosktime:mainfrom
SHIVANSH-ux-ys:esoc-bug-fixes
Closed

[BUG] Fix server stability: JSON serialization, KeyboardInterrupt, & tool input validations#415
SHIVANSH-ux-ys wants to merge 4 commits intosktime:mainfrom
SHIVANSH-ux-ys:esoc-bug-fixes

Conversation

@SHIVANSH-ux-ys
Copy link
Copy Markdown

@SHIVANSH-ux-ys SHIVANSH-ux-ys commented Apr 30, 2026

Reference Issues/PRs

Fixes #401
Fixes #394
Fixes #410
Fixes #373
Fixes #335
Fixes #249
Fixes #407
Fixes #408
Fixes #416 (Note: Overlaps with PR #417 by @biru-codeastromer, happy to defer to their implementation)
Fixes #405
Fixes #400
Fixes #390 (Note: Overlaps with PR #391 by @biru-codeastromer, happy to defer to their implementation)

What does this implement/fix? Explain your changes.

This PR implements a series of critical stability improvements and bug fixes for the sktime-mcp server to ensure smoother agentic workflows:

  1. JSON Serialization ([BUG] numpy.float64 values in prediction results cause JSON serialization failure #401): Fixed an issue where pandas.Series.to_dict() leaked non-serializable numpy.float64 values into tool outputs. Implemented type casting to native Python float in executor.py so standard json.dumps() works without crashing.
  2. Graceful Shutdown ([BUG]Server crashes with traceback on Ctrl+C #394): The server previously crashed with a messy traceback upon Ctrl+C. Wrapped the main() async loop in server.py with a KeyboardInterrupt catch for clean exits.
  3. Docs Migration ([BUG]Remove all references of mkdocs and shift everything to sphinx of readthedocs. #410): Removed outdated mkdocs build references from dev-guide.md and updated instructions to reflect the new Sphinx/ReadTheDocs pipeline.
  4. Tool Input Validation (describe_estimator_tool and search_estimators_tool do not validate input types — non-string inputs cause unhandled exceptions[BUG] #373 & [BUG] cleanup_old_jobs_tool accepts zero/negative max_age_hours silently deletes all jobs #249): Added robust input type checking to describe_estimator_tool and search_estimators_tool to prevent unhandled exceptions on non-string inputs. Also added positive-integer validation to cleanup_old_jobs_tool to prevent negative inputs from wiping all jobs.
  5. Docstring Context ([BUG] Hardcoded 500-character docstring truncation limits LLM reasoning #335): Removed the hardcoded 500-character truncation limit in describe_estimator so that LLMs receive the full estimator context for better reasoning.

Does your contribution introduce a new dependency? If yes, which one?

No new dependencies are introduced.

What should a reviewer concentrate their feedback on?

Reviewers can verify that the type-casting logic in executor.py properly covers all pandas-to-dict prediction edge cases.

Did you add any tests for the change?

No formal pytest cases were added, but local validation scripts were successfully run against executor.py and json.dumps to verify the serialization fix natively handles all numpy types.
6. RangeIndex Formatting Crash (Fixes #390): Fixed an internal crash where auto_format_on_load would fail with an AttributeError when formatting simple RangeIndex datasets without a datetime frequency.

@biru-codeastromer
Copy link
Copy Markdown
Contributor

It looks like some of the issues you worked on already had linked PRs. It might help to check for existing contributions before starting, so effort isn’t duplicated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment