Fix CC todo tool parsing (#35721)
It looks like the TODO tool call no longer requires a priority. Release Notes: - N/A
This commit is contained in:
parent
22fa41e9c0
commit
69dc870828
2 changed files with 73 additions and 24 deletions
|
@ -764,6 +764,8 @@ enum PermissionMode {
|
|||
#[cfg(test)]
|
||||
pub(crate) mod tests {
|
||||
use super::*;
|
||||
use crate::e2e_tests;
|
||||
use gpui::TestAppContext;
|
||||
use serde_json::json;
|
||||
|
||||
crate::common_e2e_tests!(ClaudeCode, allow_option_id = "allow");
|
||||
|
@ -776,6 +778,68 @@ pub(crate) mod tests {
|
|||
}
|
||||
}
|
||||
|
||||
#[gpui::test]
|
||||
#[cfg_attr(not(feature = "e2e"), ignore)]
|
||||
async fn test_todo_plan(cx: &mut TestAppContext) {
|
||||
let fs = e2e_tests::init_test(cx).await;
|
||||
let project = Project::test(fs, [], cx).await;
|
||||
let thread =
|
||||
e2e_tests::new_test_thread(ClaudeCode, project.clone(), "/private/tmp", cx).await;
|
||||
|
||||
thread
|
||||
.update(cx, |thread, cx| {
|
||||
thread.send_raw(
|
||||
"Create a todo plan for initializing a new React app. I'll follow it myself, do not execute on it.",
|
||||
cx,
|
||||
)
|
||||
})
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let mut entries_len = 0;
|
||||
|
||||
thread.read_with(cx, |thread, _| {
|
||||
entries_len = thread.plan().entries.len();
|
||||
assert!(thread.plan().entries.len() > 0, "Empty plan");
|
||||
});
|
||||
|
||||
thread
|
||||
.update(cx, |thread, cx| {
|
||||
thread.send_raw(
|
||||
"Mark the first entry status as in progress without acting on it.",
|
||||
cx,
|
||||
)
|
||||
})
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
thread.read_with(cx, |thread, _| {
|
||||
assert!(matches!(
|
||||
thread.plan().entries[0].status,
|
||||
acp::PlanEntryStatus::InProgress
|
||||
));
|
||||
assert_eq!(thread.plan().entries.len(), entries_len);
|
||||
});
|
||||
|
||||
thread
|
||||
.update(cx, |thread, cx| {
|
||||
thread.send_raw(
|
||||
"Now mark the first entry as completed without acting on it.",
|
||||
cx,
|
||||
)
|
||||
})
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
thread.read_with(cx, |thread, _| {
|
||||
assert!(matches!(
|
||||
thread.plan().entries[0].status,
|
||||
acp::PlanEntryStatus::Completed
|
||||
));
|
||||
assert_eq!(thread.plan().entries.len(), entries_len);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_deserialize_content_untagged_text() {
|
||||
let json = json!("Hello, world!");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue