Skip to content

[codex] Fix automatic Gemini model discovery - #18

Open
222wcnm wants to merge 1 commit into
tech-shrimp:mainfrom
222wcnm:codex/fix-gemini-model-discovery
Open

[codex] Fix automatic Gemini model discovery#18
222wcnm wants to merge 1 commit into
tech-shrimp:mainfrom
222wcnm:codex/fix-gemini-model-discovery

Conversation

@222wcnm

@222wcnm 222wcnm commented Jun 27, 2026

Copy link
Copy Markdown

Summary

This PR fixes automatic Gemini model discovery while preserving OpenAI-compatible model listing behavior.

Changes

  • Route native Gemini /v1beta/models requests to the Gemini API instead of the OpenAI compatibility handler.
  • Keep OpenAI /v1/models model listing converted to OpenAI-style response objects.
  • Support comma-separated Gemini query key values by selecting one key before proxying.
  • Request a larger model list page for OpenAI-compatible model discovery.
  • Add focused node:test coverage for Gemini model listing, OpenAI model listing, and query-key selection.

Impact

Clients that call the native Gemini model listing endpoint can auto-refresh available models through this proxy, while OpenAI-compatible clients continue to receive the expected /v1/models shape.

Validation

  • node --test

Note: Node emits an existing MODULE_TYPELESS_PACKAGE_JSON warning because package.json does not declare type: module; tests pass.

@222wcnm
222wcnm marked this pull request as ready for review June 27, 2026 14:24
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