Scope extension capabilities to invocation lifetimes (#41020)

## What changed

- Add callback lifetimes to extension `ToolCall`, `ToolEnvironment`, turn-input context, and skill-read request types.
- Require extension tool executors to handle calls for any invocation lifetime and tie their returned futures to that lifetime.
- Update built-in extensions, adapters, and tests to use the lifetime-scoped APIs without retaining host-owned environment capabilities.

GitOrigin-RevId: aca9ce3a1b6870df550bc84ec9308cc65533f161
This commit is contained in:
Adam Perry @ OpenAI authored and copyberry committed 2026-08-27 02:00:31 +00:00
1 parent eed1dee69e
commit 81e180044d
85 files changed
+477 -202

No files matched your search

@@ -350,7 +350,7 @@ fn exposed_tools(
registry: &ExtensionRegistry<Config>,
session_store: &ExtensionData,
thread_store: &ExtensionData,
) -> Vec<Arc<dyn ToolExecutor<ToolCall>>> {
) -> Vec<Arc<dyn for<'call> ToolExecutor<ToolCall<'call>>>> {
registry
.tool_contributors()
.iter()
@@ -358,7 +358,7 @@ fn exposed_tools(
.collect()
}
fn tool_call(tool_name: ToolName, arguments: serde_json::Value) -> ToolCall {
fn tool_call(tool_name: ToolName, arguments: serde_json::Value) -> ToolCall<'static> {
ToolCall {
turn_id: "turn-1".to_string(),
call_id: "call-read-file".to_string(),