mirror of
https://github.com/openai/codex.git
synced 2026-11-17 22:10:37 +00:00
Preserve client attribution when spawning subagents (#62072)
## Why Delegated work should retain client attribution such as `cost_center` from the turn that requested it, even when a yielded code-mode cell spawns its child after a newer parent turn starts. ## What changed Capture client metadata from the originating turn and apply it to the child's initial turn in both legacy and v2 agent spawning. Children and grandchildren retain the captured values when the parent is later steered with updated metadata. Exclude `misalignment_override`, `parent_response_id`, and `mcp_request_meta` from inheritance, while preserving each child's own thread and turn identifiers. ## Testing Add coverage for metadata filtering and snapshot isolation, legacy and v2 spawning with fresh or forked history, grandchild inheritance, and spawning from a yielded code-mode cell after the parent advances to another turn. GitOrigin-RevId: 8c378c49239ccfac03deb2b793fc69aba1d41644
This commit is contained in:
@@ -307,6 +307,9 @@ pub struct TurnStartOptions {
|
||||
/// Explicit cyber treatment for this turn. Omission preserves the backend's
|
||||
/// automatic behavior.
|
||||
pub cyber_access_program: Option<CyberAccessProgram>,
|
||||
/// Client attribution copied when spawning a child. Applied only to its initial
|
||||
/// turn; later parent updates do not change this snapshot.
|
||||
pub inherited_client_metadata: HashMap<String, String>,
|
||||
}
|
||||
|
||||
/// What Core did with input submitted through `start_or_steer_turn`.
|
||||
|
||||
Reference in New Issue
Block a user