Skip to content

Chat: hydrationByteBudget bounds what a model call reads (4.iii 6f, parity 4, draft) - #3312

Closed
mattzcarey wants to merge 2 commits into
slim/chat-fn-6f1from
slim/chat-fn-6f5
Closed

mattzcarey wants to merge 2 commits into
slim/chat-fn-6f1from
slim/chat-fn-6f5

Conversation

@mattzcarey

Copy link
Copy Markdown
Member

DRAFT, 4.iii 6f parity step 4, stacked on #3311. ChatHost.options.hydrationByteBudget (RFC ChatOptions) bounds the transcript a model call reads: the definition reads session.getRecentHistory(budget), the newest messages that fit, always at least the latest, instead of the whole path. That is what AIChatAgent and Think's budget does today. Test: with three 2 KB messages and a 3,000-byte budget, the call gets the newest and not the oldest.

maxPersistedMessages (AIChatAgent's cap on stored messages) is the next parity step.

Cost: a budgeted read reads fewer rows than the whole path.

@changeset-bot

changeset-bot Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 861fa46

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

agents

npm i https://pkg.pr.new/agents@3312

@cloudflare/ai-chat

npm i https://pkg.pr.new/@cloudflare/ai-chat@3312

@cloudflare/codemode

npm i https://pkg.pr.new/@cloudflare/codemode@3312

hono-agents

npm i https://pkg.pr.new/hono-agents@3312

@cloudflare/shell

npm i https://pkg.pr.new/@cloudflare/shell@3312

@cloudflare/think

npm i https://pkg.pr.new/@cloudflare/think@3312

@cloudflare/voice

npm i https://pkg.pr.new/@cloudflare/voice@3312

@cloudflare/worker-bundler

npm i https://pkg.pr.new/@cloudflare/worker-bundler@3312

commit: 861fa46

@agent-think

agent-think Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

✅ agents import sizes: no significant changes (77bec889 → 861fa46d, workflow run)

@mattzcarey
mattzcarey force-pushed the slim/chat-fn-6f5 branch 2 times, most recently from 46166ad to 592b42a Compare November 27, 2026 00:13
@mattzcarey
mattzcarey changed the base branch from slim/chat-fn-6f4 to slim/chat-fn-6f1 November 27, 2026 00:13
@mattzcarey

Copy link
Copy Markdown
Member Author

Closed to drain open PRs (COMMON, 27 Nov). This PR's commits are commits of #3361 (the switch), which now sits directly on #3298. The branch is kept.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant