Repository navigation
feat(context): record a turn's tools, and say once when they change - #3219
Conversation
…e when the tools change
|
agents
@cloudflare/ai-chat
@cloudflare/codemode
hono-agents
@cloudflare/shell
@cloudflare/think
@cloudflare/voice
@cloudflare/worker-bundler
commit: |
🔴 agents import sizes: 1 entry point over threshold
Changed exports (178)
…and 128 more exports in the workflow artifact. 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 |
…nts the model's own writes
…gh instance state
The context record a session keeps per user message (from #2773) now also holds the tools that turn was sent, as names and hashes. When the next turn sends a different list, the model is told once, right after that turn's user message: what was added, what is gone (not to be called, earlier description to be disregarded), what changed. This is step E3c of extensions (EXTENSIONS.md, "How the change is detected"); the harness passes the list in a follow-up from
ext.Context.prepare({ tools }), an internal option:{ name, hash }[]for the tools this request sends.No changeset: the option is internal and nothing changes for users until the harness passes it.
Cost, only when
toolsis given: one more latest-leaf read per turn, and one record write on the first turn with tools in a session that had records without them. A turn with the same tools writes nothing.Tests (real Durable Object, real Sessions), each failing on main: the notice is sent once, in place, and not again on the next turn; a continuation gets it in
reminder, a retry gets nothing; a session recorded before the fingerprint starts comparing quietly and keeps comparing across a compaction. The context suite (invariants at 60 seeds), ThinkHarness and Think pass.