Skip to content

Commit d815e24

Browse files
committed
feat(tools): emit full tool output for frontend display
- ls: emit full sorted file listing via tool_output (UI shows in collapsible section) - Command: always emit stdout/stderr via tool_output (was TUI-only)
1 parent cd58f0e commit d815e24

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

cecli/tools/command.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ async def _execute_with_timeout(cls, coder, command_string, timeout, use_pty=Fal
287287
# Remove from background tracking since it's done
288288
BackgroundCommandManager.stop_background_command(command_key)
289289

290-
# Output to TUI console if TUI exists (same logic as _execute_foreground)
291-
if coder.tui and coder.tui():
290+
# Emit output to frontend (tool card collapsible output)
291+
if output_content.strip():
292292
coder.io.tool_output(output_content, type="tool-result")
293293

294294
if exit_code == 0:

cecli/tools/ls.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ def execute(cls, coder, path=None, **kwargs):
8080
f"📋 Listed {len(contents)} file(s) in '{dir_path}'", type="tool-result"
8181
)
8282
sorted_contents = sorted(contents)
83+
# Emit full listing for frontend tool card (collapsible output)
84+
coder.io.tool_output("\n".join(sorted_contents))
8385
if len(sorted_contents) > 10:
8486
return (
8587
f"Found {len(sorted_contents)} files: {', '.join(sorted_contents[:10])}..."

0 commit comments

Comments
 (0)