File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
crates/chat-cli/src/cli/chat Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -802,7 +802,7 @@ impl ChatSession {
802
802
) ?;
803
803
( "Unable to compact the conversation history" , eyre ! ( err) , true )
804
804
} ,
805
- ChatError :: Client ( err) => match * err {
805
+ ChatError :: SendMessage ( err) => match err. source {
806
806
// Errors from attempting to send too large of a conversation history. In
807
807
// this case, attempt to automatically compact the history for the user.
808
808
ApiClientError :: ContextWindowOverflow { .. } => {
@@ -1307,7 +1307,9 @@ impl ChatSession {
1307
1307
// retryable according to the passed strategy.
1308
1308
let history_len = self . conversation . history ( ) . len ( ) ;
1309
1309
match err {
1310
- ChatError :: Client ( err) if matches ! ( * err, ApiClientError :: ContextWindowOverflow { .. } ) => {
1310
+ ChatError :: SendMessage ( err)
1311
+ if matches ! ( err. source, ApiClientError :: ContextWindowOverflow { .. } ) =>
1312
+ {
1311
1313
error ! ( ?strategy, "failed to send compaction request" ) ;
1312
1314
// If there's only two messages in the history, we have no choice but to
1313
1315
// truncate it. We use two messages since it's almost guaranteed to contain:
You can’t perform that action at this time.
0 commit comments