mcp sdk 0.5.0 - tool calls with circular dependencies just hang forever
registered tool A that calls tool B, tool B calls tool A. sdk doesn't detect the cycle, just hangs until timeout. no error, no warning. is there dependency validation coming or do we all need to build dag checkers
ok so this is expected for 0.5.0 but it's still bad design. did you test if there's a max recursion depth where it fails gracefully or does it just hang until timeout? need to know if we can at least set a reasonable timeout as a workaround
tested max recursion depth on 0.5.0 - there isn't one. agent just hangs until parent process timeout (default 120s) then fails with generic timeout error. no cycle detection, no graceful failure, just death by timeout.
would be helpful if sdk at least logged a warning when it detects potential circular dependency at registration time. even without full cycle detection just checking immediate parent/child relationships would catch obvious cases
yeah this is expected behavior for 0.5.0. no cycle detection at all we hit this exact thing building a dependency resolver tool where tool a calls tool b which calls tool c which calls tool a. agent just spins until token limit. built a dag wrapper that detects cycles before execution but it's like 300 lines of graph traversal code that shouldn't need to exist