Skip to content

fix(cli): remove src/generated codegen and suppress proxy errors duri…#1326

Open
Huijiro wants to merge 1 commit intomainfrom
fix/remove-generated-and-proxy-errors
Open

fix(cli): remove src/generated codegen and suppress proxy errors duri…#1326
Huijiro wants to merge 1 commit intomainfrom
fix/remove-generated-and-proxy-errors

Conversation

@Huijiro
Copy link
Copy Markdown
Member

@Huijiro Huijiro commented Apr 1, 2026

…ng restart

  • Remove env-types-generator, lifecycle-generator, and docs-generator along with their invocations in the build pipeline and tests
  • Delete stale src/generated/ folders from apps/testing/* and apps/docs
  • Remove src/generated from file-watcher ignore lists
  • Simplify getGeneratedSqlDir (no longer checks for v1 registry.ts)
  • Suppress Vite proxy errors during backend --hot reload by downgrading transient connection errors to debug level and responding with 503

Summary by CodeRabbit

  • New Features

    • Added graceful backend restart handling with 503 response and retry instructions in development server
  • Refactor

    • Removed automatic documentation and environment type file generation from build process
    • Updated file watcher to monitor generated files for improved hot-reload support
    • Simplified generated SQL directory resolution

…ng restart

- Remove env-types-generator, lifecycle-generator, and docs-generator
  along with their invocations in the build pipeline and tests
- Delete stale src/generated/ folders from apps/testing/* and apps/docs
- Remove src/generated from file-watcher ignore lists
- Simplify getGeneratedSqlDir (no longer checks for v1 registry.ts)
- Suppress Vite proxy errors during backend --hot reload by downgrading
  transient connection errors to debug level and responding with 503
@agentuity-agent
Copy link
Copy Markdown

agentuity-agent bot commented Apr 1, 2026

The latest Agentuity deployment details.

Project Deployment Preview Updated (UTC)
docs 🔴 Failed (deploy_3d5707825ea789249e067f61b71e58f1) - 2026-04-01T21:00:34Z

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

📝 Walkthrough

Walkthrough

Removed automatic generation of documentation, environment type definitions, and lifecycle types during the build process. Enhanced the Vite asset server with backend proxy error handling. Updated the file watcher to include generated files and simplified SQL directory resolution.

Changes

Cohort / File(s) Summary
Code Generation Module Removal
packages/cli/src/cmd/build/vite/docs-generator.ts, packages/cli/src/cmd/build/vite/env-types-generator.ts, packages/cli/src/cmd/build/vite/lifecycle-generator.ts
Deleted generateDocumentation(), generateEnvTypes() with GenerateEnvTypesOptions, and generateLifecycleTypes() functions that previously auto-generated README.md, AGENTS.md, env.d.ts, state.ts, and router.ts files.
Build Process Updates
packages/cli/src/cmd/build/vite/vite-builder.ts
Removed calls to documentation, lifecycle type, and environment type generation in the server build path; profile parameter no longer used.
Vite Asset Server Enhancement
packages/cli/src/cmd/build/vite/vite-asset-server-config.ts
Added backendProxyConfigure callback to handle backend unavailability with 503 responses and Retry-After: 1 header; suppressed proxy error logs at debug level instead of emitting errors.
File Watcher & SQL Configuration
packages/cli/src/cmd/dev/file-watcher.ts, packages/cli/src/cmd/project/auth/shared.ts
Removed src/generated from ignored directories in file watcher, enabling change detection; simplified getGeneratedSqlDir() to unconditionally return projectDir.
Test Suite Removal
packages/cli/test/cmd/build/lifecycle-generator.test.ts, packages/cli/test/cmd/build/vite/env-types-generator.test.ts
Deleted test suites covering lifecycle type generation, environment type generation with .env file merging, and edge case validation.
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

📦 Canary Packages Published

version: 2.0.7-b83ff39

Packages
Package Version URL
@agentuity/webhook 2.0.7-b83ff39 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-webhook-2.0.7-b83ff39.tgz
@agentuity/cli 2.0.7-b83ff39 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-cli-2.0.7-b83ff39.tgz
@agentuity/postgres 2.0.7-b83ff39 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-postgres-2.0.7-b83ff39.tgz
@agentuity/react 2.0.7-b83ff39 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-react-2.0.7-b83ff39.tgz
@agentuity/server 2.0.7-b83ff39 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-server-2.0.7-b83ff39.tgz
@agentuity/frontend 2.0.7-b83ff39 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-frontend-2.0.7-b83ff39.tgz
@agentuity/db 2.0.7-b83ff39 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-db-2.0.7-b83ff39.tgz
@agentuity/auth 2.0.7-b83ff39 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-auth-2.0.7-b83ff39.tgz
@agentuity/opencode 2.0.7-b83ff39 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-opencode-2.0.7-b83ff39.tgz
@agentuity/email 2.0.7-b83ff39 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-email-2.0.7-b83ff39.tgz
@agentuity/sandbox 2.0.7-b83ff39 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-sandbox-2.0.7-b83ff39.tgz
@agentuity/keyvalue 2.0.7-b83ff39 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-keyvalue-2.0.7-b83ff39.tgz
@agentuity/schedule 2.0.7-b83ff39 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-schedule-2.0.7-b83ff39.tgz
@agentuity/workbench 2.0.7-b83ff39 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-workbench-2.0.7-b83ff39.tgz
@agentuity/schema 2.0.7-b83ff39 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-schema-2.0.7-b83ff39.tgz
@agentuity/drizzle 2.0.7-b83ff39 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-drizzle-2.0.7-b83ff39.tgz
@agentuity/task 2.0.7-b83ff39 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-task-2.0.7-b83ff39.tgz
@agentuity/coder 2.0.7-b83ff39 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-coder-2.0.7-b83ff39.tgz
@agentuity/claude-code 2.0.7-b83ff39 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-claude-code-2.0.7-b83ff39.tgz
@agentuity/evals 2.0.7-b83ff39 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-evals-2.0.7-b83ff39.tgz
@agentuity/queue 2.0.7-b83ff39 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-queue-2.0.7-b83ff39.tgz
@agentuity/runtime 2.0.7-b83ff39 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-runtime-2.0.7-b83ff39.tgz
@agentuity/migrate 2.0.7-b83ff39 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-migrate-2.0.7-b83ff39.tgz
@agentuity/vector 2.0.7-b83ff39 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-vector-2.0.7-b83ff39.tgz
@agentuity/core 2.0.7-b83ff39 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-core-2.0.7-b83ff39.tgz
Install

Add to your package.json:

{
  "dependencies": {
    "@agentuity/webhook": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-webhook-2.0.7-b83ff39.tgz",
    "@agentuity/cli": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-cli-2.0.7-b83ff39.tgz",
    "@agentuity/postgres": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-postgres-2.0.7-b83ff39.tgz",
    "@agentuity/react": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-react-2.0.7-b83ff39.tgz",
    "@agentuity/server": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-server-2.0.7-b83ff39.tgz",
    "@agentuity/frontend": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-frontend-2.0.7-b83ff39.tgz",
    "@agentuity/db": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-db-2.0.7-b83ff39.tgz",
    "@agentuity/auth": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-auth-2.0.7-b83ff39.tgz",
    "@agentuity/opencode": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-opencode-2.0.7-b83ff39.tgz",
    "@agentuity/email": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-email-2.0.7-b83ff39.tgz",
    "@agentuity/sandbox": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-sandbox-2.0.7-b83ff39.tgz",
    "@agentuity/keyvalue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-keyvalue-2.0.7-b83ff39.tgz",
    "@agentuity/schedule": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-schedule-2.0.7-b83ff39.tgz",
    "@agentuity/workbench": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-workbench-2.0.7-b83ff39.tgz",
    "@agentuity/schema": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-schema-2.0.7-b83ff39.tgz",
    "@agentuity/drizzle": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-drizzle-2.0.7-b83ff39.tgz",
    "@agentuity/task": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-task-2.0.7-b83ff39.tgz",
    "@agentuity/coder": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-coder-2.0.7-b83ff39.tgz",
    "@agentuity/claude-code": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-claude-code-2.0.7-b83ff39.tgz",
    "@agentuity/evals": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-evals-2.0.7-b83ff39.tgz",
    "@agentuity/queue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-queue-2.0.7-b83ff39.tgz",
    "@agentuity/runtime": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-runtime-2.0.7-b83ff39.tgz",
    "@agentuity/migrate": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-migrate-2.0.7-b83ff39.tgz",
    "@agentuity/vector": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-vector-2.0.7-b83ff39.tgz",
    "@agentuity/core": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-core-2.0.7-b83ff39.tgz"
  }
}

Or install directly:

bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-webhook-2.0.7-b83ff39.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-cli-2.0.7-b83ff39.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-postgres-2.0.7-b83ff39.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-react-2.0.7-b83ff39.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-server-2.0.7-b83ff39.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-frontend-2.0.7-b83ff39.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-db-2.0.7-b83ff39.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-auth-2.0.7-b83ff39.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-opencode-2.0.7-b83ff39.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-email-2.0.7-b83ff39.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-sandbox-2.0.7-b83ff39.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-keyvalue-2.0.7-b83ff39.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-schedule-2.0.7-b83ff39.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-workbench-2.0.7-b83ff39.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-schema-2.0.7-b83ff39.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-drizzle-2.0.7-b83ff39.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-task-2.0.7-b83ff39.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-coder-2.0.7-b83ff39.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-claude-code-2.0.7-b83ff39.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-evals-2.0.7-b83ff39.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-queue-2.0.7-b83ff39.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-runtime-2.0.7-b83ff39.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-migrate-2.0.7-b83ff39.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-vector-2.0.7-b83ff39.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.7-b83ff39/agentuity-core-2.0.7-b83ff39.tgz

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/cli/src/cmd/build/vite/vite-builder.ts`:
- Line 162: ViteBuildOptions contains an unused property `profile`; remove
`profile` from the ViteBuildOptions interface and from any function signatures
that declare it (notably in runViteBuild and runAllBuilds) and ensure calls to
viteBundle and other build helpers do not expect or pass a `profile` argument;
search for the symbols ViteBuildOptions, runViteBuild, runAllBuilds, and
viteBundle to update their signatures and any related type annotations so the
code compiles without the unused `profile` field.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 88de6f89-0d09-461a-9626-9c081ea4efce

📥 Commits

Reviewing files that changed from the base of the PR and between a1325f1 and b83ff39.

⛔ Files ignored due to path filters (20)
  • apps/docs/src/generated/AGENTS.md is excluded by !**/generated/**
  • apps/docs/src/generated/README.md is excluded by !**/generated/**
  • apps/testing/cloud-deployment/src/generated/AGENTS.md is excluded by !**/generated/**
  • apps/testing/cloud-deployment/src/generated/README.md is excluded by !**/generated/**
  • apps/testing/cloud-deployment/src/generated/env.d.ts is excluded by !**/generated/**
  • apps/testing/e2e-web/src/generated/AGENTS.md is excluded by !**/generated/**
  • apps/testing/e2e-web/src/generated/README.md is excluded by !**/generated/**
  • apps/testing/e2e-web/src/generated/env.d.ts is excluded by !**/generated/**
  • apps/testing/integration-suite/src/generated/AGENTS.md is excluded by !**/generated/**
  • apps/testing/integration-suite/src/generated/README.md is excluded by !**/generated/**
  • apps/testing/integration-suite/src/generated/env.d.ts is excluded by !**/generated/**
  • apps/testing/oauth/src/generated/AGENTS.md is excluded by !**/generated/**
  • apps/testing/oauth/src/generated/README.md is excluded by !**/generated/**
  • apps/testing/oauth/src/generated/analytics-config.ts is excluded by !**/generated/**
  • apps/testing/oauth/src/generated/app.ts is excluded by !**/generated/**
  • apps/testing/oauth/src/generated/registry.ts is excluded by !**/generated/**
  • apps/testing/oauth/src/generated/routes.ts is excluded by !**/generated/**
  • apps/testing/oauth/src/generated/webanalytics.ts is excluded by !**/generated/**
  • apps/testing/svelte-web/src/generated/AGENTS.md is excluded by !**/generated/**
  • apps/testing/svelte-web/src/generated/README.md is excluded by !**/generated/**
📒 Files selected for processing (9)
  • packages/cli/src/cmd/build/vite/docs-generator.ts
  • packages/cli/src/cmd/build/vite/env-types-generator.ts
  • packages/cli/src/cmd/build/vite/lifecycle-generator.ts
  • packages/cli/src/cmd/build/vite/vite-asset-server-config.ts
  • packages/cli/src/cmd/build/vite/vite-builder.ts
  • packages/cli/src/cmd/dev/file-watcher.ts
  • packages/cli/src/cmd/project/auth/shared.ts
  • packages/cli/test/cmd/build/lifecycle-generator.test.ts
  • packages/cli/test/cmd/build/vite/env-types-generator.test.ts
💤 Files with no reviewable changes (7)
  • packages/cli/src/cmd/dev/file-watcher.ts
  • packages/cli/src/cmd/project/auth/shared.ts
  • packages/cli/src/cmd/build/vite/docs-generator.ts
  • packages/cli/src/cmd/build/vite/env-types-generator.ts
  • packages/cli/test/cmd/build/lifecycle-generator.test.ts
  • packages/cli/src/cmd/build/vite/lifecycle-generator.ts
  • packages/cli/test/cmd/build/vite/env-types-generator.test.ts
📜 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). (15)
  • GitHub Check: Framework Integration Tests (TanStack & Next.js)
  • GitHub Check: Playwright E2E Smoke Test
  • GitHub Check: Template Integration Tests
  • GitHub Check: Storage CLI Tests
  • GitHub Check: Queue CLI Tests
  • GitHub Check: Sandbox CLI Tests
  • GitHub Check: Postgres SSL Integration Test
  • GitHub Check: Queue SDK Tests
  • GitHub Check: SDK Integration Test Suite
  • GitHub Check: Cloud Deployment Tests
  • GitHub Check: Package Installation & Usage Test
  • GitHub Check: Standalone Agent Test
  • GitHub Check: Build
  • GitHub Check: Pack & Upload
  • GitHub Check: Agentuity Deployment
🧰 Additional context used
📓 Path-based instructions (3)
packages/cli/**/*.ts

