Skip to content

feat(provider): support OpenAI backend models#90

Open
rich7420 wants to merge 1 commit into
mainfrom
feat/openai-backend-models
Open

feat(provider): support OpenAI backend models#90
rich7420 wants to merge 1 commit into
mainfrom
feat/openai-backend-models

Conversation

@rich7420

@rich7420 rich7420 commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add provider/model compatibility normalization so OpenAI, openai-compatible, Anthropic, and Vertex paths keep compatible main and heartbeat models.
  • Split local config/env credential resolution into a ProviderAccess boundary that can later accept credentials from an API gateway broker without replacing Claude support.
  • Send GPT-5-family requests with max_completion_tokens, keep legacy GPT-4o-style models on max_tokens, and apply model-specific output-token caps.
  • Update gateway config/session reload paths so provider/key/model changes validate before persisting and live sessions/heartbeat pick up compatible config.

Validation

  • bun run typecheck
  • bun run test: 4706 pass, 5 skip, 0 fail
  • bun test --timeout 30000 --max-concurrency=1 ./tests/e2e-gateway.ts: 20 pass, 0 fail
  • bun test --timeout 30000 --max-concurrency=1 ./tests/e2e-gateway-sessions.ts ./tests/e2e-bridge-reply.ts ./tests/e2e-chart-pipeline.ts ./tests/e2e-generate-chart.ts: 21 pass, 0 fail
  • bun test --timeout 60000 --max-concurrency=1 ./tests/e2e-memory-distill.ts ./tests/e2e-person-rpc.ts ./tests/e2e-send-photo.ts ./tests/e2e-web-demo.ts ./tests/e2e-where-reminder.ts: 26 pass, 0 fail
  • ANTHROPIC_API_KEY from local config + bun test --timeout 60000 --max-concurrency=1 ./tests/e2e-cron.ts ./tests/e2e-heartbeat.ts: 7 pass, 0 fail
  • Live gateway smoke against http://127.0.0.1:4242: /health, /auth/device, WebSocket connect, config.get, provider.listModels, and chat.send all passed; second chat returned SMOKE_OK.
  • Real OpenAIProvider.stream smoke: gpt-5.5 and gpt-4o-mini both returned complete streaming events.
  • Real OpenAIProvider tool-call smoke: gpt-5.5 produced probe_echo tool_use, accepted tool_result, and returned probe-result:alpha after the tool result.

Limitations / Follow-ups

  1. This PR only adds local OpenAI key support for backend provider execution; the future API gateway credential broker can plug into the ProviderAccess boundary later.
  2. Existing Claude/Anthropic support is preserved. When switching providers, stale incompatible heartbeat overrides are normalized instead of reused.
  3. Full ./tests/e2e-*.ts cannot be run completely in this local shell because BRAVE_API_KEY is not configured and direct AnthropicProvider smoke currently returns connection_error in this environment; cron/heartbeat Anthropic-backed e2e still pass when ANTHROPIC_API_KEY is injected from local config.

@rich7420 rich7420 force-pushed the feat/openai-backend-models branch from 14cea02 to b1f306b Compare July 2, 2026 08:07
Add provider/model compatibility normalization for OpenAI and Claude backends.

Add local provider access resolution as the boundary for future credential brokers, and update gateway config/session reload paths so OpenAI, openai-compatible, Anthropic, and Vertex providers keep compatible models.

Cover GPT-5.5 and GPT-4o-mini request parameters, heartbeat model normalization, config updates, and gateway session provider swaps.
@rich7420 rich7420 force-pushed the feat/openai-backend-models branch from b1f306b to 2dc5062 Compare July 14, 2026 01:59
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.

1 participant