Repository navigation
A queued message is stored when its turn starts, so each turn answers its own message - #2928
Open
mattzcarey wants to merge 11 commits into
Open
mattzcarey wants to merge 11 commits into
mattzcarey wants to merge 11 commits into
Conversation
…was shown it as queued
…reply is not drawn twice
…without the reply it resumes
🦋 Changeset detectedLatest commit: 724b087 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 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 |
agents
@cloudflare/ai-chat
@cloudflare/codemode
hono-agents
@cloudflare/shell
@cloudflare/think
@cloudflare/voice
@cloudflare/worker-bundler
commit: |
Contributor
🔴 agents import sizes: 1 entry point over threshold
Changed exports (3)
How this worksEach runtime export is bundled on its own, minified, and gzipped. Changes smaller than 100 B, or smaller than 1% and 1 KiB, are ignored. Growth over 10% or 5 KiB is marked 🔴. This report is informational and does not fail CI. The workflow artifact contains every measurement. Compared |
…e records on whole characters, keep queued messages to their chat and setMessages
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.
A message sent while a turn runs is now stored when its own turn starts, not when it arrives, in both
AIChatAgentandThink. Each turn answers its own message and the transcript readsU1, A1, U2, A2. Tabs still see the waiting message at once: message lists end with it and name it in a newqueuedMessageIdsfield, anduseAgentChatdraws it after the streaming reply.Before, a queued message was stored at acceptance, so the transcript read
U1, U2, A1and the queued turn's model request ended in the first reply. On deployed Workers withgpt-oss-120bthe queued "Say the word apple." got a second reply of "apple" in 5 of 40 runs before this change and 200 of 200 after it, live and after an isolate reset, underqueue,latest,mergeanddebounce. What apps can observe:this.messages(and the messagesonChatMessagebuilds from, and Think's model context) gains a waiting message only when its turn starts. The running turn and its recovery never see it.queuethe stored order isU1, A1, U2, A2. A superseded (latest,merge,debounce) or stopped waiting message is stored at its place in the queue with no reply. A clear while it waits means it is never stored.CF_AGENT_CHAT_MESSAGESframes can carryqueuedMessageIds, and a tab that connects while something waits is sent that list./get-messagesstill returns stored messages only.The waiting message lives on the request's admission record from #2918 (
cf_agents_chat_admissions, new columns, plus a_messagestable for large messages). That record also replaces the recovery-leaf and snapshot special cases. RFC rows D101 to D108 and the queueing docs are updated. A TLA+ spec (ChatOrder.tla, checked with everystate) covers resets, stops and clears at every step.Validated with the agents chat, ai-chat workers and React, and Think suites, plus
pnpm run buildandpnpm run check. New tests fail before the change, including real isolate resets withctx.abort(). I also ran a deployed probe (tc-order) and checked two and three browser tabs againsttc-order-client.