Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

ep: Fix teacher parser and other fixes (#49863)

Oleksiy Syvokon67d9e7d0119a
diff --git a/crates/edit_prediction_cli/evals/flask--add-and-rename-test-function.md b/crates/edit_prediction_cli/evals/flask--add-and-rename-test-function.md
index 2946013deb1..34878991763 100644
--- a/crates/edit_prediction_cli/evals/flask--add-and-rename-test-function.md
+++ b/crates/edit_prediction_cli/evals/flask--add-and-rename-test-function.md
@@ -78,3 +78,21 @@ def test_static_url_path():
+ assert rv.status_code == 404
+ rv.close()
```
+
+```diff
+--- a/tests/test_basic.py
++++ b/tests/test_basic.py
+@@ -1376,8 +1376,13 @@
+-def test_static_file_not_found():
+- pass
++def test_static_file_not_found(app, client):
++ rv = client.get("/static/nonexistent.html")
++ assert rv.status_code == 404
++ assert rv.data.strip() == b"<h1>Not Found</h1>"
++ with app.test_request_context():
++ pytest.raises(BuildError, flask.url_for, "static", filename="nonexistent.html")
++ rv.close()
+
+
+ def test_static_url_path():
+```
diff --git a/crates/edit_prediction_cli/evals/tree-sitter--tuple-to-struct-destructuring.md b/crates/edit_prediction_cli/evals/tree-sitter--tuple-to-struct-destructuring.md
index a55495795e4..c9583405764 100644
--- a/crates/edit_prediction_cli/evals/tree-sitter--tuple-to-struct-destructuring.md
+++ b/crates/edit_prediction_cli/evals/tree-sitter--tuple-to-struct-destructuring.md
@@ -138,7 +138,7 @@ revision = "24007727d42b4caceda3095ac685c463fae1ba1a"
fn language_for_id(&self, id: usize) -> LoaderResult<Language> {
- let (path, language, externals) = &self.languages_by_id[id];
-+ let LanguageEntry { path, language, external_files } = &self.languages_by_id[id];
++ let LanguageEntry { path, language, external_files } = &self.languages_by_id[id];
language
.get_or_try_init(|| {
let src_path = path.join("src");
diff --git a/crates/edit_prediction_cli/src/format_prompt.rs b/crates/edit_prediction_cli/src/format_prompt.rs
index fcb33def235..17d8aa68359 100644
--- a/crates/edit_prediction_cli/src/format_prompt.rs
+++ b/crates/edit_prediction_cli/src/format_prompt.rs
@@ -211,12 +211,17 @@ impl TeacherPrompt {
pub fn parse(example: &Example, response: &str) -> Result<(String, Option<ActualCursor>)> {
// Check if the model indicated no edits are needed
+ let no_edits = (String::new(), None);
if let Some(last_codeblock) = extract_last_codeblock(&response) {
if last_codeblock.trim() == Self::NO_EDITS {
- return Ok((String::new(), None));
+ return Ok(no_edits);
}
}
+ if response.trim().ends_with(Self::NO_EDITS) {
+ return Ok(no_edits);
+ }
+
// Extract updated (new) editable region from the model response.
let new_editable_region = Self::extract_editable_region(&response)?;
let cursor_offset = new_editable_region.find(Self::USER_CURSOR_MARKER);
diff --git a/crates/edit_prediction_cli/src/repair.rs b/crates/edit_prediction_cli/src/repair.rs
index a8b0002b839..b6ad41d553d 100644
--- a/crates/edit_prediction_cli/src/repair.rs
+++ b/crates/edit_prediction_cli/src/repair.rs
@@ -79,7 +79,7 @@ pub struct RepairArgs {
fn model_for_backend(backend: BatchProvider) -> &'static str {
match backend {
- BatchProvider::Anthropic => "claude-sonnet-4-5",
+ BatchProvider::Anthropic => "claude-sonnet-4-6",
BatchProvider::Openai => "gpt-5.2",
}
}