File tree Expand file tree Collapse file tree 4 files changed +16
-29
lines changed
evals/deterministic/tests/browserbase Expand file tree Collapse file tree 4 files changed +16
-29
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @browserbasehq/stagehand " : patch
3+ ---
4+
5+ Remove process exit on signal handler
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ test.describe("Browserbase Sessions", () => {
2323 } ) ;
2424 await bigStagehand . init ( ) ;
2525 await bigStagehand . page . goto (
26- "https://docs.stagehand.dev/first-steps/introduction" ,
26+ "https://docs.stagehand.dev/v3/ first-steps/introduction" ,
2727 ) ;
2828 sessionId = bigStagehand . browserbaseSessionID ;
2929 if ( ! sessionId ) {
@@ -45,7 +45,7 @@ test.describe("Browserbase Sessions", () => {
4545 const page = stagehand . page ;
4646
4747 expect ( page . url ( ) ) . toBe (
48- "https://docs.stagehand.dev/first-steps/introduction" ,
48+ "https://docs.stagehand.dev/v3/ first-steps/introduction" ,
4949 ) ;
5050 } ) ;
5151 test ( "resumes a session via CDP URL" , async ( ) => {
@@ -63,7 +63,7 @@ test.describe("Browserbase Sessions", () => {
6363 const page = stagehand . page ;
6464
6565 expect ( page . url ( ) ) . toBe (
66- "https://docs.stagehand.dev/first-steps/introduction" ,
66+ "https://docs.stagehand.dev/v3/ first-steps/introduction" ,
6767 ) ;
6868 } ) ;
6969} ) ;
Original file line number Diff line number Diff line change @@ -43,34 +43,17 @@ export class BaseCache<T extends CacheEntry> {
4343 }
4444
4545 private setupProcessHandlers ( ) : void {
46- const releaseLockAndExit = ( ) => {
46+ const releaseLockOnExit = ( ) => {
4747 this . releaseLock ( ) ;
48- process . exit ( ) ;
4948 } ;
5049
51- process . on ( "exit" , releaseLockAndExit ) ;
52- process . on ( "SIGINT" , releaseLockAndExit ) ;
53- process . on ( "SIGTERM" , releaseLockAndExit ) ;
54- process . on ( "uncaughtException" , ( err ) => {
55- this . logger ( {
56- category : "base_cache" ,
57- message : "uncaught exception" ,
58- level : 2 ,
59- auxiliary : {
60- error : {
61- value : err . message ,
62- type : "string" ,
63- } ,
64- trace : {
65- value : err . stack ,
66- type : "string" ,
67- } ,
68- } ,
69- } ) ;
70- if ( this . lockAcquired ) {
71- releaseLockAndExit ( ) ;
72- }
73- } ) ;
50+ // Passive cleanup on exit - doesn't interfere with signal handling
51+ process . on ( "exit" , releaseLockOnExit ) ;
52+
53+ // Note: We intentionally do NOT handle SIGINT/SIGTERM here.
54+ // Applications using Stagehand as a library should manage their own
55+ // signal handlers for graceful shutdown, and call cleanup methods
56+ // (like releaseLock or a future dispose() method) explicitly.
7457 }
7558
7659 protected ensureCacheDirectory ( ) : void {
Original file line number Diff line number Diff line change @@ -698,7 +698,6 @@ export class Stagehand {
698698 } ) ;
699699 } finally {
700700 // Exit explicitly once cleanup is done
701- process . exit ( 0 ) ;
702701 }
703702 } ;
704703
You can’t perform that action at this time.
0 commit comments