Skip to content

Conversation

@kzu
Copy link
Member

@kzu kzu commented Jun 20, 2025

The previous approach assumed responses would only be generated by the target handler, not the intermediate pipeline. This meant that reactions or other cross-cutting messages sent by other stages in the pipeline would be missed by the sender, since it wrapped only around the target handler in the pipeline.

We now wrap around the outermost handler too, and the sending handler (which will have two instances running now) only sends unsent messages it sees (since the innermost will have sent the ones generated by the target).

Obviously, this means that the placement of the UseConversation handler is relevant since it persists responses which have a message ID, which will only be the case for messages that reach it after the target and its innermost sender. Pipeline-generated messages that run before the conversation one will therefore not be saved (as expected) but will still be sent out by the outermost handler.

The previous approach assumed responses would only be generated by the target handler, not the intermediate pipeline. This meant that reactions or other cross-cutting messages sent by other stages in the pipeline would be missed by the sender, since it wrapped only around the target handler in the pipeline.

We now wrap around the outermost handler too, and the sending handler (which will have two instances running now) only sends unsent messages it sees (since the innermost will have sent the ones generated by the target).

Obviously, this means that the placement of the UseConversation handler is relevant since it persists responses which have a message ID, which will only be the case for messages that reach it *after* the target and its innermost sender. Pipeline-generated messages that run before the conversation one will therefore not be saved (as expected) but will still be sent out by the outermost handler.
@kzu kzu requested a review from adalon June 20, 2025 20:29
@kzu kzu added the enhancement New feature or request label Jun 20, 2025
@kzu kzu enabled auto-merge (rebase) June 20, 2025 20:30
@kzu
Copy link
Member Author

kzu commented Jun 20, 2025

36 passed 36 passed 7 skipped

🧪 Details on Ubuntu 24.04.2 LTS

from dotnet-retest v0.7.1 on .NET 8.0.17 with 💜 by @devlooped

@kzu kzu merged commit ebd58e9 into main Jun 20, 2025
7 checks passed
@kzu kzu deleted the dev/PipelineSender branch June 20, 2025 20:31
@devlooped devlooped locked and limited conversation to collaborators Jul 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants