Skip to content

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