Lightweight coding agent that runs in your terminal
Rust
Allow larger gRPC code mode tool descriptions (#38606)
Adam Perry @ OpenAIa3cb1c14fbef
diff --git a/codex-rs/code-mode-host/src/grpc/conversions.rs b/codex-rs/code-mode-host/src/grpc/conversions.rsindex 7c6f6134bd..2f4f8b5f0c 100644--- a/codex-rs/code-mode-host/src/grpc/conversions.rs+++ b/codex-rs/code-mode-host/src/grpc/conversions.rs@@ -54,11 +54,6 @@ pub(super) fn execute_request(request: proto::ExecuteRequest) -> Result<ExecuteRfn tool_definition(definition: proto::ToolDefinition) -> Result<ToolDefinition, Status> {validation::identifier(&definition.name, "tool definition name")?;- validation::bounded(- &definition.description,- validation::MAX_TOOL_DESCRIPTION_BYTES,- "tool description",- )?;let name = definition.tool_name.ok_or_else(|| Status::invalid_argument("tool definition is missing its tool name"))?;diff --git a/codex-rs/code-mode-host/src/grpc/robustness_tests.rs b/codex-rs/code-mode-host/src/grpc/robustness_tests.rsindex eb9b21b086..31c5eb1095 100644--- a/codex-rs/code-mode-host/src/grpc/robustness_tests.rs+++ b/codex-rs/code-mode-host/src/grpc/robustness_tests.rs@@ -25,7 +25,6 @@ use super::tests::execute_request;use super::tests::open_session;use super::tests::tool;use super::validation::MAX_IDENTIFIER_BYTES;-use super::validation::MAX_TOOL_DESCRIPTION_BYTES;use super::validation::MAX_TOOL_FILTERS;use crate::MAX_ACTIVE_CELLS;use crate::MAX_IN_FLIGHT_REQUESTS;@@ -49,7 +48,7 @@ fn invocation(cell_id: &str, name: &str) -> CodeModeNestedToolCall {}#[tokio::test]-async fn rejects_oversized_identifiers_tool_metadata_and_subscription_filters() {+async fn rejects_oversized_identifiers_and_subscription_filters() {let host = GrpcCodeModeHost::new();let (session_id, _events) = open_session(&host).await;let oversized_id = "x".repeat(MAX_IDENTIFIER_BYTES + 1);@@ -117,12 +116,6 @@ async fn rejects_oversized_identifiers_tool_metadata_and_subscription_filters().await,);- let mut request = execute_request(&session_id, "metadata", "text(\"hello\");");- request.enabled_tools = vec![proto::ToolDefinition {- description: "x".repeat(MAX_TOOL_DESCRIPTION_BYTES + 1),- ..tool("echo")- }];- assert_invalid(host.execute(Request::new(request)).await);assert!(host.state.session(&session_id).is_ok());}diff --git a/codex-rs/code-mode-host/src/grpc/validation.rs b/codex-rs/code-mode-host/src/grpc/validation.rsindex dc3fd4a879..7326665897 100644--- a/codex-rs/code-mode-host/src/grpc/validation.rs+++ b/codex-rs/code-mode-host/src/grpc/validation.rs@@ -6,7 +6,6 @@ pub(super) use codex_code_mode_protocol::grpc::MAX_IDENTIFIER_BYTES;pub(super) use codex_code_mode_protocol::grpc::MAX_TOOL_ERROR_BYTES;pub(super) const MAX_TOOL_FILTERS: usize = 64;pub(super) const MAX_TOOL_DEFINITIONS: usize = 1_024;-pub(super) const MAX_TOOL_DESCRIPTION_BYTES: usize = 16 * 1_024;pub(super) fn identifier(value: &str, field: &str) -> Result<(), Status> {if value.is_empty() {