Skip to content

fix(mcp): tx.send() error in embedding guard warm path silently discarded #2313

@bug-ops

Description

@bug-ops

Problem

In EmbeddingAnomalyGuard::check_async(), the result of tx.send(result) in the spawned task is silently discarded (let _ = tx.send(result)). If the receiver is dropped (e.g., McpManager shutdown), errors are swallowed with no log output.

Fix

Replace let _ = tx.send(result) with:

if tx.send(result).is_err() {
    tracing::warn!("embedding guard: result channel closed, receiver dropped");
}

Priority

P3 — cosmetic / observability issue, does not affect security behavior.

Related: PR #2310

Metadata

Metadata

Assignees

Labels

P3Research — medium-high complexityenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions