fix(cli): pre-render root index route in static renderer#1400
Conversation
extractRoutePaths walks the TanStack Router routeTree to decide which
URLs the static renderer should pre-render. An index route directly
under the pathless site root (`createFileRoute('/')`) hit a branch
that appended nothing to the parent path and then skipped the emit
guard because currentPath was still empty — so '/' was silently dropped
from the pre-render set.
The effect in production: the docs landing page shipped with Vite's
raw template, leaving <!--app-html--> unreplaced where the SSR'd React
tree should be. Every nested route SSR'd correctly because their
accumulated path was non-empty.
Fix treats segment === '/' as an explicit index-route signal: emit the
parent path, defaulting to '/' when the parent itself is pathless.
All other cases behave identically.
Export extractRoutePaths + RouteTreeNode so the walker can be unit
tested; add coverage for the root index case, non-root index routes,
trailing-slash normalization, parameterized route filtering, legacy
options.path fallback, and an end-to-end docs-shaped tree.
|
The latest Agentuity deployment details.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
💤 Files with no reviewable changes (4)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (16)
🧰 Additional context used📓 Path-based instructions (3)packages/cli/**/*.ts📄 CodeRabbit inference engine (packages/cli/AGENTS.md)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (2)📚 Learning: 2025-12-21T00:31:41.858ZApplied to files:
📚 Learning: 2026-02-17T14:23:15.448ZApplied to files:
🔇 Additional comments (1)
📝 WalkthroughWalkthroughExports and tests were added for route discovery helpers in the static renderer; legacy Vite asset-path linting plugin and its tests were removed, and build plumbing that auto-inserted that plugin (wrapper config and dynamic registration) was deleted or simplified. Changes
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
📦 Canary Packages Publishedversion: PackagesInstallAdd to your {
"dependencies": {
"@agentuity/cli": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-cli-2.0.9-8f8a863.tgz",
"@agentuity/sandbox": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-sandbox-2.0.9-8f8a863.tgz",
"@agentuity/react": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-react-2.0.9-8f8a863.tgz",
"@agentuity/schedule": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-schedule-2.0.9-8f8a863.tgz",
"@agentuity/opencode": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-opencode-2.0.9-8f8a863.tgz",
"@agentuity/coder-tui": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-coder-tui-2.0.9-8f8a863.tgz",
"@agentuity/drizzle": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-drizzle-2.0.9-8f8a863.tgz",
"@agentuity/auth": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-auth-2.0.9-8f8a863.tgz",
"@agentuity/claude-code": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-claude-code-2.0.9-8f8a863.tgz",
"@agentuity/workbench": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-workbench-2.0.9-8f8a863.tgz",
"@agentuity/db": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-db-2.0.9-8f8a863.tgz",
"@agentuity/frontend": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-frontend-2.0.9-8f8a863.tgz",
"@agentuity/coder": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-coder-2.0.9-8f8a863.tgz",
"@agentuity/vector": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-vector-2.0.9-8f8a863.tgz",
"@agentuity/postgres": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-postgres-2.0.9-8f8a863.tgz",
"@agentuity/schema": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-schema-2.0.9-8f8a863.tgz",
"@agentuity/core": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-core-2.0.9-8f8a863.tgz",
"@agentuity/evals": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-evals-2.0.9-8f8a863.tgz",
"@agentuity/keyvalue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-keyvalue-2.0.9-8f8a863.tgz",
"@agentuity/server": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-server-2.0.9-8f8a863.tgz",
"@agentuity/migrate": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-migrate-2.0.9-8f8a863.tgz",
"@agentuity/email": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-email-2.0.9-8f8a863.tgz",
"@agentuity/queue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-queue-2.0.9-8f8a863.tgz",
"@agentuity/task": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-task-2.0.9-8f8a863.tgz",
"@agentuity/runtime": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-runtime-2.0.9-8f8a863.tgz",
"@agentuity/webhook": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-webhook-2.0.9-8f8a863.tgz"
}
}Or install directly: bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-cli-2.0.9-8f8a863.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-sandbox-2.0.9-8f8a863.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-react-2.0.9-8f8a863.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-schedule-2.0.9-8f8a863.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-opencode-2.0.9-8f8a863.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-coder-tui-2.0.9-8f8a863.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-drizzle-2.0.9-8f8a863.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-auth-2.0.9-8f8a863.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-claude-code-2.0.9-8f8a863.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-workbench-2.0.9-8f8a863.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-db-2.0.9-8f8a863.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-frontend-2.0.9-8f8a863.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-coder-2.0.9-8f8a863.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-vector-2.0.9-8f8a863.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-postgres-2.0.9-8f8a863.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-schema-2.0.9-8f8a863.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-core-2.0.9-8f8a863.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-evals-2.0.9-8f8a863.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-keyvalue-2.0.9-8f8a863.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-server-2.0.9-8f8a863.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-migrate-2.0.9-8f8a863.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-email-2.0.9-8f8a863.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-queue-2.0.9-8f8a863.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-task-2.0.9-8f8a863.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-runtime-2.0.9-8f8a863.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-8f8a863/agentuity-webhook-2.0.9-8f8a863.tgz |
The publicAssetPathPlugin was a lint-only plugin that warned when users
referenced legacy Agentuity-v1 '/public/foo.svg' paths in their frontend
code. It never blocked a build, never transformed code, and was
redundant with the cloud-deployment integration test that already
catches unrewritten /public/ URLs end-to-end at deploy time.
To run it inside Vite's subprocess-isolated client build, the CLI
generated '.agentuity/vite.client.config.ts' on every build, re-exporting
the user's vite.config.ts and merging the plugin in. That wrapper
carried a few pieces of accidental complexity:
- A multi-step plugin-path resolver (source tree, compiled dist,
published package) with a fallback import string that didn't match
the CLI's package.json exports.
- An absolute-path import baked into a generated file that then
shipped inside the deploy zip, since nothing in deploy.ts's filter
excluded it.
- Duplicate plugin wiring for dev (vite-asset-server-config) and
prod (vite-builder wrapper).
All of that existed only so a warning-only linter could run. Dropping
the plugin removes ~490 lines, lets the client build consume the user's
vite.config.ts directly via --config, and stops writing a junk file
into every production bundle.
If we need CLI-provided Vite plugins again, export them from
@agentuity/cli/vite-plugin and have templates add them explicitly —
the plugin surface becomes discoverable instead of smuggled in.
extractRoutePaths walks the TanStack Router routeTree to decide which URLs the static renderer should pre-render. An index route directly under the pathless site root (
createFileRoute('/')) hit a branch that appended nothing to the parent path and then skipped the emit guard because currentPath was still empty — so '/' was silently dropped from the pre-render set.The effect in production: the docs landing page shipped with Vite's raw template, leaving unreplaced where the SSR'd React tree should be. Every nested route SSR'd correctly because their accumulated path was non-empty.
Fix treats segment === '/' as an explicit index-route signal: emit the parent path, defaulting to '/' when the parent itself is pathless. All other cases behave identically.
Export extractRoutePaths + RouteTreeNode so the walker can be unit tested; add coverage for the root index case, non-root index routes, trailing-slash normalization, parameterized route filtering, legacy options.path fallback, and an end-to-end docs-shaped tree.
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Chores