mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
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:
1 parent
eed1dee69e
commit
81e180044d
85 files changed
+477
-202
No files matched your search
@@ -20,7 +20,10 @@ impl ToolExecutor<ToolInvocation> for TestHandler {
|
||||
test_spec(&self.tool_name)
|
||||
}
|
||||
|
||||
fn handle(&self, _invocation: ToolInvocation) -> codex_tools::ToolExecutorFuture<'_> {
|
||||
fn handle<'a>(&'a self, _invocation: ToolInvocation) -> codex_tools::ToolExecutorFuture<'a>
|
||||
where
|
||||
ToolInvocation: 'a,
|
||||
{
|
||||
Box::pin(async {
|
||||
Ok(
|
||||
Box::new(crate::tools::context::FunctionToolOutput::from_text(
|
||||
@@ -48,7 +51,10 @@ impl ToolExecutor<ToolInvocation> for ReadinessTestHandler {
|
||||
self.handler.spec()
|
||||
}
|
||||
|
||||
fn handle(&self, invocation: ToolInvocation) -> codex_tools::ToolExecutorFuture<'_> {
|
||||
fn handle<'a>(&'a self, invocation: ToolInvocation) -> codex_tools::ToolExecutorFuture<'a>
|
||||
where
|
||||
ToolInvocation: 'a,
|
||||
{
|
||||
self.handler.handle(invocation)
|
||||
}
|
||||
}
|
||||
@@ -81,7 +87,10 @@ impl ToolExecutor<ToolInvocation> for LifecycleTestHandler {
|
||||
test_spec(&self.tool_name)
|
||||
}
|
||||
|
||||
fn handle(&self, invocation: ToolInvocation) -> codex_tools::ToolExecutorFuture<'_> {
|
||||
fn handle<'a>(&'a self, invocation: ToolInvocation) -> codex_tools::ToolExecutorFuture<'a>
|
||||
where
|
||||
ToolInvocation: 'a,
|
||||
{
|
||||
assert_eq!(
|
||||
invocation.tool_name,
|
||||
self.tool_name.clone().with_default_namespace()
|
||||
|
||||
Reference in new issue
Block a user