Skip to content

fix: BookDate's OpenAI model list shows current GPT models - #530

Merged
kikootwo merged 1 commit into
mainfrom
reland/515-bookdate-models
Nov 2, 2026
Merged

kikootwo merged 1 commit into
mainfrom
reland/515-bookdate-models

Conversation

@kikootwo

@kikootwo kikootwo commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Summary

BookDate's OpenAI model list now shows current GPT models such as gpt-5, gpt-5-mini and gpt-5.1. Before, the list kept only gpt- ids containing a 4 anywhere, so every GPT-5 model without a 4 was hidden, while gpt-3.5-turbo-instruct-0914 (a completions-only model, the cause of #118) and audio, realtime and search variants were offered. The list now keeps gpt-N ids with N of 4 or more and drops the families BookDate's Chat Completions call can't use.

Changes

  • src/app/api/bookdate/test-connection/route.ts
    • New isBookDateOpenAIModel(id): a string id matching gpt-N... with N >= 4 (gpt-10-x included), excluding any id with a dash-separated audio, realtime, transcribe, tts, search, codex or pro part. Codex and Pro models are Responses API only.
    • Non-string ids and null entries in OpenAI's reply are skipped instead of failing the connection test with a 500.
    • The route's access check and key handling are unchanged. This is the only place the OpenAI list is filtered.
  • documentation/features/bookdate.md: the OpenAI model list rule.

Tests

  • tests/api/bookdate-test-connection.routes.test.ts: the two OpenAI cases become one table over the setup wizard (no sign-in) and an admin, with a realistic list of 30 ids (kept GPT-4.x, 4o, 5.x and future majors; dropped 3.5, gpt-3.5-turbo-instruct-0914, audio, realtime, transcribe, TTS, search, Codex, Pro, image, chatgpt-4o-latest, o4-mini, embeddings, Whisper), asserting the exact sorted output and that the OpenAI models endpoint was called. A new case covers entries without a string id.
  • Fails on main (9d13539 src with this branch's tests): 3 tests (both table rows, which also show gpt-5, gpt-5-mini and gpt-5.1 missing and gpt-3.5-turbo-instruct-0914 listed, and the non-string id case, which returns 500).

Checks

  • vitest related on route.ts plus the test file: PASS, 3 files, 88 tests
  • tsc --noEmit: clean
  • ESLint on the changed files: nothing new (only existing no-explicit-any warnings: route 10 before and after, test file 58 before, 55 after)
  • Full unit suite: PR Tests (CI)

Risk and rollback

  • Only the model choices offered when testing an OpenAI connection change. A saved model keeps working; nothing about generation changes.
  • Still a name-based filter, since OpenAI's models API has no capability data. A future GPT id that isn't a chat model could be listed until the exclusion list learns it; picking one fails visibly on the first BookDate run.
  • Older gpt-4, gpt-4-turbo and gpt-4o-2024-05-13 ids stay listed, as on main. They don't accept the json_schema response format BookDate sends.
  • Rollback: revert this PR. No schema or setting.

Based on #515 by @DG-za.

Release note

🤖 Generated with Claude Code

The OpenAI model list kept only gpt- ids containing a "4", so GPT-5 models
without one were hidden, while gpt-3.5-turbo-instruct-0914 and audio,
realtime and search variants were offered. It now keeps gpt-N ids with
N >= 4 and drops ids with a dash-separated audio, realtime, transcribe, tts,
search, codex or pro part, which BookDate's Chat Completions call can't use.
Entries without a string id are skipped instead of failing the test with a 500.

Based on #515 by @DG-za.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: DG-za <35300630+DG-za@users.noreply.github.com>
@kikootwo
kikootwo marked this pull request as ready for review November 2, 2026 15:34
@kikootwo
kikootwo merged commit 6ce075b into main Nov 2, 2026
1 check passed
@kikootwo
kikootwo deleted the reland/515-bookdate-models branch November 2, 2026 15:34
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