Session.invalidate() leaves in-flight CDP calls pending

Open Beginner friendly
#154 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
typescript
Domain
backend

Research direction

Search the TypeScript source for Session.invalidate(), the WebSocket close listener, and the pending call collection. Reproduce an in-flight CDP call during invalidation, then add or update a test to verify that the call rejects with the invalidation error and no pending entry remains.

Written by the indexing model from the issue text.

Description

Description

Session.invalidate() clears this.ws before closing the socket. The close listener then treats that socket as superseded and returns without rejecting entries in pending, so an in-flight CDP call can remain pending forever.

Plugins

None

OpenCode version

main at e634099

Steps to reproduce
  1. Connect a Session to a WebSocket endpoint.
  2. Start a CDP call that does not receive a response.
  3. Call session.invalidate(error).
  4. Observe that the call never settles. It should reject with the invalidation error.
Screenshot and/or share link

No response

Operating System

macOS

Terminal

Codex desktop

Dominant language
TypeScript
Stars
737
Forks
87
Avg merge
1d 4h
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from browser-use/browsercode

All issues in browser-use/browsercode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.