@@ -76,10 +76,6 @@ function M.format_session(session)
7676 M .output :add_empty_line ()
7777 end
7878
79- if state .current_permission and state .current_permission .messageID == msg .id then
80- return M ._format_permission_request ()
81- end
82-
8379 if msg .error and msg .error ~= ' ' then
8480 M ._format_error (msg )
8581 end
@@ -103,7 +99,7 @@ function M._format_permission_request()
10399 )
104100 )
105101 M .output :add_empty_line ()
106- return M .output :get_lines ()
102+ -- return M.output:get_lines()
107103end
108104
109105--- @param line number Buffer line number
@@ -546,7 +542,7 @@ function M._format_tool(part)
546542 local metadata = (part .state and part .state .metadata ) or {}
547543 local output = (part .state and part .state .output ) or ' '
548544
549- if state .current_permission and state .current_permission .messageID == state . current_message . id then
545+ if state .current_permission and state .current_permission .messageID == part . messageID then
550546 metadata = state .current_permission .metadata or metadata
551547 end
552548
@@ -574,6 +570,10 @@ function M._format_tool(part)
574570 M ._format_callout (' ERROR' , part .state .error )
575571 end
576572
573+ if state .current_permission and state .current_permission .messageID == part .messageID then
574+ M ._format_permission_request ()
575+ end
576+
577577 M .output :add_empty_line ()
578578
579579 local end_line = M .output :get_line_count ()
0 commit comments