@@ -1403,6 +1403,16 @@ impl ChatSession {
1403
1403
self . tool_use_status = ToolUseStatus :: Idle ;
1404
1404
1405
1405
if self . pending_tool_index . is_some ( ) {
1406
+ // If the user just enters "n", replace the message we send to the model with
1407
+ // something more substantial.
1408
+ // TODO: Update this flow to something that does *not* require two requests just to
1409
+ // get a meaningful response from the user - this is a short term solution before
1410
+ // we decide on a better flow.
1411
+ let user_input = if [ "n" , "N" ] . contains ( & user_input. trim ( ) ) {
1412
+ "I deny this tool request. Ask a follow up question clarifying the expected action" . to_string ( )
1413
+ } else {
1414
+ user_input
1415
+ } ;
1406
1416
self . conversation . abandon_tool_use ( & self . tool_uses , user_input) ;
1407
1417
} else {
1408
1418
self . conversation . set_next_user_message ( user_input) . await ;
@@ -1787,7 +1797,7 @@ impl ChatSession {
1787
1797
match interpret_markdown ( input, & mut self . stdout , & mut state) {
1788
1798
Ok ( parsed) => {
1789
1799
offset += parsed. offset_from ( & input) ;
1790
- self . stderr . flush ( ) ?;
1800
+ self . stdout . flush ( ) ?;
1791
1801
state. newline = state. set_newline ;
1792
1802
state. set_newline = false ;
1793
1803
} ,
@@ -1825,11 +1835,11 @@ impl ChatSession {
1825
1835
}
1826
1836
1827
1837
queue ! ( self . stderr, style:: ResetColor , style:: SetAttribute ( Attribute :: Reset ) ) ?;
1828
- execute ! ( self . stderr , style:: Print ( "\n " ) ) ?;
1838
+ execute ! ( self . stdout , style:: Print ( "\n " ) ) ?;
1829
1839
1830
1840
for ( i, citation) in & state. citations {
1831
1841
queue ! (
1832
- self . stderr ,
1842
+ self . stdout ,
1833
1843
style:: Print ( "\n " ) ,
1834
1844
style:: SetForegroundColor ( Color :: Blue ) ,
1835
1845
style:: Print ( format!( "[^{i}]: " ) ) ,
0 commit comments