Skip to content

fix(ai-chat): sync client tools cache on tool result and align wire type#913

Merged
threepointone merged 1 commit into
mainfrom
fix-client-tools-cache-and-type-alignment
Feb 14, 2026
Merged

fix(ai-chat): sync client tools cache on tool result and align wire type#913
threepointone merged 1 commit into
mainfrom
fix-client-tools-cache-and-type-alignment

Conversation

@threepointone

Copy link
Copy Markdown
Contributor

Update _lastClientTools and persist to SQLite when clientTools arrives via CF_AGENT_TOOL_RESULT, so multi-step tool chains and subsequent continuations always use the latest schemas. Previously the incoming tools were passed through but never cached, leaving _lastClientTools stale.

Also align the clientTools wire type in types.ts with the canonical ClientToolSchema by using JSONSchema7 for parameters instead of Record<string, unknown>.

Update _lastClientTools and persist to SQLite when clientTools arrives
via CF_AGENT_TOOL_RESULT, so multi-step tool chains and subsequent
continuations always use the latest schemas. Previously the incoming
tools were passed through but never cached, leaving _lastClientTools
stale.

Also align the clientTools wire type in types.ts with the canonical
ClientToolSchema by using JSONSchema7 for parameters instead of
Record<string, unknown>.

Co-authored-by: Cursor <cursoragent@cursor.com>
@changeset-bot

changeset-bot Bot commented Feb 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1efe601

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@cloudflare/ai-chat Patch
agents Patch

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

@pkg-pr-new

pkg-pr-new Bot commented Feb 14, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/cloudflare/agents@913

commit: 1efe601

@threepointone
threepointone merged commit bc91c9a into main Feb 14, 2026
4 checks passed
@threepointone
threepointone deleted the fix-client-tools-cache-and-type-alignment branch February 14, 2026 17:25
@github-actions github-actions Bot mentioned this pull request Feb 14, 2026
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