Skip to content

refactor: remove dev-mode detection from CLI dashboard and start commands#903

Open
miniMaddy wants to merge 7 commits intoComposioHQ:mainfrom
miniMaddy:refactor/remove-cli-dev-mode
Open

refactor: remove dev-mode detection from CLI dashboard and start commands#903
miniMaddy wants to merge 7 commits intoComposioHQ:mainfrom
miniMaddy:refactor/remove-cli-dev-mode

Conversation

@miniMaddy
Copy link
Copy Markdown

This pull request simplifies the logic for starting the dashboard server in both the dashboard.ts and start.ts CLI commands. It removes the distinction between development and production modes, and always uses the pre-built dist-server/start-all.js script with Node.js to start the dashboard. This makes the startup process more consistent and easier to maintain.

  • All tests passed
  • ao start works

…ands

ao start and ao dashboard now always use the production path
(dist-server/start-all.js) regardless of whether they're run from a
source checkout or an installed package. Contributors should use
`pnpm dev` for development, which is unaffected by this change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@miniMaddy
Copy link
Copy Markdown
Author

Solves #876

start-all.js reads the port from process.env.PORT (set by
buildDashboardEnv), not from process.argv. The -p flag was a leftover
from the old npx next dev invocation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@miniMaddy
Copy link
Copy Markdown
Author

Fixed in cf89f51 — removed the unused -p argument from the dashboard.ts spawn call. start-all.js reads the port from process.env.PORT (set by buildDashboardEnv), not process.argv. The -p flag was a leftover from the old npx next dev invocation.

miniMaddy and others added 2 commits April 4, 2026 17:30
Add the missing production build check to ao dashboard and replace the
old dev-era cache cleanup behavior with a real rebuild path for source
checkouts. This fixes ao dashboard --rebuild and keeps ao start --rebuild
consistent with production startup.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Align the preflight unit tests with the expanded checkBuilt validation
for dashboard production artifacts and cover the missing-web-artifacts
failure case.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
miniMaddy and others added 3 commits April 4, 2026 21:24
Check whether dashboard rebuild is supported before attempting to stop
a running dashboard, so unsupported installs fail early without taking
down the current server.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace raw node_modules substring checks with a shared helper so
source checkout paths that merely contain that text are not misclassified
as npm-installed layouts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Drop the unused findProcessWebDir helper and its orphaned tests now
that dashboard rebuild no longer depends on the running process cwd.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 50bdb2e. Configure here.

vi.mock("../../src/lib/dashboard-rebuild.js", () => ({
cleanNextCache: vi.fn(),
findRunningDashboardPid: vi.fn().mockResolvedValue(null),
findProcessWebDir: vi.fn().mockResolvedValue(null),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Test mock missing newly imported function

Low Severity

The mock for dashboard-rebuild.js was partially updated — findProcessWebDir was removed — but rebuildDashboardProductionArtifacts (now imported by start.ts) wasn't added, and cleanNextCache (no longer imported by start.ts) wasn't removed. Any future test exercising the --rebuild path would call undefined and crash with a confusing TypeError.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 50bdb2e. Configure here.

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