move rate limits updated notification to v2

This commit is contained in:
Owen Lin
2025-11-01 11:22:44 -07:00
parent 62be8a3cde
commit 59e3e7431e
2 changed files with 11 additions and 2 deletions

View File

@@ -9,7 +9,6 @@ use crate::protocol::v2;
use codex_protocol::ConversationId;
use codex_protocol::parse_command::ParsedCommand;
use codex_protocol::protocol::FileChange;
use codex_protocol::protocol::RateLimitSnapshot;
use codex_protocol::protocol::ReviewDecision;
use codex_protocol::protocol::SandboxCommandAssessment;
use paste::paste;
@@ -439,7 +438,7 @@ pub enum ServerNotification {
#[serde(rename = "account/rateLimits/updated")]
#[ts(rename = "account/rateLimits/updated")]
#[strum(serialize = "account/rateLimits/updated")]
AccountRateLimitsUpdated(RateLimitSnapshot),
AccountRateLimitsUpdated(v2::AccountRateLimitsUpdatedNotification),
/// DEPRECATED NOTIFICATIONS below
/// Authentication status changed

View File

@@ -429,3 +429,13 @@ pub struct TodoItem {
pub text: String,
pub completed: bool,
}
// === Server Notifications ===
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub struct AccountRateLimitsUpdatedNotification {
// TODO: create our own RateLimitSnapshot type that doesn't depend on codex_protocol
// so we can camelcase that bad boy.
pub rate_limits: RateLimitSnapshot,
}