feat(simulation): add optional tools parameter to ToolSimulator (#208) - #209
Merged
poshinchen merged 1 commit intoMay 5, 2026
Merged
Conversation
kaghatim
temporarily deployed
to
manual-approval
April 30, 2026 20:47 — with
GitHub Actions
Inactive
poshinchen
approved these changes
May 5, 2026
This was referenced Jul 23, 2026
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.
Description
Add an optional
toolsparameter toToolSimulator.__init__that gets passed through to the internal simulationAgent. This lets users provide helper tools (likecalculatorfromstrands-agents-tools) to improve the accuracy of simulated responses, especially for stateful, arithmetic-heavy simulations.Currently the simulation agent is created with
tools=[]hardcoded. This works fine for simple simulations, but when simulating APIs that require arithmetic consistency across multiple tool calls (e.g. inventory reconciliation, order metrics, settlement calculations), the LLM frequently gets the math wrong. Those errors compound because theStateRegistryfeeds previous responses back into subsequent prompts.The change is minimal and fully backward compatible.
toolsdefaults toNone(stored as[]), so existing behavior is unchanged.What changed
ToolSimulator.__init__accepts an optionaltoolsparameter_simulate_tool_callpassesself.toolsto theAgentconstructor instead of[]Example usage
Related Issues
Closes #208
Documentation PR
No documentation changes needed. The new parameter follows existing patterns and is optional with a sensible default.
Type of Change
New feature
Testing
hatch run prepare[]Nonebecomes[]Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.