@@ -760,6 +760,66 @@ def test_tool_call_non_dict_arguments(self):
760760 self .assertIn ("tool: Bash" , out )
761761 self .assertNotIn ("ls" , out )
762762
763+ def test_tool_call_args_shown (self ):
764+ """Short arguments render inside the tool label."""
765+ tui , buf = make_tui ()
766+ tui .session .last_messages = [
767+ Message (role = "user" , content = "go" ),
768+ Message (
769+ role = "assistant" ,
770+ content = "" ,
771+ tool_calls = [ToolCall (id = "1" , name = "Read" , arguments = '{"file_path": "a.py"}' )],
772+ ),
773+ Message (role = "tool" , content = "x" , tool_call_id = "1" , name = "Read" ),
774+ ]
775+ tui .console .print (tui ._render_conversation ())
776+ out = buf .getvalue ()
777+ self .assertIn ("tool: Read(file_path='a.py')" , out )
778+
779+ def test_tool_call_long_args_truncated_not_dropped (self ):
780+ """A long argument value (e.g. a long Bash command) is truncated
781+ with an ellipsis, not dropped from the label."""
782+ tui , buf = make_tui ()
783+ cmd = "echo " + "y" * 300
784+ tui .session .last_messages = [
785+ Message (role = "user" , content = "go" ),
786+ Message (
787+ role = "assistant" ,
788+ content = "" ,
789+ tool_calls = [ToolCall (id = "1" , name = "Bash" , arguments = f'{{"command": "{ cmd } "}}' )],
790+ ),
791+ Message (role = "tool" , content = "ok" , tool_call_id = "1" , name = "Bash" ),
792+ ]
793+ tui .console .print (tui ._render_conversation ())
794+ out = buf .getvalue ()
795+ self .assertIn ("tool: Bash(command=" , out )
796+ self .assertIn ("…" , out ) # truncation marker present
797+ self .assertNotIn (cmd , out ) # full value not rendered
798+ self .assertIn ("y" * 50 , out ) # head of the value shown
799+
800+ def test_tool_call_content_arg_hidden (self ):
801+ """The 'content' argument stays hidden (huge payloads, noise)."""
802+ tui , buf = make_tui ()
803+ tui .session .last_messages = [
804+ Message (role = "user" , content = "go" ),
805+ Message (
806+ role = "assistant" ,
807+ content = "" ,
808+ tool_calls = [
809+ ToolCall (
810+ id = "1" ,
811+ name = "Write" ,
812+ arguments = '{"file_path": "a.py", "content": "huge body"}' ,
813+ )
814+ ],
815+ ),
816+ Message (role = "tool" , content = "ok" , tool_call_id = "1" , name = "Write" ),
817+ ]
818+ tui .console .print (tui ._render_conversation ())
819+ out = buf .getvalue ()
820+ self .assertIn ("tool: Write(file_path='a.py')" , out )
821+ self .assertNotIn ("huge body" , out )
822+
763823 # ------------------------------------------------------------------
764824 # row budget: visible-row cap and line estimates
765825 # ------------------------------------------------------------------
0 commit comments