-
Notifications
You must be signed in to change notification settings - Fork 363
Open
Description
Context
In #886, we added forwarding of custom body fields to onChatMessage via options.body. However, this only applies to the initial CF_AGENT_USE_CHAT_REQUEST path. The tool continuation path (CF_AGENT_TOOL_RESULT) does not forward body, so options.body will be undefined during auto-continue after client tool results.
Problem
Users who rely on body data (e.g., model selection, temperature) for every onChatMessage invocation will find it missing on tool continuation calls. They would need to manually store it on the first call (e.g., in Durable Object state) and retrieve it on subsequent calls.
Possible approaches
- Persist and re-forward
body— Store the custom body fields from the initial request and automatically pass them through on tool continuations sooptions.bodyis always available. - Document the current behavior — Make it clear in docs/JSDoc that
options.bodyis only populated on the initial chat request and isundefinedduring tool continuations, with guidance on how users can persist it themselves.
References
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels