Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/tui/chat/render_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ func TestExecCommandPreservesSafeBoundedMultilineInvocation(t *testing.T) {

plain := ansi.Strip(RenderBlock(block, 32, DefaultStyles(true), 0))
want := strings.Join([]string{
"✓ ran python3 - <<'PY'",
"✓ ran python3 - <<'PY' in .",
" │ import json",
" │ print('long command line th…",
" │ … +4 lines",
Expand Down
3 changes: 3 additions & 0 deletions internal/tui/chat/tool.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ func classifyTool(tool *agent.ToolBlock) toolPresentation {
if decodeObject(input, &in) && in.Cmd != "" {
// Preserve command line boundaries for the exec-specific renderer. The
// working directory remains compact metadata in the header.
if in.Workdir == "" {
in.Workdir = "."
}
p.argument, p.context = escape.Multiline(in.Cmd), escape.SingleLine(in.Workdir)
if in.TimeoutMS != nil && *in.TimeoutMS > 0 && *in.TimeoutMS <= spec.ExecMaxTimeoutMS {
p.timeout = (time.Duration(*in.TimeoutMS) * time.Millisecond).String()
Expand Down
Loading