Repository navigation
Conversation
…org#206) Signed-off-by: Yshuro <yshuro1080@gmail.com>
Yshuro
force-pushed
the
fix/issue-206
branch
from
November 23, 2026 09:05
837aab3 to
109513c
Compare
Owner
|
@Yshuro thank you for this. The same crash is fixed in 4.1.1, a bit more widely (an empty request body is accepted everywhere, not only in this one tool), so I'm closing this pull request. Your fix is credited on the community page. Much appreciated, and pull requests are always welcome. |
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.
What does this change?
decodeJSONby checkingif r.Body == nil { return io.EOF }before callingdefer r.Body.Close().planSearchNowforseries_idstargets to pass an empty JSON bodymap[string]any{}when calling/api/series/{id}/search-now.respond_internal_test.goandmcp_test.go.CHANGELOG.mdunder[Unreleased].Why?
Fixes #206
When the MCP tool
search_nowis called withseries_idsandconfirm: true, it calls/api/series/{id}/search-nowwith a nil body. InhandleSeriesSearchNow,decodeJSON(r, &req)is called; sincer.Bodywasnil,defer r.Body.Close()panicked withruntime error: invalid memory address or nil pointer dereference.How did you test it?
go test -v ./internal/api -run "TestMCPAddTitles|TestDecodeJSONNilBody": both pass cleanly.gofmt -l .(no output).go vet ./internal/api(clean).go run ./tools/docgen -checkandgo run ./tools/msgextract -checkpass.Checklist
go test ./...passes andgofmt -l .prints nothingnpm run lint,npm testandnpm run buildpass inweb/docs/updated, and a line added toCHANGELOG.mdunder "Unreleased"go run ./tools/docgenand committed the result