Skip to content

feat: Honour the Actor's original start command when run as ENTRYPOINT - #12

Closed
Pijukatel wants to merge 1 commit into
masterfrom
pr-toolkit-troubles
Closed

Pijukatel wants to merge 1 commit into
masterfrom
pr-toolkit-troubles

Conversation

@Pijukatel

Copy link
Copy Markdown
Collaborator

Running as the image CMD has two problems: the Actor's real start command is lost (the entrypoint is guessed from package.json/conventional paths), and an ENTRYPOINT defined in the Actor's own Dockerfile silently swallows our CMD, so the Actor runs with no debugger and no error.

As ENTRYPOINT, Docker appends the image's own CMD to our arguments. Everything after --brk is now treated as that start command and resolved into a Node.js launch spec, keeping the original node flags and script arguments:

node [flags] <script> [args] -> that script, flags and args preserved
npm|pnpm|yarn [run] <script> -> the package.json script, parsed again
sh -c "" -> the inner command, parsed again
-> that file (the explicit-path form)

Chained scripts are resolved from the last segment back, so npm run build && node dist/main.js debugs the Actor, not the build step. With no command passed, the previous auto-detection still applies, so the existing CMD forms keep working unchanged. When a command is passed but no Node.js entrypoint can be derived from it, the debugger fails fast with the reason instead of starting the Actor undebuggable.

Adds a node:test suite for the resolver (no new dependencies) and runs it, plus a syntax check of the new module, in the release workflow.

Claude-Session: https://claude.ai/code/session_01UTxccb4QARxDG34guZbeFG

Running as the image CMD has two problems: the Actor's real start command is
lost (the entrypoint is guessed from package.json/conventional paths), and an
ENTRYPOINT defined in the Actor's own Dockerfile silently swallows our CMD, so
the Actor runs with no debugger and no error.

As ENTRYPOINT, Docker appends the image's own CMD to our arguments. Everything
after --brk is now treated as that start command and resolved into a Node.js
launch spec, keeping the original node flags and script arguments:

  node [flags] <script> [args]      -> that script, flags and args preserved
  npm|pnpm|yarn [run] <script>      -> the package.json script, parsed again
  sh -c "<command>"                 -> the inner command, parsed again
  <path>                            -> that file (the explicit-path form)

Chained scripts are resolved from the last segment back, so
`npm run build && node dist/main.js` debugs the Actor, not the build step.
With no command passed, the previous auto-detection still applies, so the
existing CMD forms keep working unchanged. When a command is passed but no
Node.js entrypoint can be derived from it, the debugger fails fast with the
reason instead of starting the Actor undebuggable.

Adds a node:test suite for the resolver (no new dependencies) and runs it,
plus a syntax check of the new module, in the release workflow.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UTxccb4QARxDG34guZbeFG
@Pijukatel Pijukatel changed the title feat: honour the Actor's original start command when run as ENTRYPOINT feat: Honour the Actor's original start command when run as ENTRYPOINT Sep 7, 2026
@Pijukatel Pijukatel closed this Sep 7, 2026
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.

3 participants