Allow larger gRPC code mode tool descriptions (#38606)

## What changed

Stop rejecting gRPC execute requests when an enabled tool's description exceeds
16 KiB. Identifier, tool-count, and subscription-filter limits remain in place.

GitOrigin-RevId: c30dbf555e691b02bd6d6a835a0c40f671b0d172
This commit is contained in:
Adam Perry @ OpenAI
2026-08-14 16:42:32 +00:00
committed by copyberry
parent 3b3a91ccf0
commit a3cb1c14fb
3 changed files with 1 additions and 14 deletions
@@ -54,11 +54,6 @@ pub(super) fn execute_request(request: proto::ExecuteRequest) -> Result<ExecuteR
fn 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"))?;
@@ -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());
}
@@ -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() {