A platform admin picks the chatbot model for each tenant and decides what happens when the chatbot is busy. This page shows how each of the nine PRs was checked, in merge order, so you can trust the work without reading the raw logs.
SP-893 · 30 Nov 2026
Status as of 30 Nov 2026
Stage
In review. All nine PRs are open. Nothing is merged, nothing is on beta, and nothing is in a production tag.
Verdicts
Eight PRs passed an independent check. G (Gemini) is built and tested offline only. It waits for a Gemini key with credit. R2 is proven for OpenAI and Anthropic, and its Gemini checks wait for the same key.
Heads
Checked with GitHub today. Every PR head matches the head named on this page. No head moved.
Review gate
L4, L2 and L6 change what people see. The operator reviews their screenshots and videos before they merge.
All screenshots and videos come from local stacks with demo tenants and fake keys. The names are not real. The admin's name in the corner of the admin screens is covered. None of this was run on beta.
Why this exists
Today the chatbot answers every tenant with one model on the SkillPixel key. A tenant that brings its own key still runs its chatbot on the SkillPixel key. SP-893 lets a platform admin choose the chatbot model for each tenant from the existing model list. An own-key tenant's chat then runs on its own key. When the model hits a rate limit or the key fails, the learner sees one clear busy message: "The AI assistant is busy right now. Please try again in a few minutes."
What changed, in one picture
L2, L6
Admin picks
The platform admin picks a chatbot model and sets the busy hand-off switch.
→
L1
LMS stores it
The LMS saves only a choice the tenant can run, and clears it when the key setup changes.
→
L3
LMS sends it
Each learner message carries the model, plus the key for an own-key tenant.
→
R1, G, R2
Chatbot builds it
The chatbot builds that model for one request, with no fallback model and one retry.
→
L4
Learner sees
An answer, or the busy message. A switch decides whether a human then takes over.
L7 is separate. It keeps request values out of validation errors anywhere in the LMS backend.
How each PR was checked
Independent verifier. A separate agent, not the author, checked each PR head. Several PRs went through fix rounds. This page reports the last verdict.
Fail before, pass after. The new tests ran on the code before the fix and failed. Then they passed on the PR. This shows the tests catch the problem.
Live lanes. A lane is one scenario from the plan, run against real servers with real requests. Chatbot lanes used real OpenAI and Anthropic keys. Bad-key lanes used fake keys.
Key scans. Every captured reply and log was searched for each key, its last 8 characters, and every 8-character piece of it.
Speed checks. Before and after, in alternating order, against a limit set in the plan.
When a model provider or a search service fails, the chatbot's reply and its logs name only the error type and status, for example "ModelAuthenticationError (status 401)". Provider error text can hold part of a key, so it no longer reaches replies, stream events, tool results or logs. Internal errors still log their stack frames, so engineers can trace them. Successful replies do not change.
Head
Verified at 76cd6fd. The head 1afcef8 is the same change, rebased onto main after its parent PR merged. Its patch is identical. The GitHub build check passed at 1afcef8.
Tests
56 passed, 10 skipped. On the code before the fix, 14 of the 16 new tests failed. The other 2 cover paths that the earlier head had already fixed. All 16 pass on the PR.
Live lanes
Real chatbot servers ran with a fake key against the real OpenAI API, and a fake web-search key. Ten error paths were checked, including a document search inside a chat, an upload, a tool error and the history summary. Every path showed 0 key pieces in replies and logs, and internal errors kept their stack frames. Nine of the ten plan lanes passed: a normal chat equal to before, fake OpenAI and Anthropic keys, an unknown model, an upload, a missing tenant header, and five chats in a row. Lane 7 was not rerun because the fix does not touch that code.
Speed
The fix changes only error handling. The success path was timed at the earlier head with medians of 0.939 s before and 0.848 s after.
Media
None. This is a backend change.
G. The chatbot can run Gemini
Built and tested offline. Not yet proven live.Head 57078db · lms-ragflow #15
For users
The chatbot can answer with a Gemini model. A short failure, such as a rate limit, a timeout or a server error, is retried once on the same model and key. Gemini errors go through the R1 redaction, so a reply shows only the error type and status.
Tests
63 passed, 10 skipped, after G was rebased onto the R1 fix. A local Gemini stand-in server checked tool calls, the replay of Gemini's thought signatures, usage counts, the retry limit and error redaction. The sources record no fail-before run for G.
Live lanes
Not run. The Gemini key has no credit, so no real Gemini chat has been made. During the R2 checks, the real Gemini service did reject a fake key as expected.
Speed
Not measured. It waits for a funded key.
R2. The chatbot builds the model for each request
Verified for OpenAI and AnthropicGemini blockedHead 08a695e · lms-ragflow #16
For users
The LMS can name the model for each chat and send an own-key tenant's key. The chatbot builds that model for that one request.
A chat on a tenant key uses only what the request sent. It never falls back to a SkillPixel key or a SkillPixel provider setting.
There is no fallback model. A failed call is tried at most once more, on the same model and key.
A failed chat reports one of three codes: rate_limited, key_rejected or failed. The LMS turns the first two into the busy message.
Each usage record says whether the tenant's key or the SkillPixel key paid. Document search always runs on the SkillPixel key.
A chat that names no model works as it does today.
A failed history summary no longer erases the earlier messages. The next message tries again.
Head
Three verifier rounds. The first found no blocker but listed fixes. The second found gaps, which were fixed. The third passed the code at d179243. The head 08a695e then changed only the wording of the docs and the PR description.
Tests
124 passed, 10 skipped. Fail before, pass after, in each round. All 27 new model-choice tests failed on the parent branch. 33 tests added or changed in round 1 failed on the round 1 head. The 5 tests added in round 2 failed on the round 2 head. All pass on the PR.
Live lanes
Four real servers, with real OpenAI and Anthropic keys and fake keys.
A chat with no model matched the code before the change.
Claude on the SkillPixel key, and OpenAI on a tenant key with document search, both answered. The chat ran on the tenant key and the search ran on the SkillPixel key.
Fake tenant keys gave key_rejected with no usage recorded. Eleven malformed requests were refused before any model call.
Ten rounds of mixed chats at the same time: 40 of 40 replies used only their own model and key.
Streams cut in the middle of a call left nothing open. Twenty tenant chats in a row left no extra connections.
Key scans: 0 pieces in 4 server logs and over 120 replies in round 1, 0 in 114 replies in the next round, and 0 in the final round.
The Gemini part of the mixed-chat lane is blocked until the key has credit.
Speed
A chat with no model: 1.5% and 2.7% faster than before in two runs, which is inside the noise. A chat on a tenant key: 56 ms and 99 ms slower than the default, against a 400 ms limit. The cost is one new secure connection per request, about 96 ms.
The LMS backend stores one chatbot model per tenant, chosen from the existing managed-model list. The settings response lists every option and whether this tenant can run it. The backend refuses an unknown model or one the tenant cannot run. When a change to the key mode, provider, address or key means the tenant can no longer run its choice, the LMS clears the choice and the chatbot goes back to its default model. GPT-5.6 Luna was added as a beta option.
Head
Verified at 78a1da0. The head 69c7c66 is the same change, rebased onto main. Its patch is identical.
Tests
3,720 unit tests passed and 1 skipped. 813 database tests in the 16 related files passed on PostgreSQL 17. Three new database tests failed before the fix and pass after it. The type-check count did not change (2,558 before and after). GitHub CI passed lint, unit tests, database tests, the migration check and review.
Live lanes
A real API on a real PostgreSQL database. Lanes 2 to 10 passed at the earlier head, and lanes 2, 3, 6 and 8 again at the verified head. The clearing rule was driven through both the platform-admin and the tenant-admin routes. Five pairs of writes at the same time kept both settings every time. A scan of 85 API responses, the server log, the stored settings and the audit rows found 0 key matches.
Speed
Reading the settings got 12.8 ms slower, against a 20 ms limit. This was measured at the earlier head. The fix adds one more decrypt on each read, which the root accepted.
The learner sees "The AI assistant is busy right now. Please try again in a few minutes." In Vietnamese it reads "Trợ lý AI đang bận. Vui lòng thử lại sau vài phút." The chat header stays "Online". The next message shows the typing state and then a normal AI answer. Before the fix, a busy message switched the header to "Human agent" and the next message got no typing state. The existing fallback message still hands the chat to a human, as the backend expects.
Tests
14 of 14 chat hook tests and 24 of 24 chat tests pass. With the old hook code, the 2 busy tests fail with "expected true to be false". On Windows, the full frontend suite has failures in 4 files that fail the same way on trunk. GitHub CI "Frontend Lint & Build" passes.
Live lanes
The real LMS frontend ran in Vite, with a mocked API, websocket and sign-in. Lanes 1, 2, 3, 5, 6, 7 and 9 passed, over both polling and the websocket. The real backend sending the busy message is proven in L3, not here.
Speed
The chat bundle grew from 20.72 kB to 20.78 kB.
Media
Four close-ups of the chat window and a 31 s video, below.
English. The busy message appears and the header still says "Online".Vietnamese. The same message in the learner's language.Retry. The learner asks again and gets a normal AI answer.Before the fix. The header wrongly showed "Human agent".
L4 review video, 31 s, no sound. The learner opens the chat, asks a question and gets the busy message. Then the learner asks again, sees "Typing..." and gets the answer.
On a tenant's AI settings page, platform admins get a "Chatbot model" picker with its own Save button. Options the tenant cannot run are greyed out with a reason. If a saved choice can no longer run, its reason shows under the picker and the admin can clear it back to Default.
Tests
238 tests passed. TypeScript, lint and the production build passed. The new picker test fails on L1 and on each earlier commit of this PR, and 6 of 6 pass on the head. The regenerated API client is byte for byte the same as the committed one.
Live lanes
Ten lanes and two extra checks against a real backend: default, save Claude, reload, clear, own-key Anthropic options, archived tenant, save with the backend stopped, dark mode, keyboard only, a saved choice that cannot run, and OpenRouter options. Users who are not platform admins get 401 or 403. The rest of the page is the same as before.
Speed
Median time until the page is ready: 798 ms before and 728 ms after, against a limit of 100 ms slower.
Media
Two screenshots and a 41 s video, below.
A managed demo tenant. Claude Sonnet 5.5 is saved as the chatbot model. The toast says "Chatbot model saved".An own-key demo tenant on Anthropic. Only the three Claude models can be picked. The others say "Incompatible with the tenant's own key".
L2 review video, 41 s, no sound. The admin opens the picker, saves Claude Sonnet 5.5, then clears it back to Default. The grey box in the lower left covers the admin's name.
On every learner message the LMS checks the tenant's saved choice. A managed tenant with no choice sends the same request as today. A managed choice sends the model name. An own-key tenant also sends its own key.
When the chatbot reports a rate limit or a rejected key, or the choice cannot run, the learner sees the busy message.
The busy hand-off switch is on by default. Then a human agent also takes the chat. When it is off, the AI keeps the chat and the learner can try again.
Usage is recorded against the key that paid.
Admins cannot save a choice or a key that can never run. A key with a line break, tab, control character or non-English character inside it is refused.
When this deploys, existing own-key tenants move from the SkillPixel key to their own key. A key without credit then starts showing the busy message.
Head
Three fix rounds. The last round changed one line that trims key edges, plus tests.
Tests
3,772 unit tests and 315 database tests passed. In the last round, the 10 new key-edge tests failed on the earlier head, and 27 of 27 selected tests pass on the head. In an earlier round, 20 tests failed on the code before the fix, and all 30 passed after it. The type-check count equals L1. GitHub CI passed.
Live lanes
The real LMS ran with a stub chatbot, and with the real chatbot on real OpenAI and Anthropic keys.
A tenant with no setting sent the same request as before.
Managed Claude ran on the SkillPixel key. For own-key OpenAI and Anthropic tenants, the key sent matched the stored key.
Rate limits and rejected keys showed the busy message with the switch on and off. The stub saw 6 calls for 3 messages: one retry each, on the tenant key only.
Ten chats at the same time across three tenants each used the right model and key. A model change between two messages took effect on the next message.
The current chatbot, without R2, still answers on today's model. The learner statement and the usage report came out right.
The LMS logs had 0 key hits. In the last round, 60 of 60 bad keys were refused with no key text in the reply or log and nothing stored.
A rate limit from a real provider was not triggered. The stub's rate limit stands in for it.
Speed
Extra time before the chatbot call for a tenant with no setting: 10.8 ms in a first run of 10, 7.9 ms in a second run of 30, and 9.3 ms over all 40. The limit is 10 ms. The first run was just over it. The root accepted the result, because the cost is one settings read next to a model call of about 1 s. The own-key path was not slower than trunk.
A new "Busy chatbot" section has the switch "When the chatbot is busy, hand the chat to a human". It is on by default and saves when clicked. The chatbot model picker now shows the real reason from the backend, in English and Vietnamese, for each option the tenant cannot run.
Tests
246 tests passed. The new switch test fails on L2, and 4 of 4 pass on the head. Four deliberate code breaks each made exactly one test fail. Four of the five new reason tests failed on the earlier head. The fifth passes on both, because its test data happens to fit the old guess. The regenerated API client is byte for byte the same as the committed one.
Live lanes
Ten lanes against a real backend: default on, save off, reload, save on, archived tenant, backend stopped, dark mode, keyboard only, and refusal for users who are not platform admins. On the final head, all 60 option states across three tenants and two languages matched the backend. The switch saved off, survived a reload, and saved on.
Speed
Median time until the page is ready: 702 ms on L2 and 751 ms on L6, against a limit of 100 ms slower. The switch adds no request.
Media
Four screenshots and a 35 s video, below.
A managed demo tenant. The two OpenRouter options say "Needs the tenant's own key". The busy switch is on.A saved OpenRouter choice that cannot run. The reason shows under the picker.The switch turned off. The toast says "Busy chats now stay with the AI" and covers the switch for a few seconds.An archived demo tenant. The switch is disabled with the tooltip "The tenant is archived, so this is read-only."
L6 review video, 35 s, no sound. The admin turns the switch off, reloads, and turns it on again. The video is low frame rate, so the off state is hard to see after the reload. The grey box in the lower left covers the admin's name.
When the LMS backend refuses a request because a field is wrong, the reply and the log no longer repeat the values that were sent. Field names, error types and the validator's reason stay, so admins and learners still see why a save failed. If a reason would contain the value that was sent, the reply says "Invalid request input" instead. WebSocket errors follow the same rule. It can merge at any time.
Tests
3,706 unit tests passed. 2,912 database tests passed and 1 failed. That test needs a database the test setup does not create, and it fails the same way on main. The 10 new tests fail on main, 3 of them fail on the earlier head, and all 10 pass on the head. The type-check count went from 2,558 on main to 2,556. GitHub CI passed.
Live lanes
76 probes with unique test values across 5 routes, in both the development and the beta log format: 0 hits in replies and logs at the head. The same probes found the values on main. Of 41 errors from 23 real requests, 36 kept the same message as main, and 2 changed on purpose.
Speed
The new filtering runs only on a refused request. Across all 564 routes it took a median of 0.046 ms.
Where the sources disagree
These are differences between a PR description and its verifier. None changes a verdict.
PR
PR description says
Verifier measured
R1
5 key matches in the old log
4. The count depends on the run.
R2
Tenant-key chat 45 ms slower than the default. Default 3.9% faster than before. An earlier owner report said 97 ms.
56 ms and 99 ms slower. Default 1.5% and 2.7% faster. All inside the 400 ms limit.
R2
An older lane summary said all 12 lanes passed.
The Gemini lane ran offline only, and the stream cuts came at a different point than the plan asked for. Later rounds gave live credit lane by lane.
L1
3,721 unit tests passed. 258 database tests.
3,720 passed and 1 skipped. 813 database tests, a wider selection.
L4
30 Windows test failures in 3 files
31 failures in 4 files. The extra one passes on its own. Both say the same files fail on trunk.
L2
1,179 ms before and 1,152 ms after. Rebased onto L1 at 78a1da0.
798 ms and 728 ms against the current L1. L2 now sits on 69c7c66, with the same patch.
L3
Extra time 4.6 ms (8.8 ms to 13.4 ms)
10.8 ms, 7.9 ms and 9.3 ms pooled, against a 10 ms limit
L3
223 database tests
315 database tests at the final head, a wider selection
L6
737 ms on L2 and 710 ms on L6
702 ms on L2 and 751 ms on L6. Both are inside the 100 ms limit.
L7
2,913 database tests passed
2,912 passed and 1 failed for the environment reason above
What is still open
Merge order. Chatbot first: R1, then G, then R2. LMS: L1, L4, L2, L3, L6. L3 merges only after R2 is live on the chatbot host and L4 is merged. Deploy platform-admin (L6) after the L3 backend. L7 can merge at any time.
Gemini. G and the Gemini lanes of R2 need a Gemini key with credit. Until then, Gemini is not proven live and its speed is not measured.
Media review. The operator reviews the screenshots and videos of L4, L2 and L6 before they merge.
Real rate limit. No real provider rate limit was triggered. A stand-in server produced it.
Beta. Nothing is on beta yet, and no one has walked through it there.
Small UI points. In L2, keyboard focus goes back to the top of the page after a save. In L6, the toast covers the switch for about 4 seconds.
Follow-ups. 4 follow-ups are tracked in the PR descriptions.