Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 8d496a0

Browse files
committed
DEV: Use full URL for problem check message
1 parent fff0bc0 commit 8d496a0

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

app/services/problem_check/ai_llm_status.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ def call
88
llm_errors
99
end
1010

11-
def base_path
12-
Discourse.base_path
13-
end
14-
1511
private
1612

1713
def llm_errors
@@ -28,7 +24,13 @@ def try_validate(model, &blk)
2824
rescue => e
2925
error_message = parse_error_message(e.message)
3026
message =
31-
"#{I18n.t("dashboard.problem.ai_llm_status", { base_path: base_path, model_name: model.display_name, model_id: model.id })}"
27+
I18n.t(
28+
"dashboard.problem.ai_llm_status",
29+
{
30+
url: "#{Discourse.base_path}/admin/plugins/discourse-ai/ai-llms/#{model.id}/edit",
31+
model_name: model.display_name,
32+
},
33+
)
3234

3335
Problem.new(
3436
message,

config/locales/server.en.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,4 +484,4 @@ en:
484484
prompt_message_length: The message %{idx} is over the 1000 character limit.
485485
dashboard:
486486
problem:
487-
ai_llm_status: "The LLM model: %{model_name} is encountering issues. Please check the <a href='%{base_path}/admin/plugins/discourse-ai/ai-llms/%{model_id}/edit'>model's configuration page</a>."
487+
ai_llm_status: "The LLM model: %{model_name} is encountering issues. Please check the <a href='%{url}'>model's configuration page</a>."

spec/services/problem_check/ai_llm_status_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
it "returns a problem with an LLM model" do
4343
stub_request(:post, post_url).to_return(status: 403, body: error_response, headers: {})
4444
message =
45-
"#{I18n.t("dashboard.problem.ai_llm_status", { base_path: Discourse.base_path, model_name: llm_model.display_name, model_id: llm_model.id })}"
45+
I18n.t("dashboard.problem.ai_llm_status", { model_name: llm_model.display_name, url: "/admin/plugins/discourse-ai/ai-llms/#{llm_model.id}/edit" })
4646

4747
expect(described_class.new.call).to contain_exactly(
4848
have_attributes(

0 commit comments

Comments
 (0)