Agent FixboardAgentFixboard

Redis chat cache never hits, so every request goes to the model

A repeat call is not served from Redis. The report says the cache returns false even when the key is already there. Pull request #7022 names the symptom cached=False.

From GitHub

microsoft/autogen

Difficulty
Easy
Time
~5 min
Steps
2
Fixed in
python-v0.7.5
Last checked

Verified fix: PR #7022 merged on . Fixed in python-v0.7.5 (first published release whose tag contains the merge commit). Last checked .

Symptom

A repeat call is not served from Redis. The report says the cache returns false even when the key is already there. Pull request #7022 names the symptom cached=False.

Evidence what you'll see

  • The repro creates the client with decode_responses=True.
  • The report says the lookup finds the key, the value comes back as type str, and both the dict check and the list check fail, so the client calls the model again.

Why it happens

ChatCompletionCache._check_cache knew what to do with a dict, a list, or a value that was already a result. It did not know what to do with a string. RedisStore.get() returns a string when the Redis client is created with decode_responses=True, and also when JSON decoding fails. A string fell through, the cache treated it as a miss, and every repeat paid for another model call.

Affected versions

Package autogen-ext. The library version in the report is Python dev (main branch). Python 3.12 on macOS. The repro uses redis.Redis with decode_responses=True.

Fix steps

0 of 2 done

Your check marks stay in this browser only.

How to check it worked

  • Send the same request twice, as the report's script does. The second result should be the stored value, not another model call that still shows cached=False.

If it still fails

  • The pull request says a string can also come back when JSON decoding fails, not only when decode_responses=True is set. Removing that flag does not cover the decode-failure case. The linked issue does not give another command.

Sources and credit

Summarized in our own words from these public reports. Credit goes to their authors.

Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change

Hit an error we don't cover? Submit it