Skip to content

fix: end the step once the action is done - #46

Merged
PunGrumpy merged 4 commits into
mainfrom
fix/end-lingering-process
Nov 29, 2026
Merged

PunGrumpy merged 4 commits into
mainfrom
fix/end-lingering-process

Conversation

@PunGrumpy

Copy link
Copy Markdown
Owner

Why

When the action has written its outputs and the job summary, nothing ends the Node process. Node exits only when no handle is left open, and the action knowingly leaves some behind. It gives up on the model-catalog request after ten seconds without aborting it, on a run that ignores cancellation, and on releasing the agent after fifteen seconds. A socket the SDK still holds then keeps the step alive until the request ends or the job's own timeout fires. The default job timeout is six hours.

What changed

src/index.ts arms an unreferenced timer after run() settles. If the process is still alive five seconds later, it logs one line and exits with the code the run already set. A process that exits on its own is not delayed.

The commits read in order: a lingering-handle scenario and its check case, red on the current bundle; the fix with its changeset and one docs line; the rebuilt dist/.

Scope

Only what happens after the action is done. Agent.create and agent.send still run outside the deadline. That gap is separate.

Blast Radius

Every run goes through the new main(). A normal run is unchanged, because the timer does not hold the process open. A run that used to hang now ends five seconds after its outputs are written.

Verification

  • The built bundle, driven with the stubbed SDK. lingering-handle on main's bundle: the outputs are written, then the process never exits and the driver kills it. On this branch it exits by itself after 5.3 s with code 0 and logs "Ending it."
  • finished takes 0.28 s. cancels and model-error still exit 1 and are not delayed.
  • check.mjs prints six ok lines. bun run typecheck, bun run lint, bun run test (111 pass), bun run build, bun run docs:typecheck and bun run docs:build pass. The bundle hash is the same across rebuilds.
  • Not verified: Windows and Linux, and a real SDK handle. The stub's timer stands in for one.

The lingering-handle scenario finishes like a normal run and leaves a timer running, the way an SDK socket that was never closed would. The action writes its outputs and then never exits, so the check fails until the process is ended.
Nothing ended the Node process after the outputs and the job summary were written. A handle the SDK still held, such as the catalog request the action gives up on without aborting, kept the process alive and the step with it, up to the job's own timeout. An unreferenced timer now ends the process five seconds after the action is done. A process that exits on its own is not delayed, and the exit code is the one the run already set.
CI rebuilds dist and fails when it differs from the committed file.
@changeset-bot

changeset-bot Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1fda1cd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@pungrumpy/cursor-action Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cursor-action Ready Ready Preview Nov 29, 2026 8:39am UTC

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 16 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cd56eb0a-5c83-4dea-a464-7a1ba8b1d9ec
Commits

Reviewing files that changed from the base of the PR and between 035bc46 and 1fda1cd.

Files ignored due to path filters: 1

  • dist/index.mjs is excluded by !**/dist/**
Files selected for processing: 7

  • .agents/skills/verify-cursor-action/SKILL.md
  • .agents/skills/verify-cursor-action/features/run-and-outputs.md
  • .agents/skills/verify-cursor-action/scripts/check.mjs
  • .agents/skills/verify-cursor-action/scripts/sdk-stub.mjs
  • .changeset/end-lingering-process.md
  • docs/content/behaviour.mdx
  • src/index.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Without unref the timer would hold every run for five seconds and then end it, and no case would fail. The finished case now requires that the forced-exit line is absent from the log.
@PunGrumpy
PunGrumpy merged commit 71ba1f4 into main Nov 29, 2026
12 checks passed
@PunGrumpy
PunGrumpy deleted the fix/end-lingering-process branch November 29, 2026 08:39
PunGrumpy added a commit that referenced this pull request Nov 29, 2026
Plans 002 to 006 came from a full audit at 8675298 and are merged as #42 to #46. Plan 007 collects the workflow-file edits that were cut from 003, 004 and 005 and is blocked on a token with the workflow scope. The index lists the findings that were vetted and not planned, and the ones that were rejected, so a later audit does not repeat them.
PunGrumpy added a commit that referenced this pull request Nov 29, 2026
Plans 002 to 006 came from a full audit at 8675298 and are merged as #42 to #46. Plan 007 collects the workflow-file edits that were cut from 003, 004 and 005 and is blocked on a token with the workflow scope. The index lists the findings that were vetted and not planned, and the ones that were rejected, so a later audit does not repeat them.

This branch was successfully deployed

1 active deployment
Preview — 1fda1cd9 Deployed Nov 29, 2026 by vercel[bot]
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