Summary
SuggestionStore invokes GitHubIssueReporter.TryCreateIssueAsync(r, version).GetAwaiter().GetResult() (McpToolHandlers.cs:1933) inside a synchronous lambda callback. The HTTP call to the GitHub API blocks the calling thread for the round-trip duration, and any exception bubbles as an AggregateException rather than the original cause. In the MCP server context, this can block one of the limited stdio handler threads on a multi-second network call, stalling other unrelated tool requests.
Where
src/CodeIndex/Mcp/McpToolHandlers.cs:1933 (TryCreateIssueAsync sync wait)
Suggested approach
(1) Refactor the surrounding lambda to be async so the call becomes await GitHubIssueReporter.TryCreateIssueAsync(r, version) with ConfigureAwait(false). (2) For exception handling, catch the original HttpRequestException / OperationCanceledException directly rather than unwrapping AggregateException. (3) If the suggestion submit must remain fire-and-forget for UX reasons, dispatch via Task.Run(async () => ...) with a try/catch that logs failures, never blocks. (4) Add a regression test that mocks a slow GitHub response and asserts the MCP server continues servicing other requests during the wait. (5) Cross-link with #1418 (CancellationToken propagation) so a client cancel during the submit aborts the HTTP call.
Summary
SuggestionStoreinvokesGitHubIssueReporter.TryCreateIssueAsync(r, version).GetAwaiter().GetResult()(McpToolHandlers.cs:1933) inside a synchronous lambda callback. The HTTP call to the GitHub API blocks the calling thread for the round-trip duration, and any exception bubbles as anAggregateExceptionrather than the original cause. In the MCP server context, this can block one of the limited stdio handler threads on a multi-second network call, stalling other unrelated tool requests.Where
src/CodeIndex/Mcp/McpToolHandlers.cs:1933(TryCreateIssueAsyncsync wait)Suggested approach
(1) Refactor the surrounding lambda to be
asyncso the call becomesawait GitHubIssueReporter.TryCreateIssueAsync(r, version)withConfigureAwait(false). (2) For exception handling, catch the originalHttpRequestException/OperationCanceledExceptiondirectly rather than unwrappingAggregateException. (3) If the suggestion submit must remain fire-and-forget for UX reasons, dispatch viaTask.Run(async () => ...)with a try/catch that logs failures, never blocks. (4) Add a regression test that mocks a slow GitHub response and asserts the MCP server continues servicing other requests during the wait. (5) Cross-link with #1418 (CancellationToken propagation) so a client cancel during the submit aborts the HTTP call.