You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(install): the self-check runner, its report, and the chat, model kinds and embeddings probes (#20447) - #20474
Install and update report success on presence, and on 2026-10-26 a local install passed every check while embeddings, uploads and retrieval were broken (#19739). #19740 asks for a self-check that exercises each function. This is its runner and first three probes; the maintainer decided it logs in with a dedicated account.
What Changed
autobot-infrastructure/shared/scripts/post_install_self_check.py: logs in the way a browser does, runs each probe, prints PASS or FAIL naming the probe, the expected result and what came back, writes a JSON report with timestamp and commit, and exits non-zero on any failure. Running no probes is a failure. Standard library only.
SELF_CHECK_CA_FILE for an install with its own certificate. A probe's own crash is reported as that probe's failure.
The embeddings probe passes only on a measurement taken during the check. /api/system/health now gives embedding_measured_age_s and embedding_refresh_within_s, and the check waits as long as the backend says its cache can take (360 s by default), so on a long-running backend it can take that long. A cached failure from before the check is measured again rather than failing the run.
The CA file comes from the env given to main. Outcomes print before the report is written, and an unwritable report fails the run.
Verification
post_install_self_check_20447_test.py passes locally; only this was run. It uses a real local HTTP server replying in the routes' real shapes, pinned to source by a test, and the real kind script with a fake model CLI. Each probe has planted faults, the password reaches neither the output nor the report, and no-login, nothing-to-judge and no-probes all fail. Not run against a real backend, so the routes and reply shapes rest on my reading of the code, not on a live call.
The chat fallback is matched by its text, because the 200 reply carries no error flag. A test pins that string to api/chat.py, so a reword goes red rather than passing falsely. A different failure wording elsewhere in that path would not be caught.
It reads urllib directly rather than through the guarded fetch: the target is the install's own backend, and it must run before a venv is known to be sound.
Adds a standard-library script that logs in and checks chat, embedding health, and model kinds. It records probe results, can write a JSON report, and returns a failing status when checks or report writing fail. The embedding health response now reports measurement age when a measurement exists.
Changes: Post-install self-check
Layer / File(s)
Summary
Probe configuration and authentication autobot-infrastructure/shared/scripts/post_install_self_check.py, autobot-backend/api/embedding_model_health.py
Adds probe settings and result types, HTTP and JSON helpers, login handling, and an embedding measurement age field.
Chat, embedding, and model-kind probes autobot-infrastructure/shared/scripts/post_install_self_check.py, autobot-backend/api/embedding_model_health_test.py, repo_tests/post_install_self_check_20447_test.py
Adds chat session validation and cleanup, embedding health polling, and model-kind checks. Tests cover probe results, failures, and the measurement age assertion.
Probe execution and reporting autobot-infrastructure/shared/scripts/post_install_self_check.py, repo_tests/post_install_self_check_20447_test.py
Adds probe result collection, JSON report writing, entry-point exit handling, and tests for login and report failures.
Merge Risk: Moderate · previous review e6717
The self-check currently reports chat failure against a healthy backend and leaves its session behind. Embedding checks can also falsely fail after recovery or with longer cache settings. Correct these behaviors before relying on the installation check.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 27.27% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly identifies the main change: the install self-check runner and its chat, model-kinds, and embeddings probes.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
Docstring coverage is 27.27% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 22 functions across 4 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
Notice: 29 open PRs — past the runaway threshold (25)
This is not a request to defer this PR. There is no cap on open PRs (#19397) -- nothing blocks opening or pushing a PR.
This notice only means the count is high enough to be worth a glance for a runaway — something opening PRs in a loop, or a merge pipeline that has stalled so nothing is draining.
If the queue is draining normally, ignore this. Otherwise:
Check whether CI is dispatching at all — see the ci-dispatch-watchdog status on these PRs
Approved PRs land through the merge train the coordinator sequences (merge commits, never squash) -- check the open chore(merge-train) PR is moving, not each PR on its own
Look for a loop opening near-identical PRs
Warn-only runaway detector — .github/workflows/pr-queue-gate.yml. It never blocks a merge.
Assert the login request body in the self-check fixture.
The stack fixture returns a token for /api/auth/login whatever the request contains, and do_POST discards the body. The success test checks only that Bearer tok was sent. A runner that sends a wrong or misnamed password still passes. Record the login body in the fixture and assert that username and password carry the dedicated-account values.
Record the submitted chat prompt in the self-check fixture.
do_POST reads the request body and discards it. _answer then picks the reply by path alone, so the fixture returns "Hello." whatever the runner sends. The runner posts CHAT_PROMPT as content at autobot-infrastructure/shared/scripts/post_install_self_check.py:113, and the probe passes on any non-empty reply that does not start with CHAT_ERROR_REPLY (line 115). Neither the verdict nor any test assertion depends on the prompt. A change that empties or corrupts CHAT_PROMPT would therefore still pass. Store the decoded request body in the handler and assert that content equals check.CHAT_PROMPT.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
Code review on PR #20474 (head fb378ec): approve. Delta since 5dae83b, read only: embeddings reads probes from the public health route, chat creates and deletes its own session, and the reply shapes are pinned to source by substring. Check in CI: the egress guard on urlopen. Not run against a live backend.
Auto-sync: merging main into issue-20447-self-check conflicts
The sync aborted the merge and pushed nothing. Conflicts are information, so it never resolves one itself. Below, for each conflicted file, are the commits that touched it on each side since the merge base f88cd3756a. Merge main in yourself and push; the label clears on the first run that finds this branch 0 behind.
repo_tests/frontend_url_served_by_19326_test.py
side
commit
subject
issue refs
main
8e17b7290
fix(train): reach floors return to mid-window on the merged tree (#20444)
Code review on PR #20474 (head 9742727): approve. Delta since fb378ec: a failed session delete adds to the chat failure rather than replacing it, with a test.
Covers the delta since e6717f4, read only; tests not run. The wait follows embedding_refresh_within_s (TTL plus timeout) from the health data, with the constant as a floor, so a raised TTL can't make the check impossible. A cached failure keeps polling, and a failure measured during the check fails it. EMBEDDING_WAIT_S stays as the floor value and has no caller yet in the install path.
Code review on PR #20474 (head 109e99f): approve. Covers commit 109e99f, read in full; tests not run. An unreadable CA file is now inside the try and becomes a named failure, and any exception in the chat step still deletes the session.
The range holds the fix 51d86125b6 plus main auto-sync merges. The GitHub head is a59a55fb2c.
Severity
File:line
Issue
Fix
Low
repo_tests/post_install_self_check_20447_test.py
Nothing pins ABSENT-stays-exit-0 at the self-check level. The script is untouched by this delta, so the behaviour is intact, but an ABSENT-only run is not covered.
Optional: add a probe test where the model-kinds script prints ABSENT x plus OK y and exits 0.
201 is what the route returns.create_session in chat_sessions.py returns create_chat_response(..., status_code=201), which builds a JSONResponse with that status. The new test slices the function body and asserts status_code=201, appears in it, so it follows the route.
Control test. A create answered 200 now fails with "HTTP 201 from session create".
ABSENT stays exit 0 (#2950).check_model_kinds.sh has no diff in this range and still exits 0 for ABSENT. FAILING_KINDS in the probe excludes ABSENT, so the probe only fails on a non-zero exit, a failing kind line, or no OK verdict at all.
A delta review of 109e99f..a59a55f. create_session returns 201 through create_chat_response, and the probe now accepts it (a 200 fails, as pinned by a test). ABSENT still exits 0 per #2950. Low, optional: no self-check test pins ABSENT staying exit 0.
Branch audit (zero-change deletion). This PR shows 0 changed files against main (head bc45178125): every change it carried is already in main. Closing and deleting the branch through this PR; it can be restored with the Restore branch button below.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
phase:M1.4Wizard and SLM: choose a mode, apply it, default models work
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thinking Path
Install and update report success on presence, and on 2026-10-26 a local install passed every check while embeddings, uploads and retrieval were broken (#19739). #19740 asks for a self-check that exercises each function. This is its runner and first three probes; the maintainer decided it logs in with a dedicated account.
What Changed
autobot-infrastructure/shared/scripts/post_install_self_check.py: logs in the way a browser does, runs each probe, prints PASS or FAIL naming the probe, the expected result and what came back, writes a JSON report with timestamp and commit, and exits non-zero on any failure. Running no probes is a failure. Standard library only.Probes: chat creates its own session, asks
POST /api/chata fixed prompt, treats the backend's 200 fallback error reply as a failure, and deletes the session either way (a session left behind fails the probe). model kinds uses the onecheck_model_kinds.sh, judged by verdict lines and exit code, so it holds before and after fix(install): the model-kind check fails on what it could not establish (#19886, #19854, #19888) #20419, with a timeout. embeddings reads the public/api/system/healthprobesentryembedding_model: ok, and a real embedding measured. So feat(install): install and the builtin update run the self-check and fail on a failing probe #20450's account needs no admin role.SELF_CHECK_CA_FILEfor an install with its own certificate. A probe's own crash is reported as that probe's failure.The embeddings probe passes only on a measurement taken during the check.
/api/system/healthnow givesembedding_measured_age_sandembedding_refresh_within_s, and the check waits as long as the backend says its cache can take (360 s by default), so on a long-running backend it can take that long. A cached failure from before the check is measured again rather than failing the run.The CA file comes from the
envgiven tomain. Outcomes print before the report is written, and an unwritable report fails the run.Verification
post_install_self_check_20447_test.pypasses locally; only this was run. It uses a real local HTTP server replying in the routes' real shapes, pinned to source by a test, and the real kind script with a fake model CLI. Each probe has planted faults, the password reaches neither the output nor the report, and no-login, nothing-to-judge and no-probes all fail. Not run against a real backend, so the routes and reply shapes rest on my reading of the code, not on a live call.Worth reviewing:
api/chat.py, so a reword goes red rather than passing falsely. A different failure wording elsewhere in that path would not be caught.urllibdirectly rather than through the guarded fetch: the target is the install's own backend, and it must run before a venv is known to be sound.Model Used
Claude Opus 5.5
Refs #20447
🤖 Generated with Claude Code