Skip to content

refactor(providers): extract OpenAI transport into shared module (#371)#462

Merged
rohitg00 merged 3 commits into
mainfrom
refactor/371-openai-shared-transport
May 18, 2026
Merged

refactor(providers): extract OpenAI transport into shared module (#371)#462
rohitg00 merged 3 commits into
mainfrom
refactor/371-openai-shared-transport

Conversation

@rohitg00
Copy link
Copy Markdown
Owner

@rohitg00 rohitg00 commented May 17, 2026

Closes #371. Closes #199 (which #371 supersedes).

Problem

OpenAIProvider (LLM, src/providers/openai.ts) and OpenAIEmbeddingProvider (embedding, src/providers/embedding/openai.ts) both speak the OpenAI wire shape over POST /v1/chat/completions and POST /v1/embeddings — and both need to swap to the Azure shape when OPENAI_BASE_URL lands at a *.openai.azure.com resource (api-key header instead of Authorization: Bearer, api-version query param, no /v1/ prefix because the deployment is already in the URL).

Until now only the LLM provider knew about Azure. The embedding provider hardcoded /v1/embeddings + Bearer auth, so any user pointing OPENAI_BASE_URL at an Azure resource saw their LLM calls route correctly while embedding calls 404'd / 401'd. This was the latent bug behind the #371 ask.

Approach (diverges from issue body)

The issue proposed merging both classes into one that implements MemoryProvider + EmbeddingProvider. I picked a shared-transport module instead because:

  • The existing factory at src/providers/index.ts dispatches LLM and embedding paths through independent detection functions (detectProvider vs detectEmbeddingProvider). Merging the classes would force constructors to coordinate detection across two config surfaces — net code-complexity gain, not loss.
  • Users running LLM on one OpenAI-compat endpoint (e.g. DeepSeek) and embeddings on another (e.g. local Ollama) need two distinct base URLs, which a one-class merge can't model cleanly.
  • Shared transport delivers the DRY win the issue is really about (one set of Azure rules, one auth header pattern, one URL builder), plus the Azure-on-embeddings parity gain — without the architectural cost.

New: src/providers/_openai-shared.ts

detectAzure(baseUrl)        // *.openai.azure.com host check
buildChatUrl(...)           // /v1/chat/completions OR Azure /chat/completions?api-version=...
buildEmbeddingUrl(...)      // /v1/embeddings OR Azure /embeddings?api-version=...
buildAuthHeaders(key, az)   // Authorization: Bearer OR api-key: <KEY>
normalizeBaseUrl(raw)       // default + trailing-slash strip

Both provider classes import these. The LLM provider drops its local detectAzure + buildUrl + buildHeaders. The embedding provider gains the same Azure auto-detection — same env var (OPENAI_BASE_URL), same api-version knob (OPENAI_API_VERSION, default 2024-08-01-preview).

Net delta

  • LLM provider: ~30 LOC simpler (Azure helpers gone)
  • Embedding provider: +10 LOC for Azure config fields, but gains a real feature
  • New shared module: 75 LOC (mostly comments)
  • Test file: 175 LOC across 17 cases

Functional gain: Azure embedding endpoint now works. Before this PR, only Azure LLM worked.

Tests

test/openai-shared.test.ts — 17 cases:

  • detectAzure: positive (.openai.azure.com), negative (api.openai.com / DeepSeek / SiliconFlow / Ollama / vLLM), malformed URLs
  • buildChatUrl: standard /v1/chat/completions, Azure /chat/completions?api-version=..., URL-encoded api-version
  • buildEmbeddingUrl: standard /v1/embeddings, Azure /embeddings?api-version=... (no /v1/ prefix)
  • buildAuthHeaders: Bearer for standard, api-key for Azure
  • normalizeBaseUrl: default fallback, trailing-slash strip, passthrough
  • OpenAIEmbeddingProvider end-to-end: Azure shape (asserts captured URL + api-key header substitution via mocked fetch), standard OpenAI shape (Bearer + /v1/embeddings)

1023/1023 tests pass locally (92 files, +15 new).

Verification

npm run build && npm test

Out of scope

  • Per-surface base URL override (e.g. OPENAI_EMBEDDING_BASE_URL for split LLM+embedding deployments) — separate enhancement, file if anyone needs it.
  • One-class merge per the issue body — see "Approach" above.

Summary by CodeRabbit

  • Refactor

    • Unified OpenAI/Azure endpoint routing, URL construction, auth header logic, and base-URL normalization into shared utilities; providers now use the consolidated behavior and Azure style selection.
  • Tests

    • Added unit tests covering Azure detection, chat/embedding URL variants (including query handling), auth header formats, and provider request behavior for OpenAI vs Azure.

Review Change Stack

OpenAIProvider (LLM) and OpenAIEmbeddingProvider (embedding) both
speak the OpenAI wire shape over POST /v1/chat/completions and POST
/v1/embeddings — and both need to swap to the Azure shape when the
base URL lands at *.openai.azure.com (api-key header instead of
Authorization: Bearer, api-version query param, no /v1/ prefix
because the deployment is already in the URL).

Until now only the LLM provider knew about Azure. The embedding
provider hardcoded /v1/embeddings + Bearer auth, so any user pointing
OPENAI_BASE_URL at an Azure resource saw their LLM calls route
correctly while embedding calls 404'd / 401'd.

New src/providers/_openai-shared.ts owns:

  detectAzure(baseUrl)
  buildChatUrl(baseUrl, isAzure, apiVersion)
  buildEmbeddingUrl(baseUrl, isAzure, apiVersion)
  buildAuthHeaders(apiKey, isAzure)
  normalizeBaseUrl(raw)

Both classes import these helpers. The embedding provider gains
Azure auto-detection via the same OPENAI_BASE_URL hostname check the
LLM provider already uses, plus the same OPENAI_API_VERSION knob
(default 2024-08-01-preview). Closes the gap users hit when mirroring
an Azure deployment on both surfaces.

Net delta: ~40 LOC of duplicated transport collapsed into one shared
file; both provider files are smaller and focused on their surface's
unique concerns (LLM owns max_tokens / reasoning_effort / timeout
precedence; embedding owns the MODEL_DIMENSIONS table).

Approach diverges from the issue body (single class implementing both
interfaces): the existing factory contracts at
src/providers/index.ts dispatch LLM and embedding independently
(detectProvider vs detectEmbeddingProvider), and merging into one
class would force constructors to coordinate detection across two
config surfaces. Shared transport keeps factories clean while
delivering the DRY win and the Azure-on-embeddings parity gain.

- src/providers/_openai-shared.ts: new shared transport module
- src/providers/openai.ts: import shared helpers; drop local
  detectAzure + private buildUrl/buildHeaders
- src/providers/embedding/openai.ts: import shared helpers; Azure
  auto-detection via OPENAI_BASE_URL host check, OPENAI_API_VERSION
  query param when Azure-shaped
- test/openai-shared.test.ts: 17 cases covering all four helpers
  plus end-to-end embedding Azure shape (asserts URL path + api-key
  header substitution via mocked fetch)

1023/1023 tests pass.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agentmemory Ready Ready Preview, Comment May 18, 2026 9:36am

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 17, 2026

📝 Walkthrough

Walkthrough

This PR extracts OpenAI and Azure transport logic (URL builders, Azure-style detection, auth header creation, base-url normalization) into src/providers/_openai-shared.ts and updates OpenAIProvider and OpenAIEmbeddingProvider to use those helpers; tests for detection, URL shaping, headers, and provider embedding calls were added.

Changes

OpenAI/Azure Transport Consolidation

Layer / File(s) Summary
Shared OpenAI/Azure transport contract
src/providers/_openai-shared.ts
Exports defaults and helpers: DEFAULT_OPENAI_BASE_URL, DEFAULT_AZURE_API_VERSION, detectAzure, azureStyleOf, buildChatUrl, buildEmbeddingUrl, buildAuthHeaders, and normalizeBaseUrl implementing legacy vs v1 Azure routing and header selection.
Embedding provider refactor to use shared helpers
src/providers/embedding/openai.ts
Imports shared helpers, normalizes OPENAI_BASE_URL, detects Azure and API version, and uses buildEmbeddingUrl() and buildAuthHeaders() in embedBatch() instead of hardcoded paths/headers.
LLM provider refactor to use shared helpers
src/providers/openai.ts
Replaces local URL/header/detection logic with normalizeBaseUrl(), detectAzure(), buildChatUrl(), and buildAuthHeaders(); call() now uses the shared chat URL builder.
Shared helpers and provider integration tests
test/openai-shared.test.ts
Adds unit tests for detectAzure, buildChatUrl, buildEmbeddingUrl, buildAuthHeaders, normalizeBaseUrl, and integration tests asserting OpenAIEmbeddingProvider issues Azure vs standard OpenAI requests correctly.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • rohitg00/agentmemory#453: Also modifies OpenAIProvider request logic and timeout handling; related transport-area edits.
  • rohitg00/agentmemory#307: Prior Azure-compatible transport logic adjustments that this PR consolidates into shared helpers.
  • rohitg00/agentmemory#186: Earlier change to embedding URL derivation; this PR further refactors embeddings to use shared helpers.

Poem

🐇 I stitched the routes and headers tight,
One helper now guides day and night.
No more copies hopping in a row,
Shared logic makes the pathways glow.
Hooray — carrot-powered code in flight!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.56% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: extracting OpenAI transport logic into a shared module to eliminate duplication between LLM and embedding providers.
Linked Issues check ✅ Passed The changes successfully address #371 and #199 by extracting shared OpenAI transport logic (Azure detection, URL building, auth headers) and achieving functional parity for Azure embedding endpoints through a shared module instead of merging provider classes.
Out of Scope Changes check ✅ Passed All changes are scoped to removing duplicated transport/boilerplate between OpenAI providers and enabling Azure support for embeddings; no unrelated features or refactorings are introduced.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/371-openai-shared-transport

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
test/openai-shared.test.ts (1)

141-191: ⚡ Quick win

Normalize headers using the Headers API for robust type handling.

RequestInit.headers can be Headers, header pairs array, or record. While current tests work (since buildAuthHeaders returns plain objects), the cast to Record<string, string> makes them brittle. Using the Headers API constructor and .get() method normalizes all header input types and aligns with standard fetch semantics.

Update both test cases (lines 147–191) to:

  • Use new Headers() instead of Record<string, string> = {}
  • Assign with new Headers(init?.headers) instead of casting
  • Assert with .get() method: .toBe("value") for present headers, .toBeNull() for absent (not .toBeUndefined())
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/openai-shared.test.ts` around lines 141 - 191, The tests for
OpenAIEmbeddingProvider.embedBatch should normalize RequestInit.headers using
the Headers API: replace capturedHeaders: Record<string,string> with
capturedHeaders = new Headers(), construct it via new Headers(init?.headers)
inside the fetch mock, and change assertions to use
capturedHeaders.get("api-key") / capturedHeaders.get("Authorization") returning
expected strings or null (use .toBeNull() for absent) instead of checking
undefined; this ensures robust handling of Headers, header pairs, and Records
returned by buildAuthHeaders.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/providers/_openai-shared.ts`:
- Around line 29-32: The azureUrl function currently appends path before
checking for an existing query string, causing the path to be treated as part of
query values; fix azureUrl by parsing baseUrl with the URL API (new
URL(baseUrl)), correctly joining the existing pathname and the provided path
(handle leading/trailing slashes) and then set/add the api-version via
url.searchParams.set('api-version', apiVersion) so query parameters are
preserved and encoded properly, finally return url.toString(); update references
inside azureUrl accordingly.
- Line 11: The constant DEFAULT_AZURE_API_VERSION currently set to
"2024-08-01-preview" must be replaced to use the v1 Azure OpenAI pattern: remove
or deprecate DEFAULT_AZURE_API_VERSION and update any code that appends
api-version to Azure OpenAI URLs to instead target the /openai/v1 endpoint
style; search for usages of DEFAULT_AZURE_API_VERSION and update functions that
build Azure URLs (e.g., any URL construction logic referencing
DEFAULT_AZURE_API_VERSION) so they no longer append an api-version query
parameter and instead use the /openai/v1 path for requests.

---

Nitpick comments:
In `@test/openai-shared.test.ts`:
- Around line 141-191: The tests for OpenAIEmbeddingProvider.embedBatch should
normalize RequestInit.headers using the Headers API: replace capturedHeaders:
Record<string,string> with capturedHeaders = new Headers(), construct it via new
Headers(init?.headers) inside the fetch mock, and change assertions to use
capturedHeaders.get("api-key") / capturedHeaders.get("Authorization") returning
expected strings or null (use .toBeNull() for absent) instead of checking
undefined; this ensures robust handling of Headers, header pairs, and Records
returned by buildAuthHeaders.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 45d1dc00-c5f1-4fc6-ad46-4ce2cc20de75

📥 Commits

Reviewing files that changed from the base of the PR and between 9061da5 and 9fa0b0d.

📒 Files selected for processing (4)
  • src/providers/_openai-shared.ts
  • src/providers/embedding/openai.ts
  • src/providers/openai.ts
  • test/openai-shared.test.ts

// across both surfaces and shaves ~40 LOC.

export const DEFAULT_OPENAI_BASE_URL = "https://api.openai.com";
export const DEFAULT_AZURE_API_VERSION = "2024-08-01-preview";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

What is the latest recommended Azure OpenAI API version as of May 2026?

💡 Result:

As of May 2026, the recommended approach for Azure OpenAI API integration is to use the v1 API [1][2]. The v1 API represents the next generation of Azure OpenAI APIs, which simplifies development by removing the requirement to specify dated api-version parameters [1][3]. By using the v1 API, developers gain ongoing access to the latest features without needing to update their code to accommodate new monthly API versions [1][3]. Key characteristics of the v1 API include: - No required api-version parameter [1][3]. - Support for the standard OpenAI client (using OpenAI instead of AzureOpenAI) [1][3]. - Integration by setting the base_url to the Azure OpenAI endpoint with /openai/v1 appended [1][3]. - Improved compatibility with OpenAI client libraries, allowing for easier switching between OpenAI and Azure OpenAI services [1][3]. For legacy or specific control plane operations that still require dated versions, the API continues to use the YYYY-MM-DD format [4][5]. However, for data plane inference, the v1 API is the current standard [4][6].

Citations:


Use the v1 API instead of the dated preview version.

The DEFAULT_AZURE_API_VERSION = "2024-08-01-preview" uses an outdated approach. As of May 2026, Microsoft recommends the v1 API for Azure OpenAI integrations, which removes the need for dated api-version parameters entirely and provides automatic access to the latest features without code updates. Migrate the integration to use the v1 API pattern with /openai/v1 endpoint configuration.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/providers/_openai-shared.ts` at line 11, The constant
DEFAULT_AZURE_API_VERSION currently set to "2024-08-01-preview" must be replaced
to use the v1 Azure OpenAI pattern: remove or deprecate
DEFAULT_AZURE_API_VERSION and update any code that appends api-version to Azure
OpenAI URLs to instead target the /openai/v1 endpoint style; search for usages
of DEFAULT_AZURE_API_VERSION and update functions that build Azure URLs (e.g.,
any URL construction logic referencing DEFAULT_AZURE_API_VERSION) so they no
longer append an api-version query parameter and instead use the /openai/v1 path
for requests.

Comment thread src/providers/_openai-shared.ts Outdated
Inline review on #462 surfaced an edge-case bug in the azureUrl
helper: it tested baseUrl for an existing query string to pick the
?/& separator, then string-concatenated the route path BEFORE that
separator. If a baseUrl arrived with pre-existing query params
(corporate proxy carrying a tenant token, diagnostics endpoint,
etc.), the route path got interpolated into the query string,
producing a malformed URL like:

  baseUrl: https://proxy.example.com/openai/deployments/d?tenant=acme
  result:  https://proxy.example.com/openai/deployments/d?tenant=acme/chat/completions&api-version=2024-08-01-preview
                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ in the query, not the path

Switch to the URL API: parse baseUrl, normalise the existing
pathname (strip trailing slashes), join the route path with a
single boundary slash, set api-version via url.searchParams.set
(handles encoding without a manual encodeURIComponent), then
toString. Existing query params are preserved.

Test header normalisation pass: the OpenAIEmbeddingProvider
Azure-detection tests captured RequestInit.headers as
Record<string,string>. buildAuthHeaders happens to return a plain
record today, but a future contributor migrating to
HeadersInit/Headers would have these tests silently pass-but-stale
because Record-style access would no longer match. Wrap the capture
in new Headers(init?.headers) so the assertions go through .get()
and tolerate any of the three valid HeadersInit shapes.

Skipped — replacing DEFAULT_AZURE_API_VERSION with /openai/v1: the
v1 Azure pattern is a recent addition and many deployments still
require the api-version query param. Switching the default would
break those deployments. Separate opt-in flag (e.g.
OPENAI_AZURE_API_STYLE=v1) is the right shape but out of scope for
this minimal-change review pass.

- src/providers/_openai-shared.ts: azureUrl rewritten on URL API
- test/openai-shared.test.ts: two new cases (query-param
  preservation, trailing-slash normalisation); embedding Azure
  tests switched to Headers API + .get() / .toBeNull()

1025/1025 tests pass.
Azure shipped a v1 GA endpoint pattern that mirrors the OpenAI wire
shape one-for-one:

  POST https://<resource>.openai.azure.com/openai/v1/chat/completions

No api-version query param, no /deployments/<dep> path segment —
deployment name is passed in the request body as `model`. Existing
OpenAI clients work as drop-in. The legacy URL pattern
(/openai/deployments/<dep>/chat/completions?api-version=<date>) is
still supported by Azure indefinitely for back-compat.

Verification of the inline review's "remove DEFAULT_AZURE_API_VERSION
and migrate all Azure calls to /openai/v1" instruction: removing it
flat would break legacy users mid-flight (their existing
OPENAI_BASE_URL=https://r.openai.azure.com/openai/deployments/d
configs would still route through the legacy path and 400 without
api-version). Hybrid auto-detect off the URL shape is the right
shape:

  - baseUrl pathname contains `/openai/deployments/` -> legacy style,
    api-version still appended (DEFAULT_AZURE_API_VERSION fallback)
  - otherwise (bare resource host, /openai prefix, /openai/v1 prefix)
    -> v1 style, no api-version, route through /openai/v1/<path>

Users migrate by stripping the /openai/deployments/<dep> suffix from
their OPENAI_BASE_URL — no env-var changes required.

azureStyleOf(baseUrl) is the new detection helper. v1AzureUrl
preserves any pre-existing query params on the base URL (corporate
proxy diagnostics tokens) but never appends api-version. The
/openai/v1 prefix is normalised so configurations like
OPENAI_BASE_URL=https://r.openai.azure.com/openai or
.../openai/v1 don't double-prefix.

- src/providers/_openai-shared.ts: azureStyleOf + v1AzureUrl;
  legacyAzureUrl (renamed from azureUrl) is unchanged; module header
  comment documents both styles and the migration path
- test/openai-shared.test.ts: 3 new cases — v1 routing on bare host,
  /openai or /openai/v1 prefix normalisation, v1 on the embedding
  surface as well; legacy assertion updated to say "Azure legacy" so
  the contrast with v1 is explicit

1028/1028 tests pass.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/providers/_openai-shared.ts (1)

1-24: ⚡ Quick win

Remove explanatory WHAT-comments to match repository style.

This file has multiple behavior-explaining comments; please rely on clear naming/tests instead and trim these comments per project convention.

As per coding guidelines, "Do not use code comments explaining WHAT — use clear naming instead".

Also applies to: 27-30, 34-34, 44-45, 60-63, 76-79, 82-85, 116-119

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/providers/_openai-shared.ts` around lines 1 - 24, Remove the long
explanatory "WHAT" comments in this shared OpenAI transport module and replace
them with concise purpose-only comments; trim the multi-paragraph Azure/version
discussion to a single-line summary and rely on clear names and tests instead
(e.g., keep a short header describing that the module provides OpenAI-compatible
transport helpers and that azureStyleOf() auto-detects legacy vs v1 URL shapes),
delete the verbose block comments referenced in the review (the large Azure
URL/style explanation and other WHAT-comments around azureStyleOf, the legacy/v1
description, and the examples), and if needed rename or clarify identifiers
(like azureStyleOf, DEFAULT_AZURE_API_VERSION, enableLanceKnowledgeBase-style
env knobs) so the code is self-descriptive and the tests cover behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/providers/_openai-shared.ts`:
- Around line 1-24: Remove the long explanatory "WHAT" comments in this shared
OpenAI transport module and replace them with concise purpose-only comments;
trim the multi-paragraph Azure/version discussion to a single-line summary and
rely on clear names and tests instead (e.g., keep a short header describing that
the module provides OpenAI-compatible transport helpers and that azureStyleOf()
auto-detects legacy vs v1 URL shapes), delete the verbose block comments
referenced in the review (the large Azure URL/style explanation and other
WHAT-comments around azureStyleOf, the legacy/v1 description, and the examples),
and if needed rename or clarify identifiers (like azureStyleOf,
DEFAULT_AZURE_API_VERSION, enableLanceKnowledgeBase-style env knobs) so the code
is self-descriptive and the tests cover behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2462cd8b-cc12-4b08-9283-f025ba9e795f

📥 Commits

Reviewing files that changed from the base of the PR and between 6f7d4a0 and 34b0451.

📒 Files selected for processing (2)
  • src/providers/_openai-shared.ts
  • test/openai-shared.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/openai-shared.test.ts

@rohitg00 rohitg00 merged commit 06248fd into main May 18, 2026
5 checks passed
@rohitg00 rohitg00 deleted the refactor/371-openai-shared-transport branch May 18, 2026 10:20
rohitg00 added a commit to cl0ckt0wer/agentmemory that referenced this pull request May 18, 2026
Brings 10 days of main into the OpenCode plugin branch so the PR no
longer conflicts on README + carries the new surfaces that shipped
between v0.9.2 (when the branch opened) and v0.9.20:

- v0.9.19 commit linking (rohitg00#498): KV.commits + Session.commitShas +
  memory_commit_lookup/memory_commits MCP tools (53 total now, plugin
  badge bumped from 51)
- v0.9.19 Azure OpenAI v1 URL pattern (rohitg00#462) + Dijkstra graph
  retrieval (rohitg00#463)
- v0.9.19 env passthrough on MCP server entries (rohitg00#460): ${VAR}
  expansion for AGENTMEMORY_URL / AGENTMEMORY_SECRET so one wired
  entry covers local + remote
- v0.9.20 Codex Stop revert (rohitg00#501)

README conflict resolution kept main's richer "Other agents" table
shape (env-passthrough block + per-host config-file column +
programmatic-access section) and re-added the OpenCode entry as two
rows: "OpenCode (MCP only)" for the bare MCP wiring + "OpenCode
(full plugin)" pointing at this plugin's 22-hook capture surface.

src/triggers/api.ts auto-merged: PR's 3-line title->summary/firstPrompt
addition (lines 535, 543, 544) survived alongside main's other api.ts
churn since.

plugin/opencode/plugin.json bumped 0.9.4 -> 0.9.20 to match the
canonical version everything else ships on.
plugin/opencode/README.md MCP-tool badge bumped 51 -> 53.
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.

Consolidate OpenAI LLM + embedding providers into one class providers: consolidate openai providers

1 participant