Skip to content

fix: bound the timeout and release the agent - #22

Merged
PunGrumpy merged 3 commits into
mainfrom
fix/hard-timeout-dispose-agent
Oct 18, 2026
Merged

PunGrumpy merged 3 commits into
mainfrom
fix/hard-timeout-dispose-agent

Conversation

@PunGrumpy

Copy link
Copy Markdown
Owner

Description

The timeout input only asked the SDK to cancel; after that the runner kept awaiting run.stream() and run.wait() with no bound, so a run that ignored the request held the step until the job's timeout-minutes (six hours by default) while still consuming tokens. The runner now races the run against the deadline, requests cancellation, waits at most ten seconds for the SDK to settle, and otherwise reports the run as cancelled with exit code 1. It also disposes the agent (Symbol.asyncDispose) on every path, bounded by its own fifteen-second limit, which releases the local executor the SDK started for the run.

Stacked on #19.

Related Issues

None.

Checklist

  • I've reviewed my code
  • I've written tests (skip if not applicable, e.g. .github/–only changes)
  • I've added a changeset when the change affects the published action or release notes (skip for .github/–only community or template updates)
  • I've updated the docs, if necessary

Screenshots (if applicable)

N/A

Additional Notes

A run that finishes during the cancel grace period keeps its result and exit code 0, with a warning that it overran the timeout, so the previous behaviour for agents that do not support cancellation is preserved, just bounded. New tests cover a run that ignores cancellation, disposal after success, disposal after a failed send, and a hanging dispose. Worth running the manual Smoke Test before release to confirm the process exits promptly once the agent is released.

@vercel

vercel Bot commented Oct 18, 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 Oct 18, 2026 11:30am UTC

@changeset-bot

changeset-bot Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5b35e19

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

@coderabbitai

coderabbitai Bot commented Oct 18, 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 17 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
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1c6bc395-ee3e-4483-bf89-60940ef4377a
📥 Commits

Reviewing files that changed from the base of the PR and between 18f70f7 and 5b35e19.

⛔ Files ignored due to path filters: 1
  • dist/index.mjs is excluded by !**/dist/**
📒 Files selected for processing: 5
  • .changeset/hard-timeout-and-dispose.md
  • __tests__/runner.test.ts
  • docs/content/behaviour.mdx
  • docs/content/troubleshooting.mdx
  • src/runner.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

Comment @coderabbitai help to get the list of available commands.

@PunGrumpy
PunGrumpy changed the base branch from fix/collect-assistant-text to main October 18, 2026 11:27
Cancelling only asked the SDK to stop and the runner kept waiting on the stream with no limit, so a run that ignored the request held the step until the job timeout. Wait a bounded grace period after cancelling, report the run as cancelled, and dispose the agent on every path so the local executor is released.
Add a run that ignores cancellation, and check that the agent is released after success, after a failed send, and when releasing it hangs.
The timeout now stops waiting ten seconds after the cancel request, and the agent is released when the run ends.
@PunGrumpy
PunGrumpy force-pushed the fix/hard-timeout-dispose-agent branch from 710b82c to 5b35e19 Compare October 18, 2026 11:29
@PunGrumpy
PunGrumpy merged commit b13383c into main Oct 18, 2026
12 of 13 checks passed

This branch was successfully deployed

1 active deployment
Preview — 5b35e197 Deployed Oct 18, 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