📄 CodeRabbit inference engine (packages/cli/AGENTS.md)

Use Bun.file(f).exists() instead of existsSync(f) for file existence checks

Files:

  • packages/cli/src/cmd/build/vite/vite-builder.ts
  • packages/cli/src/cmd/build/vite/vite-asset-server-config.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use Biome as code formatter with tabs (width 3), single quotes, semicolons, lineWidth 100, and trailingCommas es5

Files:

  • packages/cli/src/cmd/build/vite/vite-builder.ts
  • packages/cli/src/cmd/build/vite/vite-asset-server-config.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use TypeScript Strict mode with ESNext target and bundler moduleResolution
Use StructuredError from @agentuity/core for error handling

Files:

  • packages/cli/src/cmd/build/vite/vite-builder.ts
  • packages/cli/src/cmd/build/vite/vite-asset-server-config.ts
🧠 Learnings (2)
📚 Learning: 2025-12-21T00:31:41.858Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 274
File: packages/cli/src/cmd/build/vite/server-bundler.ts:12-41
Timestamp: 2025-12-21T00:31:41.858Z
Learning: In Bun runtime, BuildMessage and ResolveMessage are global types and are not exported from the bun module. Do not import { BuildMessage } from 'bun' or similar; these types are available globally and should be used without import. This applies to all TypeScript files that target the Bun runtime within the repository.

Applied to files:

  • packages/cli/src/cmd/build/vite/vite-builder.ts
  • packages/cli/src/cmd/build/vite/vite-asset-server-config.ts
📚 Learning: 2026-02-17T14:23:15.448Z
Learnt from: potofpie
Repo: agentuity/sdk PR: 974
File: packages/cli/src/cmd/git/account/list.ts:39-40
Timestamp: 2026-02-17T14:23:15.448Z
Learning: In the Agentuity CLI framework (packages/cli), when a subcommand declares requires: { auth: true }, the framework will automatically call requireAuth() before invoking the handler. Do not call requireAuth(ctx) manually inside command handlers. This applies to all TypeScript command files under packages/cli/src, including paths like packages/cli/src/cmd/git/account/list.ts.

Applied to files:

  • packages/cli/src/cmd/build/vite/vite-builder.ts
  • packages/cli/src/cmd/build/vite/vite-asset-server-config.ts
🔇 Additional comments (3)
packages/cli/src/cmd/build/vite/vite-asset-server-config.ts (3)

180-197: Well-structured proxy error handling for hot reload scenarios.

The defensive check correctly filters out WebSocket upgrade responses and prevents double-writes. The 503 status with Retry-After: 1 header is semantically appropriate for transient backend unavailability.

One consideration: per the useAgentSchemas.ts hook (Context snippet 1), HTTP 503 responses are treated as hard errors without automatic retry—users may see a brief error state in the workbench during backend restarts. This is acceptable for dev mode and preferable to connection reset errors.


262-298: LGTM!

The backendProxyConfigure callback is consistently applied to all backend proxy targets, ensuring uniform error handling across user-defined routes, system routes, and legacy health check endpoints.


361-368: LGTM!

The error suppression complements the 503 response handling—together they provide a clean UX during backend restarts. Downgrading to debug level (rather than silently dropping) preserves diagnostic information when needed.

*/
export async function runViteBuild(options: ViteBuildOptions): Promise<void> {
const { rootDir, mode, dev = false, logger, profile } = options;
const { rootDir, mode, dev = false, logger } = options;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check if `profile` is still used in ViteBuildOptions consumers

# Search for usages of the `profile` property in ViteBuildOptions contexts
rg -n --type=ts 'profile' packages/cli/src/cmd/build/

# Search for any runViteBuild or runAllBuilds calls that pass profile
rg -n --type=ts -A 3 'runViteBuild|runAllBuilds' packages/cli/src/ | rg -i 'profile'

Repository: agentuity/sdk

Length of output: 390


🏁 Script executed:

# Check the context around line 125 in packages/cli/src/cmd/build/index.ts
sed -n '115,135p' packages/cli/src/cmd/build/index.ts

Repository: agentuity/sdk

Length of output: 823


🏁 Script executed:

# Search for all usages of profile property assignment or parameter passing
rg -n --type=ts 'profile\s*[:=]' packages/cli/src/cmd/build/

Repository: agentuity/sdk

Length of output: 39


🏁 Script executed:

# Search for ViteBuildOptions being used and passed with properties
rg -n --type=ts -B 2 -A 5 'ViteBuildOptions' packages/cli/src/cmd/build/

Repository: agentuity/sdk

Length of output: 2141


🏁 Script executed:

# Check if profile is used in the broader codebase outside of just definitions
rg -n --type=ts '\.profile\b' packages/cli/src/

Repository: agentuity/sdk

Length of output: 39


Remove unused profile parameter from interface and function signature.

The profile property is declared in ViteBuildOptions (line 154) but is completely unused—it's not destructured in runViteBuild or runAllBuilds, never passed when calling viteBundle(), and has zero usages in the codebase. Remove it from the interface definition to complete the cleanup.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/cli/src/cmd/build/vite/vite-builder.ts` at line 162,
ViteBuildOptions contains an unused property `profile`; remove `profile` from
the ViteBuildOptions interface and from any function signatures that declare it
(notably in runViteBuild and runAllBuilds) and ensure calls to viteBundle and
other build helpers do not expect or pass a `profile` argument; search for the
symbols ViteBuildOptions, runViteBuild, runAllBuilds, and viteBundle to update
their signatures and any related type annotations so the code compiles without
the unused `profile` field.

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