Commit graph

10 commits

Author SHA1 Message Date
aloktripathi1
7ba82429ca test(openai): don't hard-require optional aiohttp in fail-open black-box tests
aiohttp is only declared under the optional `async` extra, not the dev
dependency group, so the black-box repros failed with ModuleNotFoundError
under the default `uv sync --dev` setup before exercising anything.

- Async repro now uses pytest.importorskip("aiohttp"), skipping cleanly
  when the extra is absent (it exercises the aiohttp code path).
- Sync repro forces the requests fallback by making `import aiohttp` fail
  via sys.modules, so it runs in the default dev setup and actually covers
  the requests path production uses when aiohttp is not installed.

Verified both ways: with aiohttp -> 35 passed, 11 skipped; without aiohttp
-> 34 passed, 12 skipped (async repro skips, sync repro passes via requests).
2026-07-13 20:39:26 +05:30
aloktripathi1
cbaff205ee fix(openai): memory search fails open instead of crashing chat completions
SupermemoryOpenAIWrapper wraps client.chat.completions.create(). With
default configuration, every call triggers a network request to
api.supermemory.ai via add_system_prompt() -> supermemory_profile_search().
That call chain had no error handling, so any Supermemory outage,
timeout, or network hiccup crashed the entire chat completion, even
though the underlying LLM call was completely unaffected.

The memory-write path (add_memory_tool) already failed open correctly
in this same file; the memory-search path (which runs on every call
by default) had no equivalent protection. The original test for this
scenario even documented the intended behavior in its own comment
('Should not raise exception, should fall back gracefully') while its
assertion checked the opposite.

Both async and sync paths now catch SupermemoryNetworkError and
SupermemoryAPIError (warn-level log) plus any other exception
(error-level log), and fall through to the original unmodified
messages instead of propagating the failure.

11 new tests covering both paths: expected Supermemory errors, an
unexpected exception, the happy-path regression (memory injection
still works normally), and black-box repros matching the filed issue.
35 passed, 11 skipped (pre-existing, gated on a live API key).
2026-07-13 20:08:27 +05:30
icyzh
f833843760
fix(openai-sdk): use AsyncSupermemory and correct client API calls (#1063) 2026-06-17 09:05:11 -07:00
devteamaegis
55445bff1d
fix(openai-sdk): don't inject empty system prompt when no memories are found (#999)
Co-authored-by: Ishaan Samantray <ishaansamantray@Ishaans-MacBook-Pro.local>
2026-05-26 22:28:35 +05:30
sreedharsreeram
0104a2572c update open ai python sdk (#879) 2026-04-25 01:43:14 +00:00
nexxeln
ea9bf13d31 add openai middleware functionality for python sdk (#546)
add openai middleware functionality

fix critical type errors and linting issues

update readme with middleware documentation
2025-11-11 02:16:34 +00:00
Dhravya Shah
4d6fd37c99 fix: model names 2025-10-03 02:41:49 -07:00
CodeWithShreyans
101f3817bd
feat: openai python sdk (#409) 2025-09-03 21:48:36 +00:00
CodeWithShreyans
cae7051d1a
feat: new tools package (#407) 2025-09-02 23:11:19 +00:00
CodeWithShreyans
3a0e264b7e
feat: openai js and python sdk utilities (#389)
needs testing
2025-08-27 23:34:49 +00:00