Skip to content

fix(tools): repair openai middleware drift#1304

Draft
vorflux[bot] wants to merge 2 commits into
mainfrom
vorflux/fix-openai-tools-middleware
Draft

fix(tools): repair openai middleware drift#1304
vorflux[bot] wants to merge 2 commits into
mainfrom
vorflux/fix-openai-tools-middleware

Conversation

@vorflux

@vorflux vorflux Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Fixes OpenAI middleware drift so the @supermemory/tools/openai wrapper supports explicit Supermemory configuration, fails open on memory retrieval failures, and preserves query-mode search hits.

Changes

  • Add apiKey support to OpenAI middleware and propagate custom baseUrl through profile/conversation calls.
  • Change OpenAI middleware addMemory default to never, update README docs, and bump @supermemory/tools to 2.1.2.
  • Fail open for Chat Completions and Responses API calls when Supermemory retrieval fails.
  • Preserve query-mode search results even when they duplicate profile memories.
  • Add packages/tools/CHANGELOG.md and focused OpenAI middleware regression tests.

Testing

  • Passed: cd packages/tools && npx vitest run test/openai-middleware.unit.test.ts --testTimeout 100000 — 6 tests passed.
  • Passed: temporary live API smoke with configured SUPERMEMORY_API_KEY against /v4/profile and /v4/conversations through the OpenAI middleware — 1 test passed; temporary file removed.
  • Passed: cd packages/tools && cp package.json /tmp/supermemory-tools-package.json && rm -rf /tmp/openai-tools-build && npx tsdown src/openai/index.ts --format esm --dts false --out-dir /tmp/openai-tools-build; status=$?; cp /tmp/supermemory-tools-package.json package.json; exit $status — build completed; existing tsdown config warning about define remains.
  • Passed: git diff --check.
  • Note: npx tsc --noEmit remains blocked by existing unrelated package/test type errors, including src/openai/tools.ts(336,5) SearchResults mismatch.

Session Details

  • Session: View Session
  • Requested by: supermemory
  • Address comments on this PR. Add (aside) to your comment to have me ignore it.

@vorflux
vorflux Bot marked this pull request as draft July 18, 2026 04:26
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 18, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
supermemory-mcp c95c908 Jul 18 2026, 04:29 AM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 18, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
supermemory-app c95c908 Commit Preview URL

Branch Preview URL
Jul 18 2026, 04:31 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants