Skip to content

fix: address issues #135, #133, #131, #129#165

Merged
Mingwwww merged 4 commits into
OpenBMB:mainfrom
Kaguya-19:fix-from-issues
Jun 5, 2026
Merged

fix: address issues #135, #133, #131, #129#165
Mingwwww merged 4 commits into
OpenBMB:mainfrom
Kaguya-19:fix-from-issues

Conversation

@Kaguya-19
Copy link
Copy Markdown
Collaborator

Summary

Batch fix for four open issues reported by @Livezt:

Test plan

  • Verify background tasks correctly report completionStatusSentInAttachment = true after completion/failure/cancellation
  • Verify GatewayBrowserClient.connect() resolves on hello_ok without CPU-intensive polling
  • Verify stream normalization works correctly for both Anthropic and OpenAI providers
  • Verify WebSocket reconnects cleanly when auth token changes (no stale connections or phantom timers)

Closes #135, closes #133, closes #131, closes #129

Made with Cursor

Kaguya-19 and others added 4 commits June 5, 2026 16:02
The flag was initialized to false but never flipped to true when a task
reached a terminal state (completed/failed/cancelled), making it dead
code. Set it to true in both the exit handler and the spawn-error path.

Closes OpenBMB#135

Co-authored-by: Cursor <cursoragent@cursor.com>
The 10ms polling loop woke up ~100 times/sec just to check a flag.
Replace with a deferred Promise resolved by handleMessage on hello_ok
or rejected by handleClose/timeout. Remove the now-unused sleep helper.

Closes OpenBMB#133

Co-authored-by: Cursor <cursoragent@cursor.com>
Only allocate the stream state object for the provider actually in use,
instead of always creating both Anthropic and OpenAI state per stream.
The normalizeStreamEvent function falls back to lazy init if the caller
passes a partial state object.

Closes OpenBMB#131

Co-authored-by: Cursor <cursoragent@cursor.com>
Two bugs fixed:
1. unmountedRef was set to true in the token-change cleanup, permanently
   blocking subsequent connect() calls. Moved unmount detection to a
   separate effect so it only fires on real unmount.
2. Old WebSocket onclose fired asynchronously after cleanup and spawned
   phantom reconnect timers with a stale token. Added a generation
   counter (connectIdRef) — all callbacks bail out when their generation
   no longer matches. Cleanup also nulls out event handlers on the old
   socket before closing it.

Closes OpenBMB#129

Co-authored-by: Cursor <cursoragent@cursor.com>
@Mingwwww Mingwwww merged commit ad164fd into OpenBMB:main Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants