-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Remove process exit signal handler #1275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove process exit signal handler #1275
Conversation
🦋 Changeset detectedLatest commit: 45ee10c The changes in this PR will be included in the next version bump. 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 |
Greptile Summary
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant App as "Application"
participant Stagehand as "Stagehand"
participant BaseCache as "BaseCache"
participant Process as "Process"
App->>Stagehand: new Stagehand()
Stagehand->>BaseCache: new BaseCache()
BaseCache->>Process: on("exit", releaseLockOnExit)
Note over BaseCache,Process: Only passive exit handler<br/>No SIGINT/SIGTERM handlers
App->>Process: SIGINT/SIGTERM
Note over App: Application handles signal<br/>Controls shutdown timing
App->>Stagehand: close()
Stagehand->>BaseCache: releaseLock()
BaseCache->>Process: Remove lock file
Process->>Process: "exit" event fires
Process->>BaseCache: releaseLockOnExit()
Note over Process: Application controls process.exit()
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 files reviewed, no comments
Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to v2, this PR will be updated. # Releases ## @browserbasehq/[email protected] ### Patch Changes - [#1275](#1275) [`a372b3c`](a372b3c) Thanks [@miguelg719](https://github.com/miguelg719)! - Remove process exit on signal handler - [#1143](#1143) [`fc06d40`](fc06d40) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - add logger param to external aisdk client - [#1137](#1137) [`2dbac99`](2dbac99) Thanks [@miguelg719](https://github.com/miguelg719)! - Add haiku 4.5 computer use support - [#1116](#1116) [`b419fc3`](b419fc3) Thanks [@tkattkat](https://github.com/tkattkat)! - patch stagehand agent api support - [#1362](#1362) [`f26333e`](f26333e) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - use CDP to find scrollable nodes instead of injected JS - [#1125](#1125) [`cbff109`](cbff109) Thanks [@tkattkat](https://github.com/tkattkat)! - update cua agents key & system prompt handling - [#1363](#1363) [`223e158`](223e158) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - add causedBy to StagehandDefaultError - [#1123](#1123) [`f426ba5`](f426ba5) Thanks [@tkattkat](https://github.com/tkattkat)! - Add pageUrl & timestamp to agent actions - [#1365](#1365) [`2f71b02`](2f71b02) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - export getAccessibilityTree() - [#1366](#1366) [`e098b0d`](e098b0d) Thanks [@miguelg719](https://github.com/miguelg719)! - Update finding scrollable nodes using CDP ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies \[[`a372b3c`](a372b3c), [`fc06d40`](fc06d40), [`2dbac99`](2dbac99), [`b419fc3`](b419fc3), [`f26333e`](f26333e), [`cbff109`](cbff109), [`223e158`](223e158), [`f426ba5`](f426ba5), [`2f71b02`](2f71b02), [`e098b0d`](e098b0d)]: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies \[[`a372b3c`](a372b3c), [`fc06d40`](fc06d40), [`2dbac99`](2dbac99), [`b419fc3`](b419fc3), [`f26333e`](f26333e), [`cbff109`](cbff109), [`223e158`](223e158), [`f426ba5`](f426ba5), [`2f71b02`](2f71b02), [`e098b0d`](e098b0d)]: - @browserbasehq/[email protected] <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Publish Stagehand 2.5.3 and bump evals (1.1.3) and examples (1.0.12). Improves stability, CDP-based scrolling, and adds better logging and error context. - **New Features** - Haiku 4.5 computer-use support. - Export getAccessibilityTree(). - Logger param for the external AISDK client. - Page URL and timestamp on agent actions. - causedBy on StagehandDefaultError for richer error context. - **Bug Fixes** - Detect scrollable nodes via CDP (removed injected JS). - Refined CDP scrollable node detection. - Do not exit the process on signal handler. - Patch agent API support and update CUA key/system prompt handling. <sup>Written for commit 6b62062. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
why
process.exit()calls and signal handlers in BaseCache.ts were causing immediate process termination, interfering with applications' graceful shutdown logic that waits for active jobs to complete.what changed
process.exit()calls from BaseCache.ts and lib/index.tstest plan