first pass of merging in warp (doesn't build)
This commit is contained in:
@@ -3,21 +3,20 @@
|
||||
// `assert!` causes the app to crash before debug info can be exported. Use `integration_assert!` instead.
|
||||
#![deny(clippy::assertions_on_constants)]
|
||||
|
||||
use super::llm_judge::{LLMJudge, LLMJudgeConfig};
|
||||
use crate::{
|
||||
ai::agent::{
|
||||
conversation::{AIConversation, AIConversationId, ConversationStatus},
|
||||
todos::AIAgentTodoList,
|
||||
AIAgentActionResultType, AIAgentActionType, AIAgentExchange, AIAgentInput,
|
||||
AIAgentOutputMessageType, AIAgentOutputStatus, AIAgentTextSection, FileEdit,
|
||||
FinishedAIAgentOutput, ReadFilesRequest, TodoOperation,
|
||||
},
|
||||
integration_testing::view_getters::terminal_view,
|
||||
BlocklistAIHistoryModel,
|
||||
};
|
||||
use galaxyui::{integration::AssertionCallback, integration_assert, EntityId};
|
||||
use galaxyui::{integration::AssertionOutcome, SingletonEntity};
|
||||
use warp_multi_agent_api as api;
|
||||
use galaxyui::integration::{AssertionCallback, AssertionOutcome};
|
||||
use galaxyui::{integration_assert, EntityId, SingletonEntity};
|
||||
|
||||
use super::llm_judge::{LLMJudge, LLMJudgeConfig};
|
||||
use crate::ai::agent::conversation::{AIConversation, AIConversationId, ConversationStatus};
|
||||
use crate::ai::agent::todos::AIAgentTodoList;
|
||||
use crate::ai::agent::{
|
||||
AIAgentActionResultType, AIAgentActionType, AIAgentExchange, AIAgentInput,
|
||||
AIAgentOutputMessageType, AIAgentOutputStatus, AIAgentTextSection, FileEdit,
|
||||
FinishedAIAgentOutput, ReadFilesRequest, TodoOperation,
|
||||
};
|
||||
use crate::integration_testing::view_getters::terminal_view;
|
||||
use crate::BlocklistAIHistoryModel;
|
||||
|
||||
type TextAssertion = Box<dyn Fn(&str) -> bool + 'static>;
|
||||
type ActionAssertion = Box<dyn Fn(&AIAgentActionType) -> bool + 'static>;
|
||||
@@ -523,7 +522,7 @@ pub fn assert_no_suggested_prompt() -> AssertionCallback {
|
||||
let terminal_view = terminal_view(app, window_id, 0, 0);
|
||||
BlocklistAIHistoryModel::handle(app).update(app, |history_model, _| {
|
||||
let mut exchanges =
|
||||
history_model.all_live_root_task_exchanges_for_terminal_view(terminal_view.id());
|
||||
history_model.all_live_root_task_exchanges_for_terminal_surface(terminal_view.id());
|
||||
|
||||
if exchanges.any(|exchange| {
|
||||
let AIAgentOutputStatus::Finished { finished_output } = &exchange.output_status
|
||||
@@ -648,7 +647,7 @@ fn get_conversation(
|
||||
ConversationTarget::Only => {
|
||||
// Get all conversations (including passive ones)
|
||||
let mut conversations: Vec<_> = history_model
|
||||
.all_live_conversations_for_terminal_view(terminal_view_id)
|
||||
.all_live_conversations_for_terminal_surface(terminal_view_id)
|
||||
.collect();
|
||||
match conversations.len() {
|
||||
1 => conversations.pop().ok_or(AssertionOutcome::failure(
|
||||
@@ -1103,7 +1102,7 @@ pub fn assert_no_exchanges() -> AssertionCallback {
|
||||
let terminal_view = terminal_view(app, window_id, 0, 0);
|
||||
BlocklistAIHistoryModel::handle(app).update(app, |history_model, _| {
|
||||
let exchange_count = history_model
|
||||
.all_live_root_task_exchanges_for_terminal_view(terminal_view.id())
|
||||
.all_live_root_task_exchanges_for_terminal_surface(terminal_view.id())
|
||||
.count();
|
||||
|
||||
if exchange_count == 0 {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
use crate::integration_testing::agent_mode::util::get_base_server_url;
|
||||
use anyhow::Result;
|
||||
use reqwest::blocking::Client;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::integration_testing::agent_mode::util::get_base_server_url;
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub struct LLMGenerateRequest {
|
||||
pub prompt: String,
|
||||
|
||||
@@ -4,9 +4,8 @@ use anyhow::Result;
|
||||
use llm_generate::LLMGenerateRequest;
|
||||
use reqwest::blocking::Client;
|
||||
use serde::Deserialize;
|
||||
use warp_multi_agent_api::{
|
||||
apply_file_diffs_result::success::UpdatedFileContent, message, Message,
|
||||
};
|
||||
use warp_multi_agent_api::apply_file_diffs_result::success::UpdatedFileContent;
|
||||
use warp_multi_agent_api::{message, Message};
|
||||
|
||||
use crate::ai::agent::conversation::AIConversation;
|
||||
|
||||
@@ -87,6 +86,8 @@ pub fn filter_tool_call_result(result: &message::ToolCallResult) -> message::Too
|
||||
command_id: "command_id".to_string(),
|
||||
output: "[OUTPUT OMITTED]".to_string(),
|
||||
exit_code: cmd_result.exit_code,
|
||||
start_ts: None,
|
||||
finish_ts: None,
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
@@ -7,10 +7,6 @@ use std::collections::HashSet;
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
|
||||
use crate::ai::agent::{AIAgentOutputStatus, FinishedAIAgentOutput};
|
||||
pub use crate::ai::blocklist::agent_view::AgentViewState;
|
||||
use crate::BlocklistAIHistoryModel;
|
||||
use crate::{ai::agent::AIAgentActionType, integration_testing::view_getters::terminal_view};
|
||||
pub use assertions::*;
|
||||
use galaxyui::integration::PersistedDataMap;
|
||||
pub use galaxyui::integration::RUNTIME_TAG_FAILURE_REASON;
|
||||
@@ -19,6 +15,11 @@ pub use step::*;
|
||||
pub use user_defaults::*;
|
||||
pub use util::*;
|
||||
|
||||
use crate::ai::agent::{AIAgentActionType, AIAgentOutputStatus, FinishedAIAgentOutput};
|
||||
pub use crate::ai::blocklist::agent_view::AgentViewState;
|
||||
use crate::integration_testing::view_getters::terminal_view;
|
||||
use crate::BlocklistAIHistoryModel;
|
||||
|
||||
pub const TOTAL_REQUEST_COST_PREFIX: &str = "Total request cost: ";
|
||||
pub const TOTAL_EXCHANGES_PREFIX: &str = "Total number of exchanges: ";
|
||||
pub const TOTAL_TOKEN_USAGE_PREFIX: &str = "Total token usage: ";
|
||||
@@ -94,8 +95,7 @@ pub fn output_code_diff_debug_info(app: &mut App, window_id: WindowId) {
|
||||
|
||||
let mut output_file = open_debug_file_from_env(CODE_DIFF_OUTPUT_FILE_ENV_VAR);
|
||||
if let Some(output_file) = &mut output_file {
|
||||
use command::blocking::Command;
|
||||
use std::io::Write;
|
||||
|
||||
if edited_files.is_empty() {
|
||||
writeln!(output_file, "No files were edited for this test")
|
||||
.expect("Failed to write to code diff file");
|
||||
@@ -159,7 +159,6 @@ pub fn output_conversation_debug_info(
|
||||
// Create a function to handle output
|
||||
let mut write_to_debug_file = |text: &str| {
|
||||
if let Some(file) = &mut output_file {
|
||||
use std::io::Write;
|
||||
writeln!(file, "{text}").expect("Failed to write to debug output file");
|
||||
} else {
|
||||
println!("{text}");
|
||||
|
||||
@@ -1,18 +1,24 @@
|
||||
use std::{fs::read, io::Cursor, path::Path, time::Duration};
|
||||
use std::fs::read;
|
||||
use std::io::Cursor;
|
||||
use std::path::Path;
|
||||
use std::time::Duration;
|
||||
|
||||
use galaxyui::{async_assert, integration::TestStep, SingletonEntity};
|
||||
use prost::Message;
|
||||
use galaxyui::integration::TestStep;
|
||||
use galaxyui::{async_assert, SingletonEntity};
|
||||
|
||||
use crate::ai::execution_profiles::profiles::AIExecutionProfilesModel;
|
||||
use crate::ai::execution_profiles::ActionPermission;
|
||||
use crate::ai::llms::{LLMId, LLMPreferences};
|
||||
use crate::integration_testing::agent_mode::ConversationTarget;
|
||||
use crate::integration_testing::{
|
||||
agent_mode::{assert_latest_task_succeeds_or_blocked, assert_task_is_blocked},
|
||||
step::{new_step_with_default_assertions, new_step_with_default_assertions_for_pane},
|
||||
terminal::assert_input_is_focused,
|
||||
view_getters::terminal_view,
|
||||
use crate::integration_testing::agent_mode::{
|
||||
assert_latest_task_succeeds_or_blocked, assert_task_is_blocked, ConversationTarget,
|
||||
};
|
||||
use crate::integration_testing::step::{
|
||||
new_step_with_default_assertions, new_step_with_default_assertions_for_pane,
|
||||
};
|
||||
use crate::integration_testing::terminal::assert_input_is_focused;
|
||||
use crate::integration_testing::view_getters::terminal_view;
|
||||
|
||||
pub const AGENT_MODE_RUNNING_STEP_GROUP_NAME: &str = "Agent mode running";
|
||||
|
||||
@@ -162,8 +168,9 @@ pub fn submit_ai_query(query: &str, timeout: Duration) -> TestStep {
|
||||
fn print_conversation_id_assertion(
|
||||
) -> impl FnMut(&mut galaxyui::App, galaxyui::WindowId) -> galaxyui::integration::AssertionOutcome {
|
||||
|app, window_id| {
|
||||
use crate::BlocklistAIHistoryModel;
|
||||
use galaxyui::integration::AssertionOutcome;
|
||||
|
||||
use crate::BlocklistAIHistoryModel;
|
||||
let terminal_view = terminal_view(app, window_id, 0, 0);
|
||||
BlocklistAIHistoryModel::handle(app).read(app, |history_model, _| {
|
||||
if let Some(conversation) = history_model.active_conversation(terminal_view.id()) {
|
||||
|
||||
Reference in New Issue
Block a user