fix(cli): clean Next standalone package and nested workingDirectory - #1633
Conversation
Wipe .agentuity before packaging so stale root server.js cannot win over a nested standalone entry when outputFileTracingRoot points at a parent. Prefer monorepo/project-basename server.js, emit launch.workingDirectory for nested layouts, and type the Next CDN config wrapper so next.config.ts typechecks under Next's build.
|
The latest Agentuity deployment details.
View deployment logs with the Agentuity CLI: |
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 4 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
Comment |
📦 Canary Packages Publishedversion: PackagesInstallAdd to your {
"dependencies": {
"@agentuity/schedule": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-schedule-3.1.16-0545bc9.tgz",
"@agentuity/coder-tui": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-coder-tui-3.1.16-0545bc9.tgz",
"@agentuity/stream": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-stream-3.1.16-0545bc9.tgz",
"@agentuity/config": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-config-3.1.16-0545bc9.tgz",
"@agentuity/webhook": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-webhook-3.1.16-0545bc9.tgz",
"@agentuity/claude-code": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-claude-code-3.1.16-0545bc9.tgz",
"@agentuity/vite": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-vite-3.1.16-0545bc9.tgz",
"@agentuity/db": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-db-3.1.16-0545bc9.tgz",
"@agentuity/adapter": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-adapter-3.1.16-0545bc9.tgz",
"@agentuity/vector": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-vector-3.1.16-0545bc9.tgz",
"@agentuity/aigateway": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-aigateway-3.1.16-0545bc9.tgz",
"@agentuity/hono": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-hono-3.1.16-0545bc9.tgz",
"@agentuity/migrate": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-migrate-3.1.16-0545bc9.tgz",
"@agentuity/email": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-email-3.1.16-0545bc9.tgz",
"@agentuity/queue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-queue-3.1.16-0545bc9.tgz",
"@agentuity/genesis": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-genesis-3.1.16-0545bc9.tgz",
"@agentuity/opencode": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-opencode-3.1.16-0545bc9.tgz",
"@agentuity/pi": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-pi-3.1.16-0545bc9.tgz",
"@agentuity/telemetry": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-telemetry-3.1.16-0545bc9.tgz",
"@agentuity/sandbox": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-sandbox-3.1.16-0545bc9.tgz",
"@agentuity/coder": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-coder-3.1.16-0545bc9.tgz",
"@agentuity/cli": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-cli-3.1.16-0545bc9.tgz",
"@agentuity/postgres": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-postgres-3.1.16-0545bc9.tgz",
"@agentuity/drizzle": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-drizzle-3.1.16-0545bc9.tgz",
"@agentuity/api": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-api-3.1.16-0545bc9.tgz",
"@agentuity/runtime": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-runtime-3.1.16-0545bc9.tgz",
"@agentuity/analytics": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-analytics-3.1.16-0545bc9.tgz",
"create-agentuity": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/create-agentuity-3.1.16-0545bc9.tgz",
"@agentuity/skills": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-skills-3.1.16-0545bc9.tgz",
"@agentuity/schema": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-schema-3.1.16-0545bc9.tgz",
"@agentuity/keyvalue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-keyvalue-3.1.16-0545bc9.tgz",
"@agentuity/client": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-client-3.1.16-0545bc9.tgz",
"@agentuity/task": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-task-3.1.16-0545bc9.tgz",
"@agentuity/server": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-server-3.1.16-0545bc9.tgz",
"@agentuity/storage": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-storage-3.1.16-0545bc9.tgz",
"@agentuity/core": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-core-3.1.16-0545bc9.tgz"
}
}Or install directly: bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-schedule-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-coder-tui-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-stream-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-config-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-webhook-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-claude-code-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-vite-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-db-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-adapter-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-vector-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-aigateway-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-hono-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-migrate-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-email-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-queue-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-genesis-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-opencode-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-pi-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-telemetry-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-sandbox-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-coder-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-cli-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-postgres-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-drizzle-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-api-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-runtime-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-analytics-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/create-agentuity-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-skills-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-schema-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-keyvalue-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-client-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-task-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-server-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-storage-3.1.16-0545bc9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.16-0545bc9/agentuity-core-3.1.16-0545bc9.tgz |
Share resetOutputDir across Next, monorepo stage, and generic adapters so Vite/Nuxt/Astro/SvelteKit/TanStack rebuilds cannot merge stale dist assets or leftover _serve.js into .agentuity.
|
Follow-up on this PR: generic single-package packaging now also wipes the output dir before copy (shared `resetOutputDir`), same as Next standalone + monorepo stage. Covers Vite / Nuxt / Astro / SvelteKit / TanStack so rebuilds do not merge stale dist assets. |
Derive process workingDirectory from the selected server.js path, prefer adapter packaging over monorepo.subpath in launch metadata, and shrink selectStandaloneServer to early-exit preference checks.
Summary
.agentuity) before copying Next standalone so prior builds cannot leave a stale rootserver.js.server.js(monorepo.subpath→basename(projectDir)→ root) when standalone is nested underoutputFileTracingRoot(e.g. parent-folder lockfile).processes[].workingDirectoryfrom monorepo or adapter-detected nest; keepstatic.directoryrelative to that cwd.Recordcast) sonext.config.tspasses Next build typecheck when bakingassetPrefixvia--cdn-base-url.Why
Genesis deployer + CDN E2E against a Next app showed:
server.jswith emptyassetPrefixremained after re-package.test-nextjs/server.jswas ignored; launch pointed at the wrong entry.cpSyncmerge + first-matchfindStandaloneServer, not a deployer contract bug.Test plan
bun test test/cmd/build/adapters/nextjs-standalone.test.ts test/cmd/build/adapters/nextjs-cdn.test.ts test/cmd/build/package/launch.test.ts(40 pass)bun run typecheckinpackages/cli/Users/jhaynie/tmp/test-nextjswith--cdn-base-url https://cdn.agentcompany.com/genesis/→ single nested server,workingDirectory: test-nextjs, correctassetPrefix, static next to serverAfter merge
Release next CLI version (e.g. 3.1.17). Genesis sandbox Dockerfile pin:
AGENTUITY_CLI_VERSION.