Skip to content

Commit f50dc82

Browse files
committed
fix: uncommited changes warning, failed integrations links and more should be present also for thinking agent mode
1 parent 7879d0a commit f50dc82

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

refact-agent/engine/src/call_validation.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,14 @@ impl ChatMode {
245245
ChatMode::THINKING_AGENT => true,
246246
}
247247
}
248+
249+
pub fn is_agentic(self) -> bool {
250+
match self {
251+
ChatMode::AGENT | ChatMode::THINKING_AGENT => true,
252+
ChatMode::NO_TOOLS | ChatMode::EXPLORE | ChatMode::CONFIGURE |
253+
ChatMode::PROJECT_SUMMARY => false,
254+
}
255+
}
248256
}
249257

250258
impl Default for ChatMode {

refact-agent/engine/src/http/routers/v1/links.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ pub async fn handle_v1_links(
109109
}
110110

111111
// GIT Init
112-
// if post.meta.chat_mode == ChatMode::AGENT && post.messages.is_empty() {
112+
// if post.meta.chat_mode.is_agentic() && post.messages.is_empty() {
113113
// if let Some(path) = crate::files_correction::get_active_project_path(gcx.clone()).await {
114114
// let path_has_vcs = {
115115
// let cx_locked = gcx.write().await;
@@ -129,7 +129,7 @@ pub async fn handle_v1_links(
129129
// }
130130

131131
// GIT uncommitted
132-
if post.meta.chat_mode == ChatMode::AGENT && post.messages.is_empty() {
132+
if post.meta.chat_mode.is_agentic() && post.messages.is_empty() {
133133
let commits_info = get_commit_information_from_current_changes(gcx.clone()).await;
134134

135135
let mut commit_texts = Vec::new();
@@ -205,7 +205,7 @@ pub async fn handle_v1_links(
205205
}
206206

207207
// Failures in integrations
208-
if post.meta.chat_mode == ChatMode::AGENT {
208+
if post.meta.chat_mode.is_agentic() {
209209
for failed_integr_name in failed_integration_names_after_last_user_message(&post.messages) {
210210
links.push(Link {
211211
link_action: LinkAction::Goto,
@@ -252,7 +252,7 @@ pub async fn handle_v1_links(
252252

253253
// Tool recommendations
254254
/* temporary remove project summary and recomended integrations
255-
if (post.meta.chat_mode == ChatMode::AGENT) {
255+
if post.meta.chat_mode.is_agentic() {
256256
if post.messages.is_empty() {
257257
let (summary_exists, summary_path_option) = crate::scratchpads::chat_utils_prompts::dig_for_project_summarization_file(gcx.clone()).await;
258258
if !summary_exists {

0 commit comments

Comments
 (0)