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 {
802802 ) ?;
803803 ( "Unable to compact the conversation history" , eyre ! ( err) , true )
804804 } ,
805- ChatError :: Client ( err) => match * err {
805+ ChatError :: SendMessage ( err) => match err. source {
806806 // Errors from attempting to send too large of a conversation history. In
807807 // this case, attempt to automatically compact the history for the user.
808808 ApiClientError :: ContextWindowOverflow { .. } => {
@@ -1307,7 +1307,9 @@ impl ChatSession {
13071307 // retryable according to the passed strategy.
13081308 let history_len = self . conversation . history ( ) . len ( ) ;
13091309 match err {
1310- ChatError :: Client ( err) if matches ! ( * err, ApiClientError :: ContextWindowOverflow { .. } ) => {
1310+ ChatError :: SendMessage ( err)
1311+ if matches ! ( err. source, ApiClientError :: ContextWindowOverflow { .. } ) =>
1312+ {
13111313 error ! ( ?strategy, "failed to send compaction request" ) ;
13121314 // If there's only two messages in the history, we have no choice but to
13131315 // 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