kubeflow / kubeflow/mcp-server

fix: use VALIDATION_ERROR for invalid model ID in estimate_resources

Open
#257 1 comment 0 reactions 1 assignee View on GitHub

@pratik-naik003 is already working on this.

Since Sep 17, 2026.

Dominant language
Python
Stars
44
Forks
54
Avg merge
2d 18h
Merged PRs (30d)
29

Description

Image

Problem

estimate_resources() in kubeflow_mcp/trainer/api/planning.py (line 540-542) returns ErrorCode.SDK_ERROR for invalid model ID formats (e.g., "random gibberish"). It should return VALIDATION_ERROR instead.

AI agents interpret SDK_ERROR as a transient backend failure and retry the same bad input, instead of fixing it.

Other validations in the same function (num_workers, batch_size, quantization) correctly use VALIDATION_ERROR.

Proposed Fix

Modify the error handler at line 531-544 to return VALIDATION_ERROR for format errors and SDK_ERROR for actual API/network failures. Preserve the existing "did you mean" suggestion logic.

Acceptance Criteria

  • Invalid model ID format returns VALIDATION_ERROR, not SDK_ERROR.
  • API/network errors continue returning SDK_ERROR.
  • Focused tests, linting, and full test suite pass.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.