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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant