Skip to content

Allow explicit Responses API selection in OpenAI-compatible model factories - #2

Open
MiRHaDi wants to merge 1 commit into
Fennec-AI:mainfrom
MiRHaDi:codex/configurable-responses-api
Open

MiRHaDi wants to merge 1 commit into
Fennec-AI:mainfrom
MiRHaDi:codex/configurable-responses-api

Conversation

@MiRHaDi

@MiRHaDi MiRHaDi commented Oct 28, 2026

Copy link
Copy Markdown

What does this change?

Gateways and models can support Responses and Chat Completions differently. Fennec currently provides no way to select that protocol through configuration for either the default model or per-agent overrides.

Add optional FENNEC_LLM_USE_RESPONSES_API: true selects Responses, false selects Chat Completions, and leaving it unset preserves LangChain's automatic selection. Apply it to both OpenAI-compatible providers in both model factories; Anthropic receives no new argument. No provider is forced to use Responses. Document the setting and require langchain-openai>=0.3.9 in both dependency manifests, matching LangChain's documented minimum.

Validation

Offline regression tests instantiate the actual ChatOpenAI/OpenAI SDK with an HTTPX MockTransport. They verify the outgoing endpoint and normalized returned tool call for both providers, both factories, and unset/false/true settings, plus environment parsing, invalid values and Anthropic isolation. They make no external API calls and use no real credentials.

  • ruff check . passes.
  • Full offline suite: 27 passed (18 protocol regressions and 9 existing smoke cases), on Windows and on Linux. The Linux check ran in a separate systemd sandbox with no external network interfaces, a read-only system and resource limits; no production service configuration was changed.
  • npm --prefix frontend run build passes.
  • Frontend files are unchanged; its existing lint command fails because --ext is incompatible with the flat ESLint config.

Checklist

  • ruff check . passes.
  • Offline pytest passes.
  • Docs, environment example and changelog updated.
  • No proprietary services, telemetry, authentication gates or deployment credentials added.

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