Skip to content

feat: advanced OpenAI settings per provider - #10

Merged
LukeGus merged 1 commit into
Termix-SSH:dev-1.3.0from
Rhiz3K:feat/provider-advanced-settings
Oct 22, 2026
Merged

LukeGus merged 1 commit into
Termix-SSH:dev-1.3.0from
Rhiz3K:feat/provider-advanced-settings

Conversation

@Rhiz3K

@Rhiz3K Rhiz3K commented Oct 22, 2026

Copy link
Copy Markdown

Stacked on #9 — merge #9 first; until then this diff also includes its commits (Responses API for OpenAI).

What

Providers of type OpenAI and OpenAI compatible get a collapsible Advanced section in the provider form. Other provider types don't show it and never send it.

Field Values Responses API Chat Completions
Endpoint Auto (default) / Responses API / Chat Completions picks the path; Auto keeps today's rule (api.openai.com → Responses)
Reasoning effort Default / none / minimal / low / medium / high / xhigh / max reasoning.effort reasoning_effort
Reasoning summary Default (auto) / auto / concise / detailed / off reasoning.summary (off = not sent) not applicable
Verbosity Default / low / medium / high text.verbosity verbosity
Max output tokens 1–1,000,000 max_output_tokens max_completion_tokens (OpenAI) / max_tokens (compatible)
Temperature 0–2 temperature temperature

Leaving a field on Default sends nothing new, so the requests are the same as before. The values come from the OpenAI API reference (Responses create; Chat Completions create) and the latest-model guide: "When reasoning effort is not none, remove temperature, top_p, and top_logprobs."

Behaviour details

  • Max output tokens: the user's limit never goes above a caller's own cap (Math.min). Callers include the engine's reply limit and the 2048 cap used by exposure explanations. With the field empty, the plugin keeps sending its own limit as before.
  • Temperature: it is not sent to openai providers when the reasoning effort is set to anything other than none, and a warning is logged. A server that answers 400/422 about temperature is asked again without it, also with a warning. Compatible servers get it with any effort.
  • Fallbacks:
    • The Chat reasoning_effort: "none" retry for tools still only runs when the user did not set an effort.
    • The Responses summary retry now drops only reasoning.summary and keeps a user-set effort.
    • If the model refuses the user's effort, the error is shown. Summaries are not turned off.
  • Storage: one nullable JSON text column advanced on p_ai_providers, added by migration 0013_provider_advanced (sqlite/postgres text, mysql longtext). It was generated with termix-plugin migrations, and snapshot.json is updated.
  • API:
    • POST /providers and PATCH /providers/:id accept advanced. PATCH replaces the whole object; null clears it.
    • Unknown keys, wrong types and out-of-range values get a 400 "Invalid advanced settings".
    • Every provider response returns advanced ({} when nothing is set).
    • The OpenAPI comments are updated.
  • UI: AiProviderSettings.tsx, 27 new ai.advanced* keys in locales/en.json. Translations are not included.

Verification

  • npx tsc -p .: OK. npx prettier --check .: OK.
  • npx vitest run: 88 files, 937 passed, 1 skipped (base: 87 files, 823 passed).
  • New and extended tests:
    • Request mapping for both endpoints: all fields set; empty advanced gives an unchanged body; summary off; summary refused keeps the effort; effort refused shows the error and summaries stay on; temperature rules and retry; endpoint override both ways; max token cap; a user effort is never replaced by the none retry.
    • Route validation for create, replace, clear and each invalid case.
    • Migration 0013 for every dialect.
    • Frontend form: hidden for other types, toggle, only set fields sent, null on edit, prefill, invalid temperature blocks Save.
  • Mutation checks. Each of these broke the change on purpose, and tests caught every one:
    • summary retry dropping the effort
    • temperature skip removed
    • chat effort not sent
    • token cap removed
    • temperature range widened
    • endpoint override removed
  • The plugin build (termix-plugin test/typecheck/build/validate/pack) passed.
  • Manual: in the Termix test container (ghcr.io/termix-ssh/termix:latest, plugin mounted as bundled) the log shows Applied 1 migration(s) for plugin ai: 0013_provider_advanced and Activated plugin ai.
  • Manual, in the browser: the Advanced section opens in the provider form for an OpenAI provider with gpt-6-luna (screenshot below) and the assistant still works with the settings left on Default.
  • Not verified: requests against the live OpenAI API with non-default values in every field.

Screenshot

Provider form with the Advanced section expanded

@termix-triage-bot

termix-triage-bot Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

AI review | Looks safe to merge

Adds validated advanced settings for OpenAI providers with proper migrations, UI, and fallback logic. No security or rule violations found.

  • minor Plugin PRs should target main, not dev-1.3.0.

Reviewed 8aba74b. AI can be wrong, a maintainer still decides. Comment /termix review to run it again.

Providers of type openai and openai_compatible get an Advanced section:
endpoint (auto, Responses API, Chat Completions), reasoning effort,
reasoning summary, verbosity, max output tokens and temperature. They are
stored as one JSON column (migration 0013) and validated by the routes.

Empty fields send nothing. The user's output limit never goes above a
caller's own cap. Temperature is not sent to OpenAI with an effort other
than none, and a server that refuses it is asked again without it. The
summary retry now keeps a user-set effort, and an effort the model
refuses is shown instead of turning summaries off.
@LukeGus
LukeGus force-pushed the feat/provider-advanced-settings branch from c683caa to 8aba74b Compare October 22, 2026 17:29
@LukeGus
LukeGus merged commit cb537f9 into Termix-SSH:dev-1.3.0 Oct 22, 2026
2 checks passed
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.

2 participants