Skip to content

Commit 23297eb

Browse files
brandonskiserkensave
authored andcommitted
chore: remove max limit on conversation length (#3038)
1 parent 49962ac commit 23297eb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
pub const MAX_CURRENT_WORKING_DIRECTORY_LEN: usize = 256;
44

55
/// Limit to send the number of messages as part of chat.
6-
pub const MAX_CONVERSATION_STATE_HISTORY_LEN: usize = 250;
6+
pub const MAX_CONVERSATION_STATE_HISTORY_LEN: usize = 10000;
77

88
/// Actual service limit is 800_000
99
pub const MAX_TOOL_RESPONSE_SIZE: usize = 400_000;

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ impl ConversationState {
199199
next_message: None,
200200
history: VecDeque::new(),
201201
valid_history_range: Default::default(),
202-
transcript: VecDeque::with_capacity(MAX_CONVERSATION_STATE_HISTORY_LEN),
202+
transcript: VecDeque::new(),
203203
tools: format_tool_spec(tool_config),
204204
context_manager,
205205
tool_manager,
@@ -1389,7 +1389,7 @@ mod tests {
13891389
// First, build a large conversation history. We need to ensure that the order is always
13901390
// User -> Assistant -> User -> Assistant ...and so on.
13911391
conversation.set_next_user_message("start".to_string()).await;
1392-
for i in 0..=(MAX_CONVERSATION_STATE_HISTORY_LEN + 100) {
1392+
for i in 0..=200 {
13931393
let s = conversation
13941394
.as_sendable_conversation_state(&os, &mut vec![], true)
13951395
.await
@@ -1419,7 +1419,7 @@ mod tests {
14191419
)
14201420
.await;
14211421
conversation.set_next_user_message("start".to_string()).await;
1422-
for i in 0..=(MAX_CONVERSATION_STATE_HISTORY_LEN + 100) {
1422+
for i in 0..=200 {
14231423
let s = conversation
14241424
.as_sendable_conversation_state(&os, &mut vec![], true)
14251425
.await
@@ -1455,7 +1455,7 @@ mod tests {
14551455
)
14561456
.await;
14571457
conversation.set_next_user_message("start".to_string()).await;
1458-
for i in 0..=(MAX_CONVERSATION_STATE_HISTORY_LEN + 100) {
1458+
for i in 0..=200 {
14591459
let s = conversation
14601460
.as_sendable_conversation_state(&os, &mut vec![], true)
14611461
.await
@@ -1515,7 +1515,7 @@ mod tests {
15151515
// First, build a large conversation history. We need to ensure that the order is always
15161516
// User -> Assistant -> User -> Assistant ...and so on.
15171517
conversation.set_next_user_message("start".to_string()).await;
1518-
for i in 0..=(MAX_CONVERSATION_STATE_HISTORY_LEN + 100) {
1518+
for i in 0..=200 {
15191519
let s = conversation
15201520
.as_sendable_conversation_state(&os, &mut vec![], true)
15211521
.await

0 commit comments

Comments
 (0)