Repository navigation
🧪 fix: Serve the Admin's Effective Capabilities from the E2E Mock Backend - #190
Merged
Merged
Conversation
…kend Since #185 the /_app route loads GET /api/admin/grants/effective before the panel renders, and fails closed when it can't. e2e/mock-backend.mjs never served that route, so every signed-in page in the mock e2e run showed "Could not verify permissions". The mock now answers it for its admin tokens with every capability in SystemCapabilities, refusing other requests the way it refuses /api/admin/verify; both share one token check.
Contributor
Author
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
This was referenced Oct 27, 2026
⬆️ chore: Upgrade Click UI, i18next, TypeScript, Vitest and the Dev Tooling to Their New Majors
#194
Open
danny-avila
added a commit
that referenced
this pull request
Oct 28, 2026
danny-avila
added a commit
that referenced
this pull request
Oct 28, 2026
danny-avila
added a commit
that referenced
this pull request
Oct 28, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull Request Template
Summary
Since #185, the
/_approute loadsGET /api/admin/grants/effectivebefore the panel renders and fails closed when it can't.e2e/mock-backend.mjsnever served that route, so in a mock e2e run every signed-in page showed "Could not verify permissions" instead of the panel. That brokegrants.spec.ts's "management tab is active by default", which passed against the mock before #185.Changes
GET /api/admin/grants/effectiveanswers the mock's admin tokens with every capability inSystemCapabilities(imported from@librechat/data-schemas/capabilities, so the list follows the package). LibreChat gives an admin the same./api/admin/verify. Both routes now share oneauthFailurecheck, and the admin tokens are listed in one place.Not in this PR. Most of
access.spec.tsandgrants.spec.tsstill fails against the mock, as it did before #185: those specs expect roles, groups and grants that the server functions now read from LibreChat's admin API (/api/admin/roles,/api/admin/groups,/api/admin/grants, …), and the mock serves none of them. Making them pass means giving the mock fixtures for those routes, or running them against a live backend withE2E_BASE_URL. CI doesn't run e2e.Change Type
Testing
The whole Playwright suite against the mock backend, on
mainand on this branch:mainmainbefore #185 (access and grants specs only)grants.spec.ts:30("management tab is active by default") passes again.main, and every remaining failure is inaccess.spec.tsorgrants.spec.tsand also failed before 🛂 fix: Decide Admin Access Before the Panel Renders and Fail Closed on Errors #185.login.spec.tspasses in full.Authentication required, the admin token gets all 25 capabilities, and/api/admin/verifyanswers as before.Test Configuration:
npx playwright test --workers=2withvite devande2e/mock-backend.mjs, Playwright 1.61.Checklist