Skip to content

feat: forward user signals to builds/runs#1088

Open
vladfrangu wants to merge 5 commits intomasterfrom
feat/forward-signals
Open

feat: forward user signals to builds/runs#1088
vladfrangu wants to merge 5 commits intomasterfrom
feat/forward-signals

Conversation

@vladfrangu
Copy link
Copy Markdown
Member

Closes #631
Closes #885

Unfortunately Claude doesn't know how to not overdocument but it's fine

@github-actions github-actions Bot added this to the 138th sprint - Tooling team milestone Apr 19, 2026
@github-actions github-actions Bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Apr 19, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves Ctrl+C / signal handling in the CLI by forwarding user interrupts to spawned local processes and by aborting in-progress Apify platform Builds/Runs when the user interrupts the CLI.

Changes:

  • Add forwardSignals support to execWithLog() to forward signals from the CLI to spawned child processes.
  • Introduce useSignalHandler() (Disposable-based) and use it to abort platform Runs/Builds on SIGINT/SIGTERM/SIGHUP.
  • Update TS/ESLint configuration to support Disposable/using patterns and underscore-prefixed unused bindings.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tsconfig.json Adds ESNext.Disposable lib typing support.
src/lib/hooks/useSignalHandler.ts New Disposable-based signal hook with optional terminal-line cleanup.
src/lib/hooks/useCLIVersionAssets.ts Simplifies asset-name destructuring (relies on underscore unused-vars convention).
src/lib/exec.ts Adds forwardSignals plumbing and process-level forwarding handlers.
src/lib/commands/run-on-cloud.ts Aborts platform Runs on signals while streaming/waiting.
src/commands/run.ts Enables signal forwarding for local Node/Python runs via execWithLog.
src/commands/builds/create.ts Aborts platform Builds on signals while streaming build logs.
eslint.config.mjs Allows underscore-prefixed unused vars for using _x = ... patterns.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/commands/builds/create.ts Outdated
Comment thread src/lib/hooks/useSignalHandler.ts
Comment thread src/lib/exec.ts
Comment thread src/lib/exec.ts Outdated
Comment thread src/lib/exec.ts
Comment thread src/lib/commands/run-on-cloud.ts Outdated
@vladfrangu
Copy link
Copy Markdown
Member Author

Let's discuss whether to swallow signals forever or not -> leaning towards "its fine as is right now", the only thing I agree with is the execa signal ?? exitCode change

vladfrangu and others added 2 commits April 20, 2026 01:46
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@l2ysho l2ysho left a comment

Choose a reason for hiding this comment

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

gj @vladfrangu looks good,
btw I tried replicate that abort problem Copilot raised, but with now luck

@l2ysho
Copy link
Copy Markdown
Contributor

l2ysho commented Apr 23, 2026

@vladfrangu to resolve #885 we need to use useSignalHandler also in push command (I guess, because now it is not working)

- consolidates duplicated signal-handler logic from builds/create and run-on-cloud into a single reusable hook
- applies the same hook in actors/push so build aborts work there too
// user gives up waiting (Ctrl+C, SIGTERM from a parent process,
// SIGHUP from a closing terminal). The `using` binding guarantees
// the listener is removed before we poll for final status.
using _signalHandler = useAbortJobOnSignal({
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

isnt this supported only on node 24+?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It gets downcompiled by tsup/down 👀

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Cursor - 2026-04-24 at 07-48-41-UTC@2x

Ignore the terminal breaking (volta doesn't forward signals LOL)

@B4nan
Copy link
Copy Markdown
Member

B4nan commented Apr 24, 2026

Unfortunately Claude doesn't know how to not overdocument but it's fine

Are you running /simplify? It prunes extensive comments too.

@vladfrangu
Copy link
Copy Markdown
Member Author

It seems to be specific to opus 4.7 but I did not know that slash cmd existed!

@B4nan
Copy link
Copy Markdown
Member

B4nan commented Apr 24, 2026

You might need to install it, but its from their official skills.

@B4nan
Copy link
Copy Markdown
Member

B4nan commented Apr 24, 2026

https://github.com/anthropics/claude-plugins-official/blob/main/plugins/code-simplifier/agents/code-simplifier.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

6 participants