Add step-scoped data to extension contributors (#34525)

## What changed

- Add an `ExtensionData` store to each `StepContext`.
- Pass the step store to context, world-state, turn-input, and tool contributors so extensions can use capabilities bound to the current sampling step.
- Preserve the captured step context when rebuilding initial context during compaction.

GitOrigin-RevId: 51f3105d3a793f60534f122f9be8247c131c2ca5
This commit is contained in:
jif authored and copyberry committed 2026-07-21 11:53:56 +00:00
1 parent 2d85e6d3a6
commit c44c4de7b4
28 files changed
+195 -74

No files matched your search

+2
View File
@@ -246,6 +246,7 @@ impl ToolRouter {
#[instrument(level = "trace", skip_all)]
pub(crate) fn extension_tool_executors(
session: &Session,
step_context: &StepContext,
) -> Vec<Arc<dyn ToolExecutor<ExtensionToolCall>>> {
session
.services
@@ -256,6 +257,7 @@ pub(crate) fn extension_tool_executors(
contributor.tools(
&session.services.session_extension_data,
&session.services.thread_extension_data,
&step_context.extension_data,
)
})
.collect()