Skip to content

feat(service-ai): registerRoutes option (suppress host route mounting)#1650

Merged
xuyushun441-sys merged 1 commit into
mainfrom
feat/ai-register-routes-flag
Jun 7, 2026
Merged

feat(service-ai): registerRoutes option (suppress host route mounting)#1650
xuyushun441-sys merged 1 commit into
mainfrom
feat/ai-register-routes-flag

Conversation

@xuyushun441-sys
Copy link
Copy Markdown
Contributor

Adds registerRoutes?: boolean (default true) to AIServicePluginOptions. When false, caches route defs on the kernel (__aiRoutes) but does NOT fire the ai:routes hook, so concrete routes are not mounted on the shared HTTP server. Lets a multi-tenant host AIService stop shadowing the dispatcher /ai/* wildcard so per-env kernels serve each tenant's chat (per-plan model + per-env metering). Single-env default true = unchanged. Verified: pro->sonnet-4-5, free->haiku-4-5; ai-service.test.ts 95 passed.

AIServicePluginOptions gains `registerRoutes?: boolean` (default true). When
false, the plugin still caches route defs on the kernel (`__aiRoutes`) but does
NOT fire the `ai:routes` hook, so its concrete routes are not mounted on the
shared HTTP server. This is for a host/routing-shell AIService in a multi-tenant
runtime: mounting concrete AI routes on the host shadows the dispatcher's
`/ai/*` wildcard, which resolves the environment and dispatches to the per-env
kernel's AIService. Single-env runtimes are unaffected (default true).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Building Building Preview, Comment Jun 7, 2026 12:18pm

Request Review

@xuyushun441-sys xuyushun441-sys merged commit 2535200 into main Jun 7, 2026
7 of 8 checks passed
@github-actions github-actions Bot added the size/s label Jun 7, 2026
@xuyushun441-sys xuyushun441-sys deleted the feat/ai-register-routes-flag branch June 7, 2026 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants