Skip to content

[upstream PR 220] f<!-- -->ix(providers): support Azure AI Foundry (Anthropic) endpoint and corporate proxy #802

@wbugitlab1

Description

@wbugitlab1

Source: Source pull request number: 220 in rohitg00/agentmemory (URL omitted to avoid GitHub cross-reference)
Title: fix(providers): support Azure AI Foundry (Anthropic) endpoint and corporate proxy
Author: nagarjunr
State: open
Draft: no
Merged: no
Head: nagarjunr/agentmemory:local/all-fixes @ 740197e
Base: main @ bc64107
Labels: (none)
Changed files: 0
Commits: 0
Created: 2026-04-30T20:15:19Z
Updated: 2026-05-21T16:47:17Z
Closed: (not closed)
Merged at: (not merged)

Original PR body:

Summary

  • Azure OpenAI / Azure AI Foundry provider: New LLM provider for Azure-hosted models. Auto-detects deployment type from endpoint URL — standard Azure OpenAI ({resource}.openai.azure.com) uses OpenAI chat completions format; Azure AI Foundry Anthropic ({resource}.services.ai.azure.com/anthropic) uses Anthropic Messages API format with x-api-key / anthropic-version headers.
  • Corporate proxy support: Node.js 18+ built-in fetch ignores HTTP_PROXY/HTTPS_PROXY, causing DNS failures in corporate networks. Provider tunnels through HTTP CONNECT proxy via tunnel-agent + node-fetch when proxy env vars are present. Proxy credentials (user:pass@host) are extracted from the URL and forwarded as Proxy-Authorization.
  • Foundry URL double-suffix guard: Endpoint normalized so /v1/messages is not appended when the endpoint already ends with that path.
  • VALID_PROVIDERS gap: azure-openai was missing from the runtime allowlist used by loadFallbackConfig(), so FALLBACK_PROVIDERS=azure-openai was silently dropped despite ProviderType including the value.
  • Viewer tab bar / graph canvas fixes: Tab bar no longer crushes content area; graph canvas fills viewport height correctly.
  • JSDoc coverage: Full JSDoc on all exported and private members of AzureOpenAIProvider to satisfy the 80% docstring coverage check.

Changes

File What changed
src/providers/azure-openai.ts New provider: proxy tunnel, dual-format request/response, Foundry URL normalization, full JSDoc
src/providers/index.ts Wire up AzureOpenAIProvider
src/config.ts Azure env var detection; azure-openai added to VALID_PROVIDERS
src/types.ts ProviderType union includes azure-openai
src/viewer/index.html Tab bar overflow fix; graph canvas height fix
README.md Azure OpenAI + Foundry rows in provider table; AZURE_OPENAI_* env vars with proxy note
CHANGELOG.md [Unreleased] entries for all changes

Environment variables

AZURE_OPENAI_API_KEY=...
AZURE_OPENAI_ENDPOINT=https://<resource>.openai.azure.com          # Standard Azure OpenAI
# or
AZURE_OPENAI_ENDPOINT=https://<resource>.services.ai.azure.com/anthropic  # Azure AI Foundry (Anthropic)
AZURE_OPENAI_DEPLOYMENT=<deployment-name>
AZURE_OPENAI_API_VERSION=2024-08-01-preview   # optional, Azure OpenAI only

# Corporate proxy (optional — auto-detected from env)
HTTPS_PROXY=http://user:pass@proxy.corp.example.com:3128

Test plan

  • Graph extraction works in corporate proxy environment (HTTP_PROXY/HTTPS_PROXY set)
  • Authenticated proxy (user:pass@host:port) forwards Proxy-Authorization correctly
  • Azure AI Foundry Anthropic endpoint returns correct responses
  • Standard Azure OpenAI endpoint works unchanged
  • FALLBACK_PROVIDERS=azure-openai is not silently dropped
  • Endpoint with full /v1/messages suffix does not double-append
  • Viewer graph canvas renders nodes/edges without overflow
  • Tab bar does not crush when many sessions open

Summary by CodeRabbit

  • New Features

    • Added Azure OpenAI as a supported LLM provider with endpoint and deployment configuration.
    • Added Azure AI Foundry (Anthropic) endpoint auto-detection and support.
    • Added proxy support for corporate networks via environment variables.
  • Bug Fixes

    • Fixed tab bar overflow that was crushing content area with multiple sessions.
    • Fixed knowledge graph canvas to properly fill available viewport height.

Local branch:
Fork PR:
Fork decision:
Verification:
Notes:

Metadata

Metadata

Assignees

No one assigned

    Labels

    decision-candidateFork decision has not been madeupstream-openUpstream pull request is openupstream-prTracks an upstream pull request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions