Skip to content

fix(cli): remove CommonJS require from autopilot ESM modules#1462

Open
eduardg7 wants to merge 1 commit intoruvnet:mainfrom
eduardg7:fix/autopilot-esm-imports
Open

fix(cli): remove CommonJS require from autopilot ESM modules#1462
eduardg7 wants to merge 1 commit intoruvnet:mainfrom
eduardg7:fix/autopilot-esm-imports

Conversation

@eduardg7
Copy link
Copy Markdown

@eduardg7 eduardg7 commented Mar 27, 2026

Summary

  • replace runtime require() calls in autopilot ESM modules with native node: imports
  • remove CommonJS usage from autopilot-state.ts and the log clear path in commands/autopilot.ts
  • add a regression test covering autopilot status

Why

@claude-flow/cli is published as an ESM package ("type": "module"), but the autopilot code path still uses require(). On 3.5.48 this makes autopilot commands fail at runtime with ReferenceError: require is not defined.

Validation

  • cd v3 && pnpm --filter @claude-flow/cli test -- autopilot.test.ts

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