fix: handle missing arguments in MCP tool calls to prevent GUI crash#7143
Merged
DOsinga merged 1 commit intoblock:mainfrom Feb 13, 2026
Merged
fix: handle missing arguments in MCP tool calls to prevent GUI crash#7143DOsinga merged 1 commit intoblock:mainfrom
DOsinga merged 1 commit intoblock:mainfrom
Conversation
When a tool request arrives without an arguments field (valid for no-arg
tools like MATLAB toolbox detection), the desktop renderer crashes with
'Cannot convert undefined or null to object' because Object.entries()
is called on undefined.
Add nullish coalescing default (?? {}) so args safely falls back to an
empty object.
Fixes block#7116
Signed-off-by: 青雲 <137844255@qq.com>
DOsinga
approved these changes
Feb 12, 2026
Collaborator
DOsinga
left a comment
There was a problem hiding this comment.
oof this code could do with some cleanup, but thanks for the fix!
Collaborator
|
can you take care of the DCO thing so we can merge? |
1a021bd to
491c8a0
Compare
Contributor
Author
|
Done! I've amended the commit with the DCO sign-off. Should be good to merge now. 🙏 |
Collaborator
|
thank you! |
katzdave
added a commit
that referenced
this pull request
Feb 13, 2026
…ntext * 'main' of github.com:block/goose: feat: add onFallbackRequest handler to McpAppRenderer (#7208) feat: add streaming support for Claude Code CLI provider (#6833) fix: The detected filetype is PLAIN_TEXT, but the provided filetype was HTML (#6885) Add prompts (#7212) Add testing instructions for speech to text (#7185) Diagnostic files copying (#7209) fix: allow concurrent tool execution within the same MCP extension (#7202) fix: handle missing arguments in MCP tool calls to prevent GUI crash (#7143) Filter Apps page to only show standalone Goose Apps (#6811) opt: use static for Regex (#7205) nit: show dir in title, and less... jank (#7138) feat(gemini-cli): use stream-json output and re-use session (#7118) chore(deps): bump qs from 6.14.1 to 6.14.2 in /documentation (#7191) Switch jsonwebtoken to use aws-lc-rs (already used by rustls) (#7189) chore(deps): bump qs from 6.14.1 to 6.14.2 in /evals/open-model-gym/mcp-harness (#7184) Add SLSA build provenance attestations to release workflows (#7097) fix save and run recipe not working (#7186) Upgraded npm packages for latest security updates (#7183) docs: reasoning effort levels for Codex provider (#6798)
michaelneale
added a commit
that referenced
this pull request
Feb 16, 2026
* origin/main: (42 commits) fix: use dynamic port for Tetrate auth callback server (#7228) docs: removing LLM Usage admonitions (#7227) feat(otel): respect standard OTel env vars for exporter selection (#7144) fix: fork session (#7219) Bump version numbers for 1.24.0 release (#7214) Move platform extensions into their own folder (#7210) fix: ignore deprecated skills extension (#7139) Add a goosed over HTTP integration test, and test the developer tool PATH (#7178) feat: add onFallbackRequest handler to McpAppRenderer (#7208) feat: add streaming support for Claude Code CLI provider (#6833) fix: The detected filetype is PLAIN_TEXT, but the provided filetype was HTML (#6885) Add prompts (#7212) Add testing instructions for speech to text (#7185) Diagnostic files copying (#7209) fix: allow concurrent tool execution within the same MCP extension (#7202) fix: handle missing arguments in MCP tool calls to prevent GUI crash (#7143) Filter Apps page to only show standalone Goose Apps (#6811) opt: use static for Regex (#7205) nit: show dir in title, and less... jank (#7138) feat(gemini-cli): use stream-json output and re-use session (#7118) ...
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.
Summary
When a tool request arrives without an
argumentsfield (valid for no-arg tools like MATLAB toolbox detection), the desktop renderer crashes with:Root Cause
In
ui/desktop/src/components/ToolCallWithResponse.tsx, thegetToolDescription()function caststoolCall.argumentsdirectly without a fallback:When
argumentsisundefined(valid per MCP spec for no-arg tools), the subsequentObject.entries(args)call in the default branch throws.Fix
Add nullish coalescing default so
argssafely falls back to an empty object:This is consistent with how the same file already handles
argumentselsewhere (e.g., line 469 uses optional chaining, line 815 uses&&guard).Testing
matlab__detect_matlab_toolboxes) now render without crashingargs.*properties which safely returnundefinedon an empty object)Fixes #7116