Skip to content

Conversation

@csansoon
Copy link
Contributor

@csansoon csansoon commented Oct 27, 2025

Improve Simulation Environment

In this PR, the simulation (tool mocking) pipeline has been reworked and fully integrated into the core execution flow.

The previously independent runDocumentAtCommitWithAutoToolResponses service has been removed.
Instead, the simulation environment is now seamlessly integrated into the existing runDocumentAtCommit service.

A new simulationSettings attribute has been introduced to runDocumentAtCommit.
This attribute, which is undefined by default, configures the simulation behavior.
When simulateToolResponses is enabled, all tools are automatically routed through the simulation layer instead of their real implementations.
This simulation applies to the following tool categories:

  • Client Tools
  • Integration Tools
  • Select Latitude Tools (all except think and todo)

This integration ensures all logic is shared with the regular execution service, simplifying the overall architecture and eliminating redundant code.

Additionally, the toolSource data for generated tools now includes a new simulated attribute, indicating whether the tool response was produced within a simulation.
This allows the Tool Call UI to display a “Simulated” badge whenever a tool’s output originates from a simulated execution, regardless of its source.

image

With these changes, we can potentially:

  • Enable custom simulations directly from the Playground
  • Add custom prompts to control simulation results
  • Reuse the same logic for conversation simulations

@csansoon csansoon force-pushed the simulation-environment branch 5 times, most recently from c0fd1dc to 0f0f47f Compare October 28, 2025 09:09
})
} else if (streamManager.source === LogSources.Evaluation) {
definition.execute = instrumentToolHandler(mockClientToolResult, {
} else if (streamManager.source === LogSources.Playground) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused, why are we changing here from logSources evaluation to playground when adding now simulations?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a change, it's GitHub's diff.

I REMOVED the condition for LogSources.Evaluation. The fact that the tool gets simulated or not does not depend where it is being called from anymore. Instead, it depends on the "simulationSettings".

parameters,
source,
simulationSettings: {
simulateToolResponses: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be true by default no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This job previously called runDocumentAtCommitWithAutoToolResponses, which is the old way to run the prompt with simulations enabled.

Not sure what this job is being used for and what should it do, but this setting ensures it still behaves as before.

@csansoon csansoon force-pushed the simulation-environment branch 6 times, most recently from 2a9003a to f47fe57 Compare October 28, 2025 16:21
'An optional list of all the required dependencies to run the script. Adding dependencies will severely increase the execution time, so do not include them unless required.',
),
}),
outputSchema: z.string(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no description?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah this is for the internal use of the simulation only

@csansoon csansoon force-pushed the simulation-environment branch from f47fe57 to cc16e67 Compare October 28, 2025 17:13
@@ -0,0 +1,206 @@
---
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F

@latitude-dev latitude-dev deleted a comment from neoxelox Oct 28, 2025
neoxelox
neoxelox previously approved these changes Oct 28, 2025
@csansoon csansoon force-pushed the simulation-environment branch from cc16e67 to 9cc4fb8 Compare October 28, 2025 17:52
@csansoon csansoon merged commit 1c09a9e into main Oct 29, 2025
7 checks passed
@csansoon csansoon deleted the simulation-environment branch October 29, 2025 08:51
@github-actions github-actions bot locked and limited conversation to collaborators Oct 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants