Repository navigation
fix(think): stop posting a ... placeholder before messenger replies (#2310) - #2324
Merged
threepointone merged 3 commits intoSep 23, 2026
Conversation
🦋 Changeset detectedLatest commit: 05a40ff The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
threepointone
added this pull request to stack #2332
September 23, 2026 14:18
Contributor
⚪ agents import sizesMeasured 343 runtime imports as minified bundles. The primary size is gzip; raw minified size is included for diagnosis. An existing import growing by more than 10% is marked red. This report is informational.
Compared No import sizes changed. All 343 current runtime imports
Reported by agent-think[bot]. |
agents
@cloudflare/ai-chat
@cloudflare/codemode
hono-agents
@cloudflare/shell
@cloudflare/think
@cloudflare/voice
@cloudflare/worker-bundler
commit: |
threepointone
force-pushed
the
fix/2310-messenger-no-placeholder-post
branch
from
September 23, 2026 14:29
ceda591 to
44fa925
Compare
…#2310) Chat SDK posts `...` and edits it when an adapter has no native stream, and Slack keeps that first text as the notification preview. Construct the runtime's Chat with `fallbackStreamingPlaceholderText: null`, and rebuild recovered threads with the same setting since `ThreadImpl.fromJSON` drops it. Adds ThinkMessengerDeliveryTestAgent, which drives real webhook replies through the runtime's own Chat, so the live path is covered end to end. The chat-sdk-messenger example sets the same option on its own Chat and rebuilds recovered threads with it, because bot.reviver() drops it too. Co-authored-by: Cursor <cursoragent@cursor.com>
threepointone
force-pushed
the
fix/2310-messenger-no-placeholder-post
branch
from
September 23, 2026 14:52
44fa925 to
47e327c
Compare
…n recovery With no placeholder, an adapter without native streaming waits for text before posting, so a turn with no text ended in a blank post that Telegram rejects. TextStreamCallback now streams emptyText when a completed turn has none. reviveThread no longer went through chat.reviver(), which re-registers the Chat singleton the lazy thread resolves its adapter from; register it directly. Co-authored-by: Cursor <cursoragent@cursor.com>
A lazily resolved thread reads the module-global Chat singleton on first use, and another runtime in the isolate can register its Chat while recovery awaits the target. Construct the thread with the definition's adapter and this Chat's state adapter instead. Co-authored-by: Cursor <cursoragent@cursor.com>
Merged
This was referenced Sep 27, 2026
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.
Problem
When an adapter cannot stream natively, Chat SDK posts a placeholder
...message and then edits in the reply. Slack uses the first text of a message as its notification preview, so every Think messenger reply notified users with....Fix
Chatis constructed withfallbackStreamingPlaceholderText: null, so the first post already contains reply text.ThreadImpl.fromJSONdrops it.docs/think/messengers.mddescribes the delivery behaviour.chat-sdk-messengerexample sets the option on its ownChat. Its recovery path revived threads withbot.reviver(), which drops the setting too, so it now rebuilds them with a smallreviveReplyThread()helper.A new
ThinkMessengerDeliveryTestAgentdrives real webhooks through the runtime's ownChat, handlers, and adapter post/edit fallback. It records both what the model was asked and what the adapter sent, so the live delivery path is now covered end to end. Later PRs in this stack reuse it.Validation: End-to-end delivery tests assert the first post carries reply text and never
..., for both live and revived threads. A new example test streams a reply into a revived thread; it fails withbot.reviver()alone. The messenger suite, the example's tests, andpnpm run checkpassed.Fixes #2310
Stacked PR 3 of 10. Base: #2323.