mirror of
https://github.com/openai/codex.git
synced 2026-10-22 17:58:46 +00:00
Record attempted tool calls in response metadata (#36181)
## What changed - Add the opt-in `executed_tool_call_metadata` feature to record model-attempted direct and code-mode tool calls. - Attach recorded names and arguments to the matching tool output in the next Responses request, preserving the metadata across sampling retries. - Bound pending calls and argument sizes, and emit truncation metadata when limits are exceeded. ## Testing - Cover disabled-by-default behavior, namespaced and nested calls, blocked or failed attempts, retry handling, and recorder limits. GitOrigin-RevId: 5ce917b73e797b0f6904d46477b9d2cf8ea71bf2
This commit is contained in:
@@ -97,6 +97,20 @@ impl ToolCallRuntime {
|
||||
source: ToolCallSource,
|
||||
cancellation_token: CancellationToken,
|
||||
) -> impl std::future::Future<Output = Result<AnyToolResult, FunctionCallError>> {
|
||||
if self
|
||||
.step_context
|
||||
.turn
|
||||
.config
|
||||
.features
|
||||
.enabled(codex_features::Feature::ExecutedToolCallMetadata)
|
||||
&& let Some(executed_tool_calls) = self.session.services.executed_tool_calls.as_ref()
|
||||
{
|
||||
executed_tool_calls.record_tool_call(
|
||||
&call,
|
||||
&source,
|
||||
super::effective_tool_mode(&self.step_context.turn),
|
||||
);
|
||||
}
|
||||
let supports_parallel = self.router.tool_supports_parallel(&call);
|
||||
let tool_runtime = self.router.tool_runtime(&call);
|
||||
let router = Arc::clone(&self.router);
|
||||
|
||||
Reference in New Issue
Block a user