mirror of
https://github.com/openai/codex.git
synced 2026-10-30 19:18:49 +00:00
Reduce typed app-server request serialization overhead (#34766)
## What changed - Use `ClientRequest::method_name()` directly when preparing typed request diagnostics for in-process and remote clients. - Allocate the owned method name only when constructing an error. - Remove the serialization-based method lookup and the redundant allocating `ClientRequest::method()` helper. GitOrigin-RevId: 93859e512a4f20204e0db4f929a2baebe4374ec5
This commit is contained in:
@@ -239,10 +239,6 @@ macro_rules! client_request_definitions {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn method(&self) -> String {
|
||||
self.method_name().to_string()
|
||||
}
|
||||
|
||||
pub fn serialization_scope(&self) -> Option<ClientRequestSerializationScope> {
|
||||
match self {
|
||||
$(
|
||||
@@ -2671,7 +2667,6 @@ mod tests {
|
||||
params: None,
|
||||
};
|
||||
assert_eq!(request.id(), &RequestId::Integer(1));
|
||||
assert_eq!(request.method(), "account/rateLimits/read");
|
||||
assert_eq!(
|
||||
json!({
|
||||
"method": "account/rateLimits/read",
|
||||
@@ -2689,7 +2684,6 @@ mod tests {
|
||||
params: None,
|
||||
};
|
||||
assert_eq!(request.id(), &RequestId::Integer(1));
|
||||
assert_eq!(request.method(), "account/usage/read");
|
||||
assert_eq!(
|
||||
json!({
|
||||
"method": "account/usage/read",
|
||||
@@ -2707,7 +2701,6 @@ mod tests {
|
||||
params: None,
|
||||
};
|
||||
assert_eq!(request.id(), &RequestId::Integer(1));
|
||||
assert_eq!(request.method(), "account/workspaceMessages/read");
|
||||
assert_eq!(
|
||||
json!({
|
||||
"method": "account/workspaceMessages/read",
|
||||
|
||||
Reference in New Issue
Block a user