fix(delivery): keep route fields paired to channel during context merge#17337
Closed
Glucksberg wants to merge 1 commit intoopenclaw:mainfrom
Closed
fix(delivery): keep route fields paired to channel during context merge#17337Glucksberg wants to merge 1 commit intoopenclaw:mainfrom
Glucksberg wants to merge 1 commit intoopenclaw:mainfrom
Conversation
bfc1ccb to
f92900f
Compare
Contributor
|
Superseded by #33786. The synthesis PR carries forward the channel-paired delivery-context merge invariants with consolidated regression coverage. |
Contributor
|
Thanks again for this work. This PR was triaged and merged using an AI-assisted review/synthesis workflow. This landed indirectly via the synthesized PR #33786, and your contribution is credited in the changelog and as a co-author on the merge commit. Closing this PR as superseded by #33786 (reason: superseded). If anything here looks incorrect or incomplete, reply to reopen and we can reassess. |
Contributor
|
Correction for accuracy: the synthesized work is credited in the changelog, but the squash merge commit for #33786 does not include explicit |
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.
Fixes #13332
Problem
When Telegram and webchat share the same session (
agent:main:main),mergeDeliveryContext()would inherit route fields (to,accountId,threadId) from the fallback context even when the primary and fallback contexts named different channels. This caused a Telegram-originated reply to pick up webchat'sto/accountIdvalues, mis-routing the response to the webchat UI instead of back to Telegram.Fix
Added a
channelsConflictguard inmergeDeliveryContext()— when both primary and fallback specify different channel names, route fields (to,accountId,threadId) are not inherited from the fallback. They remain paired to the selected channel.This is a 13-line logic change in
src/utils/delivery-context.ts.Changed files
src/utils/delivery-context.ts— added channel-conflict check before fallback inheritancesrc/utils/delivery-context.test.ts— 3 new test cases:normalizeSessionDeliveryFieldstest to verify cross-channel carryover is blockedTests
All 3 new unit tests pass. Existing delivery-context tests updated and passing.
Greptile Summary
Adds cross-channel conflict detection to
mergeDeliveryContext()to prevent route field mis-pairing when Telegram and webchat share the same session. When primary and fallback contexts specify different channels, route fields (to,accountId,threadId) are not inherited from fallback, keeping them paired to the selected channel.Confidence Score: 5/5
Last reviewed commit: 4248f11