agent-orchestrator/packages/cli/__tests__/commands
Ashish Huddar 48d655d932
fix: reduce dashboard JS bundle from 1.7MB to 170KB (#792) (#928)
* fix: reduce dashboard JS bundle from 1.7MB to 170KB (gzipped) (#792)

Switch `ao start` default from `next dev` (7.6MB uncompressed) to optimized
production builds (128KB per route). Add `--dev` flag for HMR when editing
dashboard UI. Add bundle analyzer, server-only guards, and lazy-load
DirectTerminal via next/dynamic.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: skip dashboard rebuild when assets exist, fix CI timeout

Skip the production build step when .next/BUILD_ID and dist-server/
already exist (e.g. after pnpm build in CI). Add c8 ignore for
untestable process-spawning startup code to fix diff coverage.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor: adopt PR #903 patterns — centralize rebuild logic and add preflight web artifact checks

Extract rebuildDashboardProductionArtifacts into dashboard-rebuild.ts, add
isInstalledUnderNodeModules/assertDashboardRebuildSupported guards, remove
findProcessWebDir, and verify .next/BUILD_ID + dist-server/start-all.js in
preflight. Dashboard command now always uses production server.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: skip production preflight in --dev mode, add coverage for rebuild helpers

- Skip preflight.checkBuilt() when --dev is passed (dev mode uses HMR,
  doesn't need .next/BUILD_ID or dist-server/start-all.js)
- Add c8 ignore to dashboard.ts process-spawning code (matches start.ts pattern)
- Add tests for rebuildDashboardProductionArtifacts (success, failure, npm guard)
- Add preflight tests for npm-install web artifact hint paths

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: align preflight skip with actual dev-server condition

Only skip production artifact preflight when both --dev is passed AND
we're in the monorepo (where dev mode actually works). For npm global
installs, --dev is silently ignored and production server runs, so
preflight must still validate .next/BUILD_ID and dist-server/start-all.js.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: match @next/bundle-analyzer version to next@^15.1.0

The @next/* packages follow the Next.js release train. Pin the bundle
analyzer to ^15.1.0 to match the project's next dependency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: correct recovery command for npm installs and remove redundant guard

- Change stale-build recovery suggestion from "ao update" (which only
  works in source checkouts) to "npm install -g @composio/ao@latest"
  for npm global installs
- Remove redundant assertDashboardRebuildSupported call in dashboard.ts
  since rebuildDashboardProductionArtifacts already calls it internally

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 16:12:51 +05:30
..
dashboard.test.ts fix: reduce dashboard JS bundle from 1.7MB to 170KB (#792) (#928) 2026-04-07 16:12:51 +05:30
doctor.test.ts feat(cli): add plugin resolution checks to ao doctor 2026-04-01 06:39:14 +05:30
init.test.ts Resolve remaining PR review comments 2026-03-17 15:51:02 +05:30
open.test.ts feat: seamless onboarding with enhanced documentation (#66) 2026-02-16 22:22:13 +05:30
plugin.test.ts fix: resolve lint errors in plugin, start, and test files 2026-03-31 05:05:50 +05:30
review-check.test.ts feat: add PR claim flow for agent sessions (#326) 2026-03-07 03:54:19 +05:30
send.test.ts use plugin store for shared loader paths 2026-03-31 04:02:25 +05:30
session.test.ts revert: remove model rate-limit pause functionality (PR #367) (#908) 2026-04-06 14:58:41 +05:30
setup.test.ts fix(notifier): remove desktop notifications from default configs (#962) 2026-04-07 08:59:51 +05:30
spawn.test.ts fix: detect nested project directories in CLI auto-resolution 2026-04-01 18:28:57 +05:30
start.test.ts fix: reduce dashboard JS bundle from 1.7MB to 170KB (#792) (#928) 2026-04-07 16:12:51 +05:30
status.test.ts fix(cli/status): validate --interval only when --watch is used 2026-04-01 11:05:30 +05:30
update.test.ts feat: add doctor and update maintenance tooling (#437) 2026-03-12 20:59:22 +05:30