mirror of
https://github.com/openai/codex.git
synced 2026-11-25 15:24:26 +00:00
Preserve response IDs for fast collaborator tool events (#42752)
## Why Collaborator tools can finish before their sampling response arrives, causing their analytics events to be emitted without response correlation. ## What changed Hold completed collaborator tool events until the reducer can attach their originating and subsequent response IDs. ## Testing Add coverage for both orderings of collaborator completion and sampling response arrival. GitOrigin-RevId: 5933424dd90702685cdb4a9693fed96c7885989a
This commit is contained in:
1 parent
a1294e57f1
commit
1cd78651e2
2 files changed
+96
-2
No files matched your search
@@ -1966,12 +1966,20 @@ impl AnalyticsReducer {
|
||||
.get(¬ification.turn_id)
|
||||
.and_then(|turn| turn.resolved_config.as_ref())
|
||||
.and_then(|config| config.turn_metadata.root_turn_id());
|
||||
// Fast collaborator tools can complete before their sampling response.
|
||||
// Keep the event until that response can supply its originating ID.
|
||||
let emission =
|
||||
if matches!(¬ification.item, ThreadItem::CollabAgentToolCall { .. }) {
|
||||
ToolEventEmission::AwaitResponse
|
||||
} else {
|
||||
ToolEventEmission::ImmediateUnlessCorrelated
|
||||
};
|
||||
self.record_tool_event(
|
||||
¬ification.thread_id,
|
||||
¬ification.turn_id,
|
||||
root_turn_id,
|
||||
event,
|
||||
ToolEventEmission::ImmediateUnlessCorrelated,
|
||||
emission,
|
||||
out,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user