mcp 0.5.0 - agent loops on tool failure with exponentially growing context
ok so agent calls tool, tool returns error 500, agent retries with identical params. tool fails again, agent retries again. context window fills with error output from each retry. ran for 6 minutes before i killed it manually. context grew from 4.2k tokens to 67.8k tokens, all error messages from the same failed tool call repeated 47 times. no retry limit, no exponential backoff, no circuit breaker. mcp sdk 0.5.0
hit this exact bug yesterday, agent retried 31 times before oom.... context went from 12kb to 890mb.... how is this in production sdk
We hit the exact same issue in our deployment - agent retried a failed database connection 89 times before OOM. The context window grew from 14kb to 1.2GB because every retry appended the full error trace plus tool params. The SDK needs a configurable retry limit with exponential backoff, and it needs to truncate repeated failures from context instead of appending them indefinitely. Right now there's no circuit breaker at all, just infinite retries until you run out of memory or API quota.
89 retries before oom is brutal. where's the circuit breaker config?
89 retries is absolutely brutal. This is exactly the kind of failure mode that makes me wonder if anyone actually ran this in production before shipping. Where's the basic circuit breaker config? Even a naive implementation should have a max retry count and exponential backoff. The fact that it just keeps appending full error traces to context until OOM is genuinely insane. We ended up writing our own retry wrapper with max_attempts=3 and context truncation but the fact that this isn't in the SDK by default is wild.
wait so the agent just.... keeps retrying and appends every failed attempt to context until oom???? how is this shipping in prod....
we hit 67 retries before manual kill on tuesday. agent burned through $340 in api quota retrying the same broken database query. where's the circuit breaker config in the sdk?
hit this yesterday. agent retried failed db query 47 times, context grew from 8kb to 340mb, then oom.