I run 2 GoModel instances with identical configuration (Postgres, Redis, and no semantic caching):
I suspect the difference is related to how coding agents interact with AI providers. Coding agents typically run in loops and can send many requests in a short time, which may create sudden load. However, GoModel is mainly a middle layer that forwards parameters to providers and returns results, so it shouldn’t need to accumulate that much memory.
This behavior strongly suggests a potential memory leak or an object/lifecycle issue triggered by the coding-agent request pattern.
Please investigate and help identify the cause (memory leak / caching / request lifecycle / concurrency / streaming handling) and propose a fix so memory can be released or bounded under coding-agent workloads.

I run 2 GoModel instances with identical configuration (Postgres, Redis, and no semantic caching):
Instance A (data processing)
Instance B (coding agents)
I suspect the difference is related to how coding agents interact with AI providers. Coding agents typically run in loops and can send many requests in a short time, which may create sudden load. However, GoModel is mainly a middle layer that forwards parameters to providers and returns results, so it shouldn’t need to accumulate that much memory.
This behavior strongly suggests a potential memory leak or an object/lifecycle issue triggered by the coding-agent request pattern.
Please investigate and help identify the cause (memory leak / caching / request lifecycle / concurrency / streaming handling) and propose a fix so memory can be released or bounded under coding-agent workloads.