Files
codex/codex-rs/protocol/src/lib.rs
Dylan Hurd 2c4a95736b Expose response usage metadata in completion events (#41087)
## What changed

- Parse optional `usage_metadata.amount` values from Responses API completion events without converting their string representation.
- Propagate the metadata through SSE and WebSocket streams, regular turns, and remote compaction.
- Add `usageMetadata` to the app-server `rawResponse/completed` notification and its generated schemas.

## Testing

- Cover missing, null, zero, and high-precision amounts, including completion events emitted during compaction.

GitOrigin-RevId: b16d81e8350eab0dc7ff613d0dc9dbed73041713
2026-08-27 07:50:05 +00:00

53 lines
1.3 KiB
Rust

pub mod account;
mod agent_path;
pub mod auth;
mod response_item_id;
mod response_usage;
mod sanitized_git_url;
mod session_id;
mod thread_id;
mod tool_name;
pub use agent_path::AgentPath;
pub use permission_profile_intersection::PermissionIntersectionError;
pub use permission_profile_intersection::intersect_effective_permission_profiles;
pub use response_item_id::ResponseItemId;
pub use response_usage::ResponseUsageMetadata;
pub use sanitized_git_url::SanitizedGitUrl;
pub use session_id::SessionId;
pub use thread_id::RolloutId;
pub use thread_id::ThreadId;
pub use tool_name::DEFAULT_FUNCTION_NAMESPACE;
pub use tool_name::ToolName;
pub mod approvals;
pub mod capabilities;
pub mod config_types;
pub mod dynamic_tools;
mod environment;
pub mod error;
pub mod exec_output;
pub mod items;
mod legacy_events;
pub mod local_media;
pub mod mcp;
pub mod mcp_approval_meta;
pub mod mcp_policy;
pub mod memory_citation;
pub mod models;
pub mod network_policy;
pub mod num_format;
pub mod openai_models;
pub mod parse_command;
mod permission_profile_intersection;
mod permission_profile_snapshot;
pub mod permissions;
pub mod plan_tool;
pub mod protocol;
pub mod realtime;
pub mod request_permissions;
pub mod request_user_input;
pub mod review_format;
pub mod security_risk;
pub mod shell_environment;
pub mod turn_input;
pub mod user_input;