zeta: Reduce request payload (#35968)

1. Don't send diagnostics if there are more than 10 of them. This fixes
an issue with sending 100kb requests for projects with many warnings.

2. Don't send speculated_output and outline, as those are currently
unused.


Release Notes:

- Improved edit prediction latency
This commit is contained in:
Oleksiy Syvokon 2025-08-11 15:33:16 +03:00 committed by GitHub
parent a88c533ffc
commit d5ed569fad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 44 deletions

View file

@ -9,7 +9,6 @@ use std::{fmt::Write, ops::Range};
pub struct InputExcerpt {
pub editable_range: Range<Point>,
pub prompt: String,
pub speculated_output: String,
}
pub fn excerpt_for_cursor_position(
@ -46,7 +45,6 @@ pub fn excerpt_for_cursor_position(
let context_range = expand_range(snapshot, editable_range.clone(), context_token_limit);
let mut prompt = String::new();
let mut speculated_output = String::new();
writeln!(&mut prompt, "```{path}").unwrap();
if context_range.start == Point::zero() {
@ -58,12 +56,6 @@ pub fn excerpt_for_cursor_position(
}
push_editable_range(position, snapshot, editable_range.clone(), &mut prompt);
push_editable_range(
position,
snapshot,
editable_range.clone(),
&mut speculated_output,
);
for chunk in snapshot.chunks(editable_range.end..context_range.end, false) {
prompt.push_str(chunk.text);
@ -73,7 +65,6 @@ pub fn excerpt_for_cursor_position(
InputExcerpt {
editable_range,
prompt,
speculated_output,
}
}