Skip to content

[AI-3] Report the health of the LLM connection - #24889

Open
tangopium wants to merge 1 commit into
feature/66020-pr10-features-and-runtimefrom
feature/66020-pr11-health-status
Open

[AI-3] Report the health of the LLM connection#24889
tangopium wants to merge 1 commit into
feature/66020-pr10-features-and-runtimefrom
feature/66020-pr11-health-status

Conversation

@tangopium

@tangopium tangopium commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Ticket

AI-3

What are you trying to accomplish?

PR 11 of 11 in the AI-3 stack. Adds the health side panel and report page, reusing the HealthReports framework and preparing it for a third consumer. Six validator groups check the configuration, the server, the model catalogue, the capability verdicts, the feature bindings and, only when an administrator explicitly asks, a real inference call, so the scheduled check never spends a billed completion. The scheduled job runs only while a connection is enabled, reports are kept as an audit trail with their own lifecycle distinct from verdicts, and a cron job prunes them because nothing else prunes health_reports.

Merge checklist

  • Added/updated tests
  • Behind the llm_connection feature flag

Stacked on #24888.

@github-actions

Copy link
Copy Markdown

Caution

The provided work package version does not match the core version

Details:

Please make sure that:

  • The work package version OR your pull request target branch is correct

@github-actions

Copy link
Copy Markdown

Caution

The Enterprise plan field is not set on the work package

Details:

Please make sure that:

  • The work package Enterprise plan field is set

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0191122c9c

ℹ️ 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".

Comment on lines +70 to +71
report = Llm::Validators::ConnectionValidator.new(connection).call
report.save!

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve inference failures across scheduled checks

When a manual deep check records an inference failure but /models remains reachable, the next six-hour job omits the inference group and saves its shallow report as the connection's latest report. Because the side panel and full status page only read latest_health_report, that later report can replace the failure with a green status without ever retrying the operation that failed; scheduled results need to retain the latest inference verdict or not supersede a deep report.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deliberately left open: fixing this means either carrying old inference results into new reports or making a deep report sticky, which changes what the latest report means, and re-running inference on the schedule would spend a billed completion. Deferring the semantics to review.

Comment thread app/services/llm/validators/server_validator.rb Outdated
Comment thread app/services/llm/validators/feature_validator.rb
@tangopium
tangopium force-pushed the feature/66020-pr11-health-status branch from 0191122 to df3f328 Compare August 22, 2026 15:05
@tangopium tangopium changed the title [#66020] Report the health of the LLM connection [AI-3] Report the health of the LLM connection Aug 22, 2026
@tangopium
tangopium force-pushed the feature/66020-pr11-health-status branch from df3f328 to bed276b Compare August 22, 2026 15:26
@github-actions

Copy link
Copy Markdown

Warning

Flaky specs

  • rspec ./modules/backlogs/spec/features/inbox_column_spec.rb[1:7:1]
  • rspec ./spec/features/work_packages/table/queries/parent_field_ranking_spec.rb[1:1]
  • rspec ./spec/features/work_packages/table/switch_types_spec.rb[1:1:2]
🤖 Ask Copilot to investigate

Copy 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.

@copilot The following spec(s) are flaky in CI (first seen on PR #24889, linked for reference only):

- `rspec ./modules/backlogs/spec/features/inbox_column_spec.rb[1:7:1]`
- `rspec ./spec/features/work_packages/table/queries/parent_field_ranking_spec.rb[1:1]`
- `rspec ./spec/features/work_packages/table/switch_types_spec.rb[1:1:2]`

Treat this as a standalone task, unrelated to PR #24889. Create a new branch from origin/dev and open a new pull request targeting dev — do not stack it on PR #24889 or reuse that branch.

Follow the playbook in docs/development/testing/handling-flaky-tests/README.md to find the root cause and fix the underlying race — do not skip, delete, or weaken the spec to make it pass; disabling is a last resort per the playbook, and only with a bug ticket. Verify the fix by running the spec(s) repeatedly (e.g. `script/bulk_run_rspec --run-count 10`).

If you cannot reproduce the flake or are not confident in a fix after reasonable investigation, do not fabricate a change or skip the spec to force CI green. Instead, leave the pull request in draft and document what you tried, the suspected cause, and any leads in its description, then assign @tangopium to take over.

Once the fix is verified, title the PR after the spec(s) it fixes, and use the PR description to explain the root cause, how the change resolves it, and the before/after results. Label the PR `flaky-spec`, assign @tangopium, and request a review from @tangopium.
On every commit, set @tangopium as the sole co-author with a `Co-authored-by:` trailer (use their GitHub no-reply email so it links to their account), so it is traceable who dispatched the fix.

@tangopium
tangopium force-pushed the feature/66020-pr11-health-status branch from bed276b to ceca821 Compare August 22, 2026 15:51
@github-actions

Copy link
Copy Markdown

Warning

Flaky specs

  • rspec ./spec/features/work_packages/table/switch_types_spec.rb[1:1:1]
🤖 Ask Copilot to investigate

Copy 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.

@copilot The following spec(s) are flaky in CI (first seen on PR #24889, linked for reference only):

- `rspec ./spec/features/work_packages/table/switch_types_spec.rb[1:1:1]`

Treat this as a standalone task, unrelated to PR #24889. Create a new branch from origin/dev and open a new pull request targeting dev — do not stack it on PR #24889 or reuse that branch.

Follow the playbook in docs/development/testing/handling-flaky-tests/README.md to find the root cause and fix the underlying race — do not skip, delete, or weaken the spec to make it pass; disabling is a last resort per the playbook, and only with a bug ticket. Verify the fix by running the spec(s) repeatedly (e.g. `script/bulk_run_rspec --run-count 10`).

If you cannot reproduce the flake or are not confident in a fix after reasonable investigation, do not fabricate a change or skip the spec to force CI green. Instead, leave the pull request in draft and document what you tried, the suspected cause, and any leads in its description, then assign @tangopium to take over.

Once the fix is verified, title the PR after the spec(s) it fixes, and use the PR description to explain the root cause, how the change resolves it, and the before/after results. Label the PR `flaky-spec`, assign @tangopium, and request a review from @tangopium.
On every commit, set @tangopium as the sole co-author with a `Co-authored-by:` trailer (use their GitHub no-reply email so it links to their account), so it is traceable who dispatched the fix.

Adds the health side panel and report page, reusing the HealthReports framework and preparing it for a third consumer. Six validator groups check the configuration, the server, the model catalogue, the capability verdicts, the feature bindings and, only when an administrator explicitly asks, a real inference call, so a scheduled check never spends a billed completion.

The scheduled Llm::HealthCheckJob runs only while a connection is enabled, toggled from the update service and the disconnect action. Reports are kept as an audit trail with their own lifecycle, distinct from verdicts, and pruned by a cron job because nothing else prunes health_reports.

Part 11 of the AI-3 stack.

https://community.openproject.org/work_packages/66020
@tangopium
tangopium force-pushed the feature/66020-pr11-health-status branch from ceca821 to 761b2d4 Compare August 22, 2026 16:16
@github-actions

Copy link
Copy Markdown

Warning

Flaky specs

  • rspec ./spec/features/work_packages/table/queries/parent_field_ranking_spec.rb[1:1]
  • rspec ./spec/features/work_packages/table/switch_types_spec.rb[1:1:1]
  • rspec ./spec/features/work_packages/table/switch_types_spec.rb[1:1:2]
🤖 Ask Copilot to investigate

Copy 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.

@copilot The following spec(s) are flaky in CI (first seen on PR #24889, linked for reference only):

- `rspec ./spec/features/work_packages/table/queries/parent_field_ranking_spec.rb[1:1]`
- `rspec ./spec/features/work_packages/table/switch_types_spec.rb[1:1:1]`
- `rspec ./spec/features/work_packages/table/switch_types_spec.rb[1:1:2]`

Treat this as a standalone task, unrelated to PR #24889. Create a new branch from origin/dev and open a new pull request targeting dev — do not stack it on PR #24889 or reuse that branch.

Follow the playbook in docs/development/testing/handling-flaky-tests/README.md to find the root cause and fix the underlying race — do not skip, delete, or weaken the spec to make it pass; disabling is a last resort per the playbook, and only with a bug ticket. Verify the fix by running the spec(s) repeatedly (e.g. `script/bulk_run_rspec --run-count 10`).

If you cannot reproduce the flake or are not confident in a fix after reasonable investigation, do not fabricate a change or skip the spec to force CI green. Instead, leave the pull request in draft and document what you tried, the suspected cause, and any leads in its description, then assign @tangopium to take over.

Once the fix is verified, title the PR after the spec(s) it fixes, and use the PR description to explain the root cause, how the change resolves it, and the before/after results. Label the PR `flaky-spec`, assign @tangopium, and request a review from @tangopium.
On every commit, set @tangopium as the sole co-author with a `Co-authored-by:` trailer (use their GitHub no-reply email so it links to their account), so it is traceable who dispatched the fix.

@github-actions

github-actions Bot commented Aug 22, 2026

Copy link
Copy Markdown

Deploying openproject with PullPreview

Field Value
Latest commit 761b2d4
Job deploy
Status ✅ Deploy successful
Preview URL https://pr-24889-66020-pr11-heal-ip-167-233-212-193.my.opf.run:443

View logs

@tangopium
tangopium requested a review from thykel August 22, 2026 21:40
@tangopium tangopium self-assigned this Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant