{{ message }}
Repository navigation
fix(think): telegramMessenger nativeStreaming option (#2397) - #2414
Merged
Merged
Conversation
… Think-verified webhooks (#2397) Co-authored-by: Cursor <cursoragent@cursor.com>
25 of 46 tasks
Comment on lines
+21
to
+29
| describe("telegram messenger adapter config (#2397)", () => { | ||
| it("forwards nativeStreaming to the adapter", () => { | ||
| telegramMessenger({ | ||
| nativeStreaming: true, | ||
| secretToken: "secret", | ||
| token: "token", | ||
| userName: "fake_bot" | ||
| }); | ||
| expect(lastAdapterConfig()).toMatchObject({ nativeStreaming: true }); |
Contributor
There was a problem hiding this comment.
Contributor
Author
There was a problem hiding this comment.
Intentional. Bumping the lockfile to chat/@chat-adapter/telegram 4.38+ changes the private Chat.prototype.drainQueue signature that Think's recovery drain (#2312) relies on (see #2397), so that belongs in a separate dependency-update PR. What Think controls here is the config it passes the adapter, which these tests cover; draft streaming and webhook validation are the adapter's own behaviour.
Contributor
|
✅ agents import sizes: no significant changes ( |
Merged
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 #2397.
The problem
@chat-adapter/telegram4.38 made native draft streaming opt-in throughTelegramAdapterConfig.nativeStreaming(defaultfalse).telegramMessengerbuilds the adapter itself and didn't forward the option, so with 4.38+ private-chat replies always posted a placeholder and edited it, with no way to turn drafts back on.The same adapter versions throw at construction in webhook mode when there's no
secretToken, unlessallowUnverifiedWebhooksis set. SotelegramMessenger({ verifyWebhook: false })and customverifyWebhookfunctions without a secret threwsecretToken is required in webhook mode.What changed
TelegramMessengerOptions.nativeStreaming?: boolean, forwarded tocreateTelegramAdapter.allowUnverifiedWebhooks: !options.secretTokenis passed to the adapter. Think already refuses a webhook with neither a secret token nor an explicitverifyWebhook, so this only applies when Think verifies the webhook itself or the caller opted out.^4.29.0adapter range. Older adapters ignore the extra fields. There's no dependency bump, so thechat4.41drainQueuesignature change mentioned in the issue doesn't come into play here.docs/think/messengers.mddocuments the option.Based on the reference implementation in harryy2510#1. Thanks @harryy2510.
Tests
telegram-messenger.test.tschecks thatnativeStreamingis forwarded (and left unset by default), and thatallowUnverifiedWebhooksisfalsewith a secret token andtruewithverifyWebhook: false. The full Think suite passes andpnpm run checkis clean.