Repository navigation
feat(tools): show what a tool call is doing - #2138
Merged
Merged
Conversation
A tool call's state (tool_call.started, .progress, .finished) carries display_title, the title its tool was declared with, or "Searching the web" for the router's own search, the default a Chat reply's tool step already used (conversation.ToolTitle). A worker's host_tools frame takes display_title per tool. Every SDK can declare one: Go's tools.DisplayTitle, and the Python, JavaScript, Kotlin, Swift, Dart, .NET, Ruby, Rust and PHP registries, which also get lighter ways to describe parameters. The generated clients are regenerated; Swift's generates no ToolCallState, so it is unchanged. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
While a tool runs, apps had only the tool's name and
progressto show. The title a tool was declared with (display_title) reached a Chat reply's tool step but not the session socket's tool call state, and a worker'shost_toolsframe dropped it. Each SDK also gets a lighter way to describe a tool's parameters, which the getstream.io tool calling docs now use.How it works
Changes
ToolCallState.display_title,dispatch.Tool.DisplayTitleonhost_tools, andconversation.ToolTitleshared with the Chat reply's tool step.openapi.yamland the generated clients are regenerated (Go, JavaScript, Python, Ruby, PHP, .NET). Swift generates noToolCallState, so it is unchanged.tools.DisplayTitle(title), sent onhost_tools.schemars), keyword blocks andparams:in Ruby,Tools::stringsin PHP,[Description]records in .NET, docstrings in Python. JavaScript's ReactuseToolis also covered.Validation
internal/session,internal/conversation,internal/dispatchandsdks/gotests;TestACallIsShownDoingWhatItsToolWasDeclaredWith,TestAHostedToolKeepsWhatItsCallsAreShownDoing,TestAHostedFunctionTellsTheRouterWhatItsCallsAreShownDoing.go run ./cmd/openapileaves the spec unchanged.npm test(735 tests),uv run dev.py check(2246 passed), and in Docker: Rustcargo test, .NET (308), PHP (343, plus PHPStan), Ruby (237, plus its generator check), Dart (flutter analyze, generator check, 293), Kotlin:core:testDebugUnitTest. Swiftgenerate.py --checkpasses.test_a_user_token_cannot_be_minted_without_a_secret, fails on main as well.