Skip to content

fix: fix nil pointer dereference in ReportTask #19045

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 28, 2025

Conversation

ThomasK33
Copy link
Member

This pull request addresses a bug related to a nil pointer dereference in the task reporting functionality.

Bug Fixes and Error Handling:

  • Updated RegisterTools in mcp.go to skip registering the ReportTask tool in the remote MCP context when a task reporter is not configured, preventing potential nil pointer dereference panics.
  • Added a check in toolsdk.go to ensure task reporting dependencies are available before invoking the reporter, returning an appropriate error if not.

Test Coverage:

  • Added TestReportTaskNilPointerDeref in toolsdk_test.go to verify that the system does not panic when task reporting dependencies are missing and instead returns a clear error message.
  • Added TestReportTaskWithReporter in toolsdk_test.go to validate correct behavior when a task reporter is configured, ensuring the handler processes the request as expected.

@ThomasK33 ThomasK33 changed the title fix: nil pointer dereference in ReportTask fix: fix nil pointer dereference in ReportTask Jul 27, 2025
@ThomasK33 ThomasK33 requested a review from johnstcn July 28, 2025 09:06
Change-Id: I9a9886e004fb377950be523a79a1a51a3c954d5b
Signed-off-by: Thomas Kosiewski <tk@coder.com>
@ThomasK33 ThomasK33 force-pushed the tk/fix-mcp-task-nil-panic branch from 10fb76f to 6d31272 Compare July 28, 2025 09:11
@ThomasK33 ThomasK33 merged commit d159578 into main Jul 28, 2025
31 checks passed
@ThomasK33 ThomasK33 deleted the tk/fix-mcp-task-nil-panic branch July 28, 2025 09:23
@github-actions github-actions bot locked and limited conversation to collaborators Jul 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy