[AI-3] Let administrators curate which models are offered - #24885
[AI-3] Let administrators curate which models are offered#24885tangopium wants to merge 1 commit into
Conversation
|
Caution The provided work package version does not match the core version Details:
Please make sure that:
|
|
Caution The Enterprise plan field is not set on the work package Details:
Please make sure that:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d70e87f0a3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
d70e87f to
710d953
Compare
710d953 to
c87520f
Compare
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
c87520f to
b598b30
Compare
Adds a toggle to each model row that hides it from the default-model pickers or puts it back, stored as deactivated_at rather than in active, which the catalogue sync owns and rewrites on every refresh. Curation, not enforcement: anything already pointing at a hidden model keeps resolving, so switching a row off can never silently break a running feature. With a curated list to choose from, the connection form gains the default chat model selector, backed by a contract validation that a designated default must be a model the server actually reported. It is validated only on change, so a catalogue that shrinks underneath a stored selection does not block every unrelated save. Part 7 of the AI-3 stack. https://community.openproject.org/work_packages/66020
b598b30 to
3ccc2d0
Compare
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
thykel
left a comment
There was a problem hiding this comment.
🏃♂️ Looks nice, getting there!
One additional observation: Currently, whenever I toggle the new button, I have to actually refresh the page to see the updated state within the table. This could feel a bit more lively.
However, the above point may be moot, since the only column that gets updated ("Source") is also the one that I propose to actually leave alone.
|
|
||
| require "spec_helper" | ||
|
|
||
| RSpec.describe LlmModel, "deactivation", :llm_server_helpers, :webmock, |
There was a problem hiding this comment.
This is an oddly specific test suite, which does not fit our convention. Please establish a generic model spec which contains deactivation scenarios.
| attribute :default_chat_model_id | ||
| attribute :default_embedding_model_id |
|
|
||
| private | ||
|
|
||
| # The mirror image of default_embedding_model_can_embed: a model the server |
There was a problem hiding this comment.
default_embedding_model_can_embed does not exist yet. 👀
| expect(connection.selectable_model_ids).to include("bge-m3") | ||
| end | ||
|
|
||
| # administrator switches off must never silently break a running feature. |
There was a problem hiding this comment.
🤖 #Testing
This comment has lost its first half, and it looks like it is marking a test that did not make it in.
The sentence it belongs to is the headline claim of the PR - "Curation, not enforcement: anything already pointing at a hidden model keeps resolving" - and it is asserted again in LlmModel#selectable?: "a feature already bound to a deactivated model keeps working... Switching a row off must never silently break a running feature."
The three examples here cover hiding from the pickers, surviving a sync, and being distinct from withdrawn. None covers that claim. The behaviour does exist in two places worth pinning down:
default_models_offered_by_servervalidates againstavailable_model_ids, which includes deactivated models, so a stored default pointing at a hidden model still saves.default_chat_model_optionskeeps the already-chosen id in the list, which exists precisely so a save cannot silently blank the field.
Could we add a case for each, and either finish or drop the comment? Whichever shape the file ends up in after the restructuring suggested above, these seem worth keeping.
| # Withdrawn wins over hidden: the withdrawal is why the toggle is inert, | ||
| # and an administrator needs that explanation more than their own choice. | ||
| return %i[attention source_withdrawn] if llm_model.withdrawn? | ||
| return %i[attention source_deactivated] if llm_model.deactivated? |
There was a problem hiding this comment.
🤖 #Design
With this branch added, the ladder is withdrawn -> deactivated -> manual -> discovered, so a manually added model that an administrator switches off renders as "Hidden by administrator" and loses "Added manually". One column is answering both "where did this model come from" and "may it be used", and only the first of those has nowhere else to live.
This PR also adds the Status column right beside it, whose toggle already shows hidden versus shown - so the state is now rendered twice, and the duplicate is the one that costs us the provenance.
Would it work to leave Source as provenance only (Added manually / Reported by server / No longer reported) and let the toggle carry the administrator's choice on its own?
Minor related point: source_withdrawn and source_deactivated both render with :attention, so "the server stopped offering this" and "an administrator hid this" look identical while meaning quite different things.
There was a problem hiding this comment.
The above is a bit long-winded, but we already hit upon the same point during the UX review -- the toggle shouldn't override the source field with completely different semantics.

Ticket
AI-3
What are you trying to accomplish?
PR 7 of 11 in the AI-3 stack. Adds curation: a toggle per model row hides it from the default-model pickers or puts it back, stored as
deactivated_atrather than inactive, which the sync owns and rewrites on every refresh. Curation, not enforcement: anything already pointing at a hidden model keeps resolving. With a curated list to choose from, the connection form gains the default chat model selector, validated against the catalogue only on change so a shrinking catalogue does not block unrelated saves.Merge checklist
llm_connectionfeature flagStacked on #24884.