Deliver gRPC code-mode notifications without truncation (#38645)

## What changed

- Forward notification text to the session delegate without applying the previous 1,024-byte limit or appending a truncation suffix.
- Update the gRPC host integration test to verify that oversized multibyte notification text is delivered unchanged.

GitOrigin-RevId: 9a9e24b359a07540f70ec4e98b28524db3f7a4a0
This commit is contained in:
Adam Perry @ OpenAI
2026-08-14 20:19:16 +00:00
committed by copyberry
parent efa97f9bc6
commit fe556c4b6c
2 changed files with 4 additions and 18 deletions

View File

@@ -16,9 +16,6 @@ use super::conversion;
use super::deadline;
use super::state::CallbackAdmission;
const MAX_NOTIFICATION_BYTES: usize = 1_024;
const TRUNCATED_NOTIFICATION_SUFFIX: &str = "... [truncated]";
impl SessionInner {
pub(super) fn spawn_session_events(
self: &Arc<Self>,
@@ -197,15 +194,8 @@ impl SessionInner {
fn handle_notification(
self: &Arc<Self>,
mut notification: grpc::Notification,
notification: grpc::Notification,
) -> Result<(), String> {
if notification.text.len() > MAX_NOTIFICATION_BYTES {
let boundary = notification
.text
.floor_char_boundary(MAX_NOTIFICATION_BYTES - TRUNCATED_NOTIFICATION_SUFFIX.len());
notification.text.truncate(boundary);
notification.text.push_str(TRUNCATED_NOTIFICATION_SUFFIX);
}
let admission = self
.state
.lock()