Track dictation usage from accepted user inputs (#61215)

## What changed

Capture `codex_app_used_dictation` as per-input metadata, with patches taking precedence over replacements, and remove the key from metadata forwarded to Responses. Record attribution when user-origin input is accepted into turn history.

Add `used_dictation` to turn analytics: report `true` if any accepted input used dictation, `false` only when every accepted input has known non-dictation attribution, and omit the field otherwise.

## Testing

Add coverage for per-input extraction, patch precedence, and turn-level aggregation. Extend the app-server steering test to verify that dictation attribution reaches analytics while the metadata key is excluded from Responses requests.

GitOrigin-RevId: 0a55687a7dd61f00e9b188f89810e52bd941490b
This commit is contained in:
Chris Dong
2026-11-13 00:52:01 +00:00
committed by copyberry
parent 83a23c0936
commit 006911a313
10 changed files with 159 additions and 12 deletions
+2
View File
@@ -30,6 +30,8 @@ pub struct UserInputMetadata {
/// Optional host-assigned UUID for this particular Responses user item.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub response_item_uuid: Option<uuid::Uuid>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub used_dictation: Option<bool>,
#[serde(
default,
skip_serializing_if = "codex_history::UserInputOrigin::is_user"