kubeflow / kubeflow/mcp-server
fix: use VALIDATION_ERROR for invalid model ID in estimate_resources
@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
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, notSDK_ERROR. - API/network errors continue returning
SDK_ERROR. - Focused tests, linting, and full test suite pass.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.