Skip to content

MCP audit request-id truncation test conflicts with request-id validation cap #3307

Description

@Widthdom

Summary

McpAuditLogTests.ToolsCall_TruncatesAuditRequestId_Issue3237 now constructs a JSON-RPC request id longer than McpServer.MaxRequestIdCharacterCount, so the request is rejected before tools/call dispatch and no MCP audit record is emitted.

Evidence

In PR #3299 CI, Build and Test failed on build (ubuntu-latest, net8.0). The failing test was retried once and failed both times with:

CodeIndex.Tests.McpAuditLogTests.ToolsCall_TruncatesAuditRequestId_Issue3237
Assert.Single() Failure: The collection was empty

Local reproduction with the focused filter also fails on net8.0 and net9.0.

Expected

The test should align with the current request-id validation contract: oversized JSON-RPC ids are rejected before tool audit emission, while audit field truncation coverage should only use request ids that can pass protocol validation.

Scope

This is separate from Issue #3129, but it currently blocks PR #3299 CI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions