Found while dogfooding the current source with the locally built cdidx.
MCP suggestion metadata sampling currently treats unknown or malformed environment values as enabled/defaulted behavior. For metadata emitted through tool responses, the safer behavior is explicit opt-in or fail-closed semantics.
Evidence:
src/CodeIndex/McpToolHandlers.cs computes suggestion metadata sampling from env-controlled settings.
- Unknown values do not clearly disable sampling or warn with a safe diagnostic.
Suggested fix: require an explicit affirmative value for sampling, treat unknown values as disabled, and report a bounded diagnostic so misconfiguration is visible.
Found while dogfooding the current source with the locally built
cdidx.MCP suggestion metadata sampling currently treats unknown or malformed environment values as enabled/defaulted behavior. For metadata emitted through tool responses, the safer behavior is explicit opt-in or fail-closed semantics.
Evidence:
src/CodeIndex/McpToolHandlers.cscomputes suggestion metadata sampling from env-controlled settings.Suggested fix: require an explicit affirmative value for sampling, treat unknown values as disabled, and report a bounded diagnostic so misconfiguration is visible.