Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crates/infinity-agent-cli/src/daemon_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,8 @@ where
mpsc::unbounded_channel::<HashMap<ThreadRef, SessionInfo>>();
let (soft_detach_tx, soft_detach_rx) = mpsc::unbounded_channel::<()>();
let (detach_result_tx, detach_result_rx) = mpsc::unbounded_channel::<DetachResult>();
let (choice_answered_tx, choice_answered_rx) = mpsc::unbounded_channel::<(String, usize)>();
let (choice_answered_tx, choice_answered_rx) =
mpsc::unbounded_channel::<(infinity_protocol::ChoiceId, usize)>();

if let Some(info) = startup_info {
let _ = display_tx.send((None, DisplayEvent::Info(info)));
Expand Down
4 changes: 2 additions & 2 deletions crates/infinity-agent-cli/src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ pub enum DisplayEvent {
auth_url: String,
},
UserChoiceRequired {
id: String,
id: infinity_protocol::ChoiceId,
prompt: String,
choices: Vec<String>,
default: usize,
response_url: String,
},
UserChoiceComplete {
choice_id: String,
choice_id: infinity_protocol::ChoiceId,
},
ThinkingStart,
ThinkingEnd,
Expand Down
4 changes: 2 additions & 2 deletions crates/infinity-agent-cli/src/terminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ enum SoftDetachAction {

/// A queued user choice request waiting to be shown in the TUI.
struct PendingChoice {
id: String,
id: infinity_protocol::ChoiceId,
prompt: String,
choices: Vec<String>,
default: usize,
Expand Down Expand Up @@ -134,7 +134,7 @@ pub async fn run<T, E>(
>,
soft_detach_tx: mpsc::UnboundedSender<()>,
mut detach_result_rx: mpsc::UnboundedReceiver<DetachResult>,
choice_answered_tx: mpsc::UnboundedSender<(String, usize)>,
choice_answered_tx: mpsc::UnboundedSender<(infinity_protocol::ChoiceId, usize)>,
) -> Result<bool, BoxError>
where
T: TermOut,
Expand Down
2 changes: 1 addition & 1 deletion crates/infinity-agent-cli/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ pub struct TuiHarness {
pub load_session_rx: mpsc::UnboundedReceiver<(Option<infinity_protocol::ThreadRef>, bool)>,
pub model_switch_rx: mpsc::UnboundedReceiver<usize>,
pub soft_detach_rx: mpsc::UnboundedReceiver<()>,
pub choice_answered_rx: mpsc::UnboundedReceiver<(String, usize)>,
pub choice_answered_rx: mpsc::UnboundedReceiver<(infinity_protocol::ChoiceId, usize)>,
pub handle: tokio::task::JoinHandle<Result<bool, BoxError>>,
}

Expand Down
6 changes: 3 additions & 3 deletions crates/infinity-agent-cli/tests/tui_flow_snapshots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,14 +315,14 @@ async fn queued_choices_and_external_complete() {
let mut h = TuiHarness::spawn(80, 16).await;

h.display(Evt::UserChoiceRequired {
id: "choice-1".to_owned(),
id: "choice-1".into(),
prompt: "First question?".to_owned(),
choices: vec!["Yes".to_owned(), "No".to_owned()],
default: 0,
response_url: String::new(),
});
h.display(Evt::UserChoiceRequired {
id: "choice-2".to_owned(),
id: "choice-2".into(),
prompt: "Second question?".to_owned(),
choices: vec!["Red".to_owned(), "Green".to_owned(), "Blue".to_owned()],
default: 1,
Expand All @@ -341,7 +341,7 @@ async fn queued_choices_and_external_complete() {
insta::assert_snapshot!("second_choice_shown", h.screen());

h.display(Evt::UserChoiceComplete {
choice_id: "choice-2".to_owned(),
choice_id: "choice-2".into(),
});
h.settle().await;
insta::assert_snapshot!("choices_all_dismissed", h.screen());
Expand Down
2 changes: 1 addition & 1 deletion crates/infinity-agent-cli/tests/tui_viewport_snapshots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ async fn choice_picker_during_stream() {
chunk: "Working on it...".to_owned(),
});
h.display(Evt::UserChoiceRequired {
id: "choice-1".to_owned(),
id: "choice-1".into(),
prompt: "Allow the tool to run?".to_owned(),
choices: vec!["Allow".to_owned(), "Deny".to_owned()],
default: 0,
Expand Down
8 changes: 4 additions & 4 deletions crates/infinity-agent-core/examples/agent_scale.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ impl Tool<ChannelSender> for RunCommand {
async fn execute(
&self,
_args: serde_json::Value,
id: String,
call_id: Option<String>,
id: rap_protocol::ToolCallId,
call_id: Option<rap_protocol::ProviderCallId>,
context: &ToolContext<ChannelSender>,
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
let result =
InputMessage {
content: InputMessageContent::User(UserContent::ToolResult(ToolResult {
id,
call_id,
id: id.into_inner(),
call_id: call_id.map(|c| c.into_inner()),
content:
vec![ToolResultContent::Text(infinity_provider_protocol::message::Text {
text: "test result: ok. 148 passed; 0 failed; 3 ignored; finished in 21.38s"
Expand Down
Loading
Loading