feat(bridge): parallel message processing for IM channels#273
Open
lowmiaq-gmail wants to merge 1 commit intoop7418:mainfrom
Open
feat(bridge): parallel message processing for IM channels#273lowmiaq-gmail wants to merge 1 commit intoop7418:mainfrom
lowmiaq-gmail wants to merge 1 commit intoop7418:mainfrom
Conversation
When `bridge_parallel_tasks` is enabled, messages arriving while the session is busy are dispatched to ephemeral worker sessions instead of being serialized in a per-session Promise chain. This eliminates the queue delay users experience when sending multiple messages rapidly on Feishu/Telegram/Discord. Worker sessions inherit provider, model, working directory, and mode from the parent binding but do NOT overwrite the channel_bindings row, so the primary chat→session mapping stays intact. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Someone is attempting to deploy a commit to the op7418's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bridge_parallel_taskssetting istrue, messages arriving while a session is busy are dispatched to ephemeral worker sessions instead of being queued serially in a per-session Promise chainchannel_bindings— the primary chat→session mapping stays intactbridge_parallel_tasksis unset orfalse, behavior is unchanged (serial processing)Problem
When users send multiple messages rapidly on Feishu/Telegram/Discord, each message was serialized via
processWithSessionLock(). The second message had to wait for the first to complete before processing could begin, causing noticeable delays and queue notifications.Solution
Added a busy-session check (
activeTasks+sessionLocks) in the adapter loop. When a session is detected as busy:createWorkerBinding()creates a new ephemeral session inheriting parent configFiles changed
src/lib/bridge/bridge-manager.ts— parallel dispatch logic inrunAdapterLoop(),handleMessage()accepts optional override bindingsrc/lib/bridge/channel-router.ts— newcreateWorkerBinding()functionTest plan
bridge_parallel_tasks=truein settings🤖 Generated with Claude Code