The model field was one screen too late. Reported directly: "this is where
I would have expected to see the model dropdown", on the AI Task init step
that showed only Name and the recommended checkbox.
- CONF_CHAT_MODEL moves from async_step_additional to async_step_init for
conversation and ai_task_data, so all four endpoint types now ask on the
first screen. stt and tts already did.
- UNSUPPORTED_MODELS is validated there too, since the recommended path
creates the subentry from that step and would otherwise skip the check.
- model_list.default_model() picks what to preselect: RECOMMENDED_CHAT_MODEL
only when the provider actually serves it (or discovery returned nothing),
otherwise the first advertised model. Offering a stranger's gpt-4o-mini to
a LiteLLM user preselects a model that fails on first use.
This is the trade I got wrong last commit. I kept the field on the second
step to avoid touching 71 ported tests, having judged them unfixable
mechanically. They were not: the 71 were ~13 functions under parametrize,
and test_subentry_switching's data is already a list of per-step dicts, so
moving a model between steps is moving a key between two dicts. Two scripted
passes moved 14 of them; 5 needed reasoning about (an error that now surfaces
on init rather than the next step, and four cases whose expected data gains
the now-always-recorded model).
async_fetch_model_ids now also catches non-OpenAIError exceptions. Found via
a ported test whose client is a MagicMock: the TypeError from awaiting it
escaped and broke the whole form. A real proxy returning a payload the SDK
cannot parse would do the same, and this runs inside a dialog with a working
free-text fallback, so nothing it raises justifies taking the form down.
Also fixes a string that was simply false on a third-party provider, again
reported from the UI: "Store requests and responses in OpenAI" / "stored by
OpenAI and visible in your OpenAI dashboard logs". It now describes the
Responses API store flag and says support varies. Swept the other 43
OpenAI-mentioning strings while there -- the rest are [%key:...%]
self-references or this fork's own action names, and no other option text
makes a claim about who stores the data.
Local: 170 passed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NxJYWgGJtCw13qUHZtG8ki
This repo has no tags and no GitHub releases, and manifest.json has read
"1.0.0" since the integration was vendored -- unchanged across 20 commits,
including today's breaking reshape of the config flow. HACS falls back to
serving the default branch when there are no releases, so every download is
indistinguishable from the last and there is no way to tell what is running.
- scripts/release.py bumps manifest.json, commits and creates an annotated
tag in one step. It refuses a dirty tree, a branch other than main, a main
that differs from origin/main, a malformed version and an existing tag. It
stops short of pushing, since pushing the tag is what publishes.
- .github/workflows/release.yaml triggers on v* tags and refuses to publish
when the tag and manifest.json disagree. That mismatch is the failure worth
guarding: HACS offers the tag while Home Assistant reports the manifest, so
you install "v0.2.0" and the integration page says 0.1.0. It then creates
the release with gh (no third-party action).
- tests/test_version.py keeps the manifest version parseable by
AwesomeVersion (what HACS validates with) and in the shape the release
script accepts, so a release never fails on the version string itself.
Scheme: 0.x while the config entry shape is still in motion -- it changed
twice today -- and 1.0.0 when it settles. Documented in the README.
Local: 169 passed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NxJYWgGJtCw13qUHZtG8ki
Reshapes setup around how a multi-model proxy is actually used: one config
entry per server/provider, then one endpoint per model added by hand, with
the model chosen from what that provider advertises right now.
Setup (async_step_user):
- Adds a Name field. With one entry per provider the title matters, and it
was hardcoded to "ChatGPT" regardless of where the entry pointed. Blank
falls back to the endpoint host via url_util.title_from_base_url.
Deliberately absent from the reauth schema (now split out as
STEP_REAUTH_DATA_SCHEMA): that step writes its input back into entry.data
via data_updates, so a name field there would persist the title as
connection data on every key rotation.
- Stops auto-creating four subentries. conversation/ai_task_data/stt/tts were
all created up front carrying RECOMMENDED_* options, which pin OpenAI model
names (gpt-4o-mini-tts, gpt-4o-mini-transcribe). Against a third-party
endpoint those entities are dead on arrival -- the reported symptom was an
install that "loads bits, it's all janky".
- Drops _async_abort_entries_match, so several entries may point at one
server (one per provider-side key, for instance). Upstream aborts with
already_configured on matching url+key.
Model discovery (new model_list.py, kept out of the vendored files like
url_util.py):
- async_fetch_model_ids asks the endpoint's GET /v1/models. It calls
with_options(max_retries=0), because this runs while the user waits on a
dialog and the SDK otherwise retries with backoff -- visible in the test
run as repeated "Retrying request to /models" and a suite that went from
5s to minutes.
- Returns [] on any OpenAIError, and model_field() then yields a plain text
field instead of a dropdown, so an endpoint that serves /v1/responses but
not /v1/models is still configurable by hand. The dropdown sets
custom_value=True for the same reason (LiteLLM wildcard routes).
- Wired into all four types: conversation and ai_task_data on the additional
step, stt (which hardcoded OpenAI's three transcribe models) and tts on
init. TTS had no model field at all -- it silently used gpt-4o-mini-tts.
A new endpoint now starts with "recommended" unticked. Ticked, the flow ends
on the first step and never shows a model field, which is why the model
looked unpickable; reconfigure still keeps whatever was saved.
The model field stays on the additional step rather than moving to init. The
init position reads better, but 71 ported tests drive the model through the
additional step, several from parametrized option dicts that no mechanical
edit could relocate. Rewriting the only regression net against upstream to
save one click was the wrong trade.
Also: the setup description no longer says "your OpenAI API key", and
instructions_url pointed at a README anchor (#generate-an-api-key) that does
not exist -- now #configuration. strings.json re-verified against core's
RE_URL: 0 violations.
Local: 167 passed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NxJYWgGJtCw13qUHZtG8ki
Every label, description and error in this integration's UI renders
untranslated in a live Home Assistant. homeassistant.helpers.translation
loads `<integration>/translations/<lang>.json` and nothing else (there is
no fallback to strings.json -- see translation.py's
`integration.file_path / "translations" / file_name`), and this component
has no translations/ directory at all.
Core integrations get away with shipping only strings.json because core
generates translations/ as a release step, resolving the `[%key:...%]`
references strings.json uses to avoid duplicating text. Vendoring the
source tree copies the input and leaves out the generated output, so the
defect arrived with commit 48195c9 and would hit anyone who installs
this from HACS.
Rather than hand-write the file once and let it rot on the next upstream
re-sync, scripts/generate_translations.py regenerates it:
- `common::...` references resolve against the *installed* homeassistant
package's own strings.json, so the text matches what core would have
produced for that HA version.
- `component::openai_compatible::...` self-references resolve against
strings.json itself, repeatedly, since a reference can point at another
reference.
- Anything it cannot resolve (an unknown namespace, a reference to a
different integration, a path that does not exist, a marker surviving
the final pass) is a hard error rather than a raw `[%key:...%]` marker
shipped into a label.
All 70 references in strings.json resolve; the generated file carries
config, config_subentries, exceptions, issues, selector and services.
tests/test_translations.py locks it down: en.json must exist, must equal
what the generator produces, and must contain no surviving markers.
Verified the check actually catches drift rather than passing vacuously
-- perturbing one label fails it, and deleting the file fails it.
Local: 141 passed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NxJYWgGJtCw13qUHZtG8ki
The LAN-address scrub replaced 10.10.70.133 with litellm.local in
strings.json, which broke the hassfest job that had been green:
[ERROR] [TRANSLATIONS] Invalid strings.json: the string should not
contain URLs, please use description placeholders instead at
'config.step.user.data_description.base_url'
The rule is not new -- the previous text was equally a URL. It slipped
through because script/hassfest/translations.py's RE_URL requires an
alphabetic TLD ([a-z]{2,5}), so "http://10.10.70.133:4000/v1" never
matched (".133" is not alphabetic) while "http://litellm.local:4000/v1"
does. Verified by running core's actual regex against both strings, so
the scrub did not introduce a violation so much as stop hiding one.
Rather than wire up a description placeholder for what is only an
example, the description now describes the field without any URL:
concrete endpoint examples live in the README, which has no such
constraint. The reauth_confirm step picks this up automatically -- it
references the user step's strings via [%key:...%] rather than copying
them.
Also re-ran core's RE_URL over every string in strings.json, not just
the one hassfest named: 0 remaining violations, so this should not
bounce again on a second string.
Local: 138 passed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NxJYWgGJtCw13qUHZtG8ki