mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-10-02 02:11:20 +00:00
The Responses middleware always set `instructions` on the forwarded
request, even when the caller never passed one and there were no
memories to inject. `replaceMemoryContext("", "")` returns `""`, so
those requests went out with `instructions: ""`.
Sending the field at all tells the Responses API to drop the
instructions carried over from a `previous_response_id` turn, so an
empty string silently wipes the caller's system prompt mid-conversation
instead of leaving it in place.
The no-input early return in the same function already gets this right —
it spreads `instructions` only when the caller supplied a string. Apply
the same rule to the main path, while still injecting when there are
memories to add.
Adds three regression tests to the existing OpenAI middleware unit
suite, which CI already runs on changes to packages/tools.
|
||
|---|---|---|
| .. | ||
| agent-framework-python | ||
| ai-sdk | ||
| cartesia-sdk-python | ||
| docs-test | ||
| hooks | ||
| lib | ||
| memory-graph | ||
| openai-sdk-python | ||
| pipecat-sdk-python | ||
| tools | ||
| ui | ||
| validation | ||