Skip to content

Release 0.5.5: pick the chat's model per question - #13

Merged
codeministry merged 4 commits into
mainfrom
feature/025-chat-model-select
Oct 12, 2026
Merged

codeministry merged 4 commits into
mainfrom
feature/025-chat-model-select

Conversation

@codeministry

Copy link
Copy Markdown
Owner

The chat's model is picked per question, from the local connection or an optional hosted one, and the version moves to 0.5.5. The tag v0.5.5 follows the merge.

What changes

  • chat.connection (CHAT_LLM_*): an optional second connection beside llm, read by the chat alone, with a daily ceiling of its own (default 50) taken in one transaction with the chat's. llm.billed / chat.connection.billed mark paid models.
  • GET /api/v1/chat/models: the tool-capable models each connection reports, read from the connection, never from an allowlist. A turn may name only a model the server listed itself; anything else is a 400 before a model is called. chat_turn.connection (V37) records who answered.
  • The drawer's select beside the composer: grouped by connection, billed models marked, a spent or unreachable connection disabled with its reason; a new conversation always starts on the default, a reopened one on its last turn's model; no fallback between models.
  • The chat panel loads on its first open (@defer): initial bundle 1.00 MB → 868 kB.
  • Touch icon for every apple-touch-icon variant (already on main since 0.5.4).

Spec specs/025-chat-model-select (12/12 claims, complete). Reasoning in docs/decisions/chat.md § A second connection, discovered, not allowlisted.

Review five rounds of code review and security review on the branch; the security review found nothing at confidence ≥ 8. Accepted findings and three follow-ups are recorded in the project's working notes.

Verification ./gradlew build green on the final tree (backend 1234 cases, units 1147, browser suite green), production build 868 kB initial. Deployed as dev image 0.5.5-dev.7-gbf6d54e on the office instance with an Anthropic second connection; the key answers GET /v1/models with 200 from the pod.

Deploy note the office chart carries chat.connection and the CHAT_LLM_* env (devops 355e8a3); an override pipeline.yaml without the block simply runs the chat on llm alone.

…ed connection

The chat answered with one model of the single provider every stage shares. An optional
second connection, `chat.connection` (`CHAT_LLM_*`), sits beside `llm` and only the chat
reads it. The drawer's select lists the tool-capable models each connection reports, read
from the connection rather than from an allowlist; a turn may name only a model the server
listed itself, and anything else is a 400 before a model is called.

- The pick may change between questions and on regenerate; a new conversation always
  starts on the configured default, a reopened one on its last turn's model. Nothing is
  kept in the browser's storage, and there is no fallback between models.
- `chat_turn.connection` (V37) records who answered; the turn event and the stored turn
  name model and connection, and every answer shows its model.
- The second connection has a daily ceiling of its own (default 50), taken in one
  transaction with the chat's, so a refused call counts on neither; `GET /chat/status`
  names both counters.
- `billed` on each connection marks paid models in the select and under the answer;
  empty means billed for `anthropic` only.
- The masker covers both connections; the startup banner shows the second connection
  with its key masked. Suggestions and the semantic tool stay on the primary connection.

New endpoint `GET /api/v1/chat/models`. Reasoning in docs/decisions/chat.md.
The model select pushed the initial bundle 3.55 kB past its 1 MB budget, and the production
build refused it. The chat drawer's content and its libraries loaded on every page although
most visits never open it. The panel now sits behind `@defer (when chatOpen())`, where
`chatOpen` is "a chat model exists and `?chat` is set", so a reload with `?chat=…` still opens
it with its content. Once loaded it stays. The header button, its living mark, the minibar and
the store stay in the shell.

The panel seeds its followed-source comparison from the router's URL when it is built, because
the navigation that opened the chat has already happened by then; without that, the first
followed source on a phone no longer folded the sheet into the bar.

Initial bundle 1.00 MB → 867.29 kB; the `chat-panel` chunk is 139.62 kB. The budget is
unchanged.
Spec 025-chat-model-select (ISC-505, ISC-506, ISC-510, ISC-511, ISC-512).

- The catalog never holds a lock across the network: discoveries are shared
  per configuration snapshot, read concurrently, cached from their completion,
  and an interrupted one is neither cached nor handed on.
- Reasons are fixed texts and logs carry only the exception class; a key with
  a control character is refused before any header is built, and a request
  carrying a key never follows a redirect.
- A connection that needs a key and has none is listed unreachable; the rule
  lives once, in Providers.missing.
- The select names the default explicitly (defaultModelName), drops a pick the
  catalog no longer offers or whose connection is spent, and keeps the user's
  pick while no catalog is loaded; the catalog is asked on every drawer open.
- The status is kept while it reloads, and a failed refresh shows beside it.
- docs/DATA-MODEL.md covers chat_turn.connection and the per-connection budget.
The chat's model select with an optional second connection (spec 025), the chat panel loaded on its first open, and the touch icon for every apple-touch-icon variant. Same seven files as the 0.5.4 bump; StatusControllerTest and app.spec pass.
@codeministry
codeministry merged commit fbaf20b into main Oct 12, 2026
6 checks passed
@codeministry
codeministry deleted the feature/025-chat-model-select branch October 12, 2026 14:36
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