Change CallId to allow for more data.#793
Conversation
The agent identifier and name of the function called are now optional; the callId itself is still required. This enables support for stateless backends, especially where there are multiple instances sharing a backing session store.
There was a problem hiding this comment.
Code Review
This pull request refactors the CallId type from a string to an object to support stateless backends by allowing optional agentId and call name properties. The changes are consistently applied to the schema and test files. My primary feedback is a suggestion to improve the naming within the new CallId object for better clarity. Also, please note that this breaking change should be documented in the CHANGELOG.md as per repository guidelines.
Note: Security Review has been skipped due to the limited scope of the PR.
| "type": "object", | ||
| "description": "The unique identifier for a server initiated function call.", | ||
| "properties": { | ||
| "agentId": { | ||
| "type": "string", | ||
| "description": "Identifies the agent initiating the function call." | ||
| }, | ||
| "call": { | ||
| "type": "string", | ||
| "description": "Name of the function call." | ||
| }, | ||
| "callId": { | ||
| "type": "string", | ||
| "description": "Uniquely identifies this instance of the function call." | ||
| } | ||
| }, | ||
| "required": ["callId"] |
There was a problem hiding this comment.
The property name callId within the CallId object is a bit repetitive (CallId.callId). For better clarity and to avoid this stutter, consider renaming callId to id. This would result in a more idiomatic CallId.id.
This change would also require updating the required field here and all test cases to use id instead of callId (e.g., "functionCallId": { "id": "unique-call-id-123" }).
| "type": "object", | |
| "description": "The unique identifier for a server initiated function call.", | |
| "properties": { | |
| "agentId": { | |
| "type": "string", | |
| "description": "Identifies the agent initiating the function call." | |
| }, | |
| "call": { | |
| "type": "string", | |
| "description": "Name of the function call." | |
| }, | |
| "callId": { | |
| "type": "string", | |
| "description": "Uniquely identifies this instance of the function call." | |
| } | |
| }, | |
| "required": ["callId"] | |
| "type": "object", | |
| "description": "The unique identifier for a server initiated function call.", | |
| "properties": { | |
| "agentId": { | |
| "type": "string", | |
| "description": "Identifies the agent initiating the function call." | |
| }, | |
| "call": { | |
| "type": "string", | |
| "description": "Name of the function call." | |
| }, | |
| "id": { | |
| "type": "string", | |
| "description": "Uniquely identifies this instance of the function call." | |
| } | |
| }, | |
| "required": ["id"] |
For cases that need the function call name, the suggestion is to build it into the `callId`. E.g., "<function call name>-<unique id>"
Description
The agent identifier and name of the function called are now optional; the callId itself is still required.
This enables support for stateless backends, especially where there are multiple instances sharing a backing session store.
Pre-launch Checklist