Skip to content

Commit 6306019

Browse files
committed
addresses comments
1 parent 738dd24 commit 6306019

File tree

11 files changed

+557
-607
lines changed

11 files changed

+557
-607
lines changed

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ xcuserdata/
88
.DS_Store
99
node_modules/
1010
.eslintcache
11-
12-
# Conversation/data files
13-
/delegate
14-
/delegatetool
1511
yarn-error.log
1612
yarn.lock
1713
package-lock.json

crates/chat-cli/src/cli/chat/cli/delegate.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@ use std::collections::HashMap;
22
use std::io::Write;
33
use std::path::PathBuf;
44

5+
use crossterm::queue;
56
use eyre::Result;
67
use serde::{
78
Deserialize,
89
Serialize,
910
};
1011

1112
use crate::cli::DEFAULT_AGENT_NAME;
12-
use crate::cli::chat::tools::delegate::agent::subagents_dir;
1313
use crate::cli::chat::tools::delegate::{
1414
AgentExecution,
1515
AgentStatus,
1616
launch_agent,
17+
subagents_dir,
1718
};
1819
use crate::cli::chat::{
1920
ChatError,
@@ -141,10 +142,10 @@ impl DelegateArgs {
141142

142143
match result {
143144
Ok(output) => {
144-
crossterm::queue!(session.stderr, crossterm::style::Print(format!("{}\n", output)))?;
145+
queue!(session.stderr, crossterm::style::Print(format!("{}\n", output)))?;
145146
},
146147
Err(e) => {
147-
crossterm::queue!(session.stderr, crossterm::style::Print(format!("Error: {}\n", e)))?;
148+
queue!(session.stderr, crossterm::style::Print(format!("Error: {}\n", e)))?;
148149
},
149150
}
150151

crates/chat-cli/src/cli/chat/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ use tool_manager::{
106106
ToolManager,
107107
ToolManagerBuilder,
108108
};
109-
use tools::delegate::execution::status_all_agents;
109+
use tools::delegate::status_all_agents;
110110
use tools::gh_issue::GhIssueContext;
111111
use tools::{
112112
NATIVE_TOOLS,

crates/chat-cli/src/cli/chat/prompt.rs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ use super::tool_manager::{
4646
PromptQuery,
4747
PromptQueryResult,
4848
};
49-
use crate::cli::experiment::experiment_manager::ExperimentManager;
49+
use crate::cli::experiment::experiment_manager::{
50+
ExperimentManager,
51+
ExperimentName,
52+
};
5053
use crate::database::settings::Setting;
5154
use crate::os::Os;
5255
use crate::util::directories::chat_cli_bash_history_path;
@@ -503,15 +506,16 @@ pub fn rl(
503506
}
504507

505508
// Add custom keybinding for Ctrl+D to open delegate command (configurable)
506-
let delegate_key_char = match os.database.settings.get_string(Setting::DelegateModeKey) {
507-
Some(key) if key.len() == 1 => key.chars().next().unwrap_or('d'),
508-
_ => 'd', // Default to 'd' if setting is missing or invalid
509-
};
510-
511-
rl.bind_sequence(
512-
KeyEvent(KeyCode::Char(delegate_key_char), Modifiers::CTRL),
513-
EventHandler::Simple(Cmd::Insert(1, "/delegate ".to_string())),
514-
);
509+
if ExperimentManager::is_enabled(os, ExperimentName::Delegate) {
510+
if let Some(key) = os.database.settings.get_string(Setting::DelegateModeKey) {
511+
if key.len() == 1 {
512+
rl.bind_sequence(
513+
KeyEvent(KeyCode::Char(key.chars().next().unwrap()), Modifiers::CTRL),
514+
EventHandler::Simple(Cmd::Insert(1, "/delegate ".to_string())),
515+
);
516+
}
517+
};
518+
}
515519

516520
// Add custom keybinding for Alt+Enter to insert a newline
517521
rl.bind_sequence(

0 commit comments

Comments
 (0)