Skip to content

Double-check Redis usage

On !143234 (merged), we added support for using the chat infrastructure for Ai Agents, which include storing messages on Redis. As pointed out in !143234 (comment 1766611717):

Should we store the messages under the same key and rather filter the messages than creating a new key?
The reason I am asking: Is it possible to create an "endless" amount of AI Agents for developers at some point, right?

If so, one evil attacker could create lots of AI Agents and fill up the keys.
The MAX_MESSAGES & expiration is per key. So one could fill up the Redis storage on purpose

See our initial discussion and that we even rolled out a separate redis just for AI actions with a calculated limit on the amount of users that could be supported.

Early calculations of chat usage on Redis are discussed here https://gitlab.com/gitlab-org/gitlab/-/issues/410521#note_1421148196. Considering that limits are set per key, and we store each user/agent chat in its own key, we need to understand how that will impact the infrastructure before we enable the feature flag.

Edited by Eduardo Bonet