mirror of
https://github.com/openai/codex.git
synced 2026-11-26 23:40:43 +00:00
Add request IDs and attempt numbers to model request hooks (#61587)
## Why Model request hooks need to correlate attempts belonging to the same generation across retries and model fallback. ## What changed Add `request_id` and one-based `attempt_number` fields to `PreModelRequest` and `PostModelRequest` inputs and their generated schema. Keep the request ID stable across retries and increment the attempt number for each call to open a response stream. ## Testing Extend hook tests to verify matching request IDs and increasing attempt numbers across retries. Extend the background compaction scenario to verify that its pre/post hooks share an ID distinct from the ordinary sampling request. GitOrigin-RevId: 2d85ad6fd630505a89a712cebab6ca0f731610c9
This commit is contained in:
@@ -122,6 +122,10 @@ pub struct ModelRequestHookInput {
|
||||
#[serde(skip)]
|
||||
pub lifecycle_id: uuid::Uuid,
|
||||
pub kind: SamplingKind,
|
||||
/// Identifies a generation across harness retries and model fallback.
|
||||
pub request_id: String,
|
||||
/// One-based attempt number within this generation.
|
||||
pub attempt_number: u32,
|
||||
pub session_id: String,
|
||||
/// Identifies the issuing thread within its shared session.
|
||||
pub thread_id: String,
|
||||
|
||||
Reference in New Issue
Block a user