mirror of
https://github.com/discourse/discourse.git
synced 2026-08-11 02:59:07 +08:00
## Summary - The "Run Test" button on the Discourse AI LLM admin form only issued a non-streaming completion, so configurations that worked for that probe could still fail in production when a streaming response was requested. - `LlmValidator#run_test` now runs the non-streaming probe followed by a streaming probe (block-form `Llm#generate`) and raises if either returns nothing. It tracks `last_failed_mode` (`:non_streaming` / `:streaming`). - The controller surfaces `failed_mode` in the JSON response and the admin form renders a mode-specific error string so operators can see which path is broken. - Per-user rate limit on `POST /admin/plugins/discourse-ai/ai-llms/test` doubled (3 → 6 / minute) to absorb the extra request per click. ## Test plan - [ ] `bin/rspec plugins/discourse-ai/spec/configuration/llm_validator_spec.rb` - [ ] `bin/rspec plugins/discourse-ai/spec/requests/admin/ai_llms_controller_spec.rb -e "POST #test"` - [ ] In admin UI, click "Run test" on an LLM config and confirm both probes are exercised (success path). - [ ] Configure an endpoint where streaming is broken and confirm the form reports "Streaming request failed: …". |
||
|---|---|---|
| .. | ||
| agent_enumerator.rb | ||
| embedding_defs_enumerator.rb | ||
| embedding_defs_validator.rb | ||
| embeddings_module_validator.rb | ||
| feature.rb | ||
| llm_dependency_validator.rb | ||
| llm_enumerator.rb | ||
| llm_validator.rb | ||
| llm_vision_enumerator.rb | ||
| module.rb | ||
| simple_llm_validator.rb | ||
| spam_detection_validator.rb | ||