Repository navigation
fix: preserve MCP execution errors in SmolAgentsAdapter - #95
Open
Dedale-Project wants to merge 3 commits into
Open
Dedale-Project wants to merge 3 commits into
Dedale-Project wants to merge 3 commits into
Conversation
This branch has not been deployed
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.
An MCP tool returning
isError=TrueandstructuredContent={"results": []}currently looks like a successful empty lookup to SmolAgentsAdapter, and its text error details disappear.Check execution status before extracting any content and raise
MCPToolExecutionErrorin both adapter modes. The exception includes every non-empty text block and structured error details, and retains the full originalCallToolResultfor programmatic inspection. Successful text/JSON responses keep their behavior; valid structured-only responses now return their available payload. Update the server-validation test that previously expected an MCP error to be returned as ordinary text, and document the new exception.Validation: Python 3.12.14 (Linux), MCPAdapt 0.1.20 / main at 538cd85, smolagents 1.26.0, MCP 1.30.0. Reproduced against the published 0.1.20 package and confirmed identical adapter source to the release tag. Thirty offline regression cases pass, including the native Tool call and ToolCallingAgent execution wrapper. Existing smolagents tests plus new regressions and modeling tests: 38 passed, 2 skipped (local SSE and optional audio). Existing subprocess tests used a temporary launcher for
uv run pythonto use the pinned venv rather than resolve other project dependencies. Ruff 0.9.1 checks/format pass. Full multi-framework suite, Windows, and LLM execution were not tested; selected adapter coverage is 75%, not a claim of full-project 95% coverage.Prepared with Codex. Affiliation: Remnant. All reproduction inputs are synthetic.
Fixes #94