supermemory/packages/openai-sdk-python/tests
Ishaan Samantray cef7b3242b fix(openai-sdk): skip system prompt injection when no memories are found
add_system_prompt() modified the message list even when the memory
lookup returned nothing (memories == "").

- If an existing system prompt was present, " \n " (whitespace) was
  appended to its content.
- If no system prompt existed, a new {"role": "system", "content": ""}
  message was prepended.

Both cases pollute the conversation context with empty/whitespace tokens
that waste prompt budget and can confuse models sensitive to blank
system messages.

Fix: return messages unchanged when memories is falsy.
Adds a regression test covering both cases (with and without existing
system prompt).
2026-05-24 09:58:21 -04:00
..
__init__.py feat: openai js and python sdk utilities (#389) 2025-08-27 23:34:49 +00:00
test_middleware.py fix(openai-sdk): skip system prompt injection when no memories are found 2026-05-24 09:58:21 -04:00
test_tools.py fix: model names 2025-10-03 02:41:49 -07:00