Skip to content

Let installed extensions add routes, migrations and dashboard pages - #443

Merged
Priyanshu-u07 merged 2 commits into
mainfrom
feat/extension-seams
Oct 26, 2026
Merged

Priyanshu-u07 merged 2 commits into
mainfrom
feat/extension-seams

Conversation

@Priyanshu-u07

@Priyanshu-u07 Priyanshu-u07 commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

What

Lets packages installed alongside InferiaLLM extend it, through the inferia.extensions entry point. An extension may provide:

  • mount(app): called at gateway startup after core's routes; extensions add routes under their own prefix.
  • migrate(dsn): called from _apply_migrations after core's migrations, so it runs on both init and migrate.
  • Dashboard pages: the dashboard reads /api/ext/_pages, adds each page to its sidebar section (Monitor, Build or Admin) and loads its module at /dashboard/ext/:plugin/:page. The module is fetched with the signed-in API client and imported from a Blob URL, since the gateway accepts only a Bearer header; it exports mount(element, { api, version }) and returns an unmount function (page contract 1).

With nothing installed, nothing changes: no routes, no migrations, and an empty page list (the listing returns 404, treated as "none installed"). An extension that fails to load, mount or migrate is logged and skipped, so InferiaLLM always starts.

Notes

  • Extension code runs inside InferiaLLM and its pages run with the user's session, so only trusted extensions should be installed.
  • The listing is filtered by the user's permissions and the gateway checks again when serving a page's script, so extension routes need no PermissionGuard.
  • A failed listing request (other than 404) is retried rather than treated as "nothing installed", so a brief outage does not hide menu entries.

Testing

  • src/tests/common/test_extensions.py: nothing installed, mount and migrate called, a failing extension skipped, core migrations before extensions.
  • Dashboard: useExtensionPages.test.tsx (listing, contract filtering, 404 vs other errors, page not found / could not be loaded). Full suite 497 passed; build and lint pass; no new type errors.
  • Full Python suite with the CI ignore list: 3,062 passed.
  • Checked with a real extension installed locally: its routes were mounted behind sign-in (401 without a token), and _apply_migrations created its schema, idempotently on a second run.

Extensions registered under the inferia.extensions entry point are mounted on the gateway at startup and migrated after core's migrations, in both init and migrate. The dashboard lists the pages they offer at /ext/_pages, shows each in its sidebar section, and loads its module inside the dashboard: fetched with the signed-in client and imported from a Blob URL, since the gateway takes only a Bearer header. With nothing installed nothing changes, and an extension that fails is logged and skipped.

Signed-off-by: Priyanshu-u07 <connect.priyanshu8271@gmail.com>
Base automatically changed from feat/usage-history to main October 26, 2026 11:38
Signed-off-by: Priyanshu-u07 <connect.priyanshu8271@gmail.com>
@Priyanshu-u07
Priyanshu-u07 marked this pull request as ready for review October 26, 2026 11:43
@Priyanshu-u07
Priyanshu-u07 merged commit 5e72100 into main Oct 26, 2026
2 checks passed
@Priyanshu-u07
Priyanshu-u07 deleted the feat/extension-seams branch October 26, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